* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --shadow-opacity: 0.7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    perspective: 1000px;
}

.experience-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* 3Dシーン */
.scene-3d {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: filter 0.3s ease;
}

/* キャンバス */
canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#mainCanvas {
    z-index: 1;
    opacity: 0.5;
}

#particleField {
    z-index: 2;
    pointer-events: none;
}

/* 立体視オーバーレイ */
.stereoscopic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.depth-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.layer-1 {
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 100, 200, 0.1) 70%);
}

.layer-2 {
    background: radial-gradient(circle at center, transparent 40%, rgba(100, 0, 200, 0.05) 80%);
}

.layer-3 {
    background: radial-gradient(circle at center, transparent 50%, rgba(200, 0, 100, 0.03) 90%);
}

/* ホログラムUI */
.hologram-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.holo-panel {
    position: absolute;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(255, 0, 255, 0.05) 100%);
    border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    clip-path: polygon(0 0, 100% 0, 100% 80%, 90% 100%, 0 100%);
}

.holo-panel h3 {
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: #00ffff;
    margin-bottom: 0.5rem;
}

.top-left {
    top: 2rem;
    left: 2rem;
}

.top-right {
    top: 2rem;
    right: 2rem;
}

.bottom-left {
    bottom: 2rem;
    left: 2rem;
}

.depth-meter {
    width: 100px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.depth-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, #00ffff, #0080ff);
    transition: height 0.1s ease;
}

.parallax-display {
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.perspective-grid {
    width: 100px;
    height: 100px;
    position: relative;
    transform: rotateX(60deg);
}

.grid-line {
    position: absolute;
    background: rgba(0, 255, 255, 0.3);
}

.grid-line:nth-child(1) {
    width: 100%;
    height: 1px;
    top: 33%;
}

.grid-line:nth-child(2) {
    width: 100%;
    height: 1px;
    top: 66%;
}

.grid-line:nth-child(3) {
    width: 1px;
    height: 100%;
    left: 50%;
}

/* フローティングオブジェクト */
.floating-objects {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    transform-style: preserve-3d;
    z-index: 5;
}

/* キューブ */
.floating-cube {
    position: absolute;
    width: 150px;
    height: 150px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, filter 0.3s ease;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.cube-face.front {
    transform: translateZ(75px);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 200, 200, 0.1) 100%);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(75px);
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.2) 0%, rgba(200, 0, 200, 0.1) 100%);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(75px);
    background: linear-gradient(135deg, rgba(255, 255, 0, 0.2) 0%, rgba(200, 200, 0, 0.1) 100%);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(75px);
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 200, 0, 0.1) 100%);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(75px);
    background: linear-gradient(135deg, rgba(255, 100, 0, 0.2) 0%, rgba(200, 80, 0, 0.1) 100%);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(75px);
    background: linear-gradient(135deg, rgba(100, 0, 255, 0.2) 0%, rgba(80, 0, 200, 0.1) 100%);
}

/* スフィア */
.floating-sphere {
    position: absolute;
    width: 120px;
    height: 120px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, filter 0.3s ease;
}

.floating-sphere::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(0, 150, 255, 0.2));
    border-radius: 50%;
    box-shadow: 
        inset -20px -20px 40px rgba(0, 0, 0, 0.5),
        inset 20px 20px 40px rgba(255, 255, 255, 0.3),
        0 0 50px rgba(0, 150, 255, 0.5);
}

.sphere-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(circle, rgba(0, 150, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: sphereGlow 3s ease-in-out infinite;
}

@keyframes sphereGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* ピラミッド */
.floating-pyramid {
    position: absolute;
    width: 100px;
    height: 100px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, filter 0.3s ease;
}

.pyramid-face {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.pyramid-face:nth-child(1) {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid rgba(255, 215, 0, 0.3);
    transform: rotateY(0deg) translateZ(25px);
}

.pyramid-face:nth-child(2) {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid rgba(255, 100, 0, 0.3);
    transform: rotateY(90deg) translateZ(25px);
}

.pyramid-face:nth-child(3) {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid rgba(255, 0, 100, 0.3);
    transform: rotateY(180deg) translateZ(25px);
}

.pyramid-face:nth-child(4) {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid rgba(100, 0, 255, 0.3);
    transform: rotateY(270deg) translateZ(25px);
}

/* ライティングシステム */
.lighting-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.light-source {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 200, 0.8) 0%, transparent 50%);
    border-radius: 50%;
    filter: blur(20px);
    transition: all 0.1s ease;
}

.volumetric-light {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    mix-blend-mode: screen;
    pointer-events: none;
}

.shadow-caster {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: blur(30px);
    opacity: var(--shadow-opacity);
}

/* リフレクション */
.reflection-plane {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    z-index: 6;
    pointer-events: none;
}

.reflection-content {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: scaleY(-1);
    opacity: 0.3;
    filter: blur(2px);
}

/* コントロールパネル */
.control-panel {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    z-index: 100;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.8rem;
    opacity: 0.8;
}

input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
}

.view-modes {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-btn.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #00ffff;
}

/* インストラクション */
.instructions {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.8;
    font-size: 0.9rem;
    z-index: 100;
}

/* 深度警告 */
.depth-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff0000;
    border-radius: 20px;
    z-index: 1000;
    transition: opacity 1s ease;
}

.warning-icon {
    font-size: 3rem;
    animation: warningPulse 1s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ビューモード */
.anaglyph-mode {
    filter: contrast(1.2);
}

.anaglyph-mode .floating-cube,
.anaglyph-mode .floating-sphere,
.anaglyph-mode .floating-pyramid {
    position: relative;
}

.anaglyph-mode .floating-cube::before,
.anaglyph-mode .floating-sphere::before,
.anaglyph-mode .floating-pyramid::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -5px;
    filter: hue-rotate(-60deg);
    opacity: 0.5;
    mix-blend-mode: screen;
}

.anaglyph-mode .floating-cube::after,
.anaglyph-mode .floating-sphere::after,
.anaglyph-mode .floating-pyramid::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 5px;
    filter: hue-rotate(60deg);
    opacity: 0.5;
    mix-blend-mode: screen;
}

.crosseye-mode {
    display: flex;
}

.crosseye-mode::before,
.crosseye-mode::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
}

.crosseye-mode::before {
    left: 0;
    transform: translateX(2%);
}

.crosseye-mode::after {
    right: 0;
    transform: translateX(-2%);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        width: 90%;
    }
    
    .view-modes {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .floating-cube {
        width: 100px;
        height: 100px;
    }
    
    .floating-sphere {
        width: 80px;
        height: 80px;
    }
    
    .holo-panel {
        transform: scale(0.8);
    }
}