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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    position: relative;
}

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

#infinityCanvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000 100%);
}

#infinityCanvas:active {
    cursor: grabbing;
}

/* コントロールパネル */
.controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.infinity-selector {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.infinity-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.infinity-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.infinity-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* 情報パネル */
.info-panel {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 350px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.info-panel h2 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.info-panel p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.stats {
    display: flex;
    gap: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat span:last-child {
    font-size: 20px;
    font-weight: 300;
    color: #fff;
    font-family: 'Courier New', monospace;
}

/* ズームコントロール */
.zoom-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zoom-controls button {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.zoom-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.zoom-controls button:active {
    transform: scale(0.95);
}

/* ヒント */
.hint {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    animation: fadeInOut 5s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* モバイル対応 */
@media (max-width: 768px) {
    .controls {
        top: 10px;
        padding: 8px;
        width: calc(100% - 20px);
        left: 10px;
        transform: none;
    }
    
    .infinity-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .info-panel {
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: none;
        padding: 20px;
    }
    
    .info-panel h2 {
        font-size: 20px;
    }
    
    .info-panel p {
        font-size: 13px;
    }
    
    .zoom-controls {
        bottom: auto;
        top: 100px;
        right: 20px;
    }
    
    .zoom-controls button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .hint {
        display: none;
    }
}

/* 極小画面対応 */
@media (max-width: 400px) {
    .infinity-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .info-panel {
        padding: 15px;
    }
    
    .info-panel h2 {
        font-size: 18px;
    }
    
    .info-panel p {
        font-size: 12px;
    }
    
    .stats {
        gap: 20px;
    }
    
    .stat span:last-child {
        font-size: 16px;
    }
}

/* タッチデバイスでのハイライト無効化 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 無限の象徴的な表現 */
.container::before {
    content: '∞';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 500px;
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    z-index: 0;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}