:root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #111114;
    --bg-card: #16161a;
    --accent-primary: #ff6b35;
    --accent-secondary: #f7c59f;
    --accent-glow: rgba(255, 107, 53, 0.4);
    --text-primary: #fafafa;
    --text-secondary: #a0a0a8;
    --text-muted: #5a5a64;
    --border-color: #2a2a32;
    --success: #4ade80;
    --card-play: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --card-download: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --card-watch: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Syne', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: -1;
}

/* Grid overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,107,53,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,107,53,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 100;
    background: linear-gradient(to bottom, var(--bg-primary) 0%, transparent 100%);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

.logo-icon {
    color: var(--accent-primary);
    font-size: 1.4rem;
}

.logo-img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem 3rem;
    position: relative;
    z-index: 10;
}

.hero-content {
    max-width: 800px;
    width: 100%;
}

.title-section {
    margin-bottom: 4rem;
    text-align: center;
}

.subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.main-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 0.9;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
}

.title-line.accent {
    color: var(--accent-primary);
    font-style: italic;
}

.description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Action Cards */
.action-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.card-play::before { background: var(--card-play); }
.card-download::before { background: var(--card-download); }
.card-watch::before { background: var(--card-watch); }

.card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: transparent;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.card:hover::before {
    opacity: 1;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 14px;
    flex-shrink: 0;
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.card:hover .card-content p {
    color: rgba(255,255,255,0.8);
}

.card-arrow {
    font-size: 1.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Download Panel */
.download-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                margin 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-top: 0;
}

.download-panel.active {
    max-height: 300px;
    margin-top: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.download-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.download-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

a.download-item {
    cursor: pointer;
}

a.download-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.download-item.coming-soon {
    cursor: default;
    opacity: 0.7;
}

.download-item.coming-soon small {
    color: var(--accent-secondary);
}

.platform-icon {
    font-size: 1.5rem;
}

.download-item span {
    font-weight: 600;
    font-size: 0.95rem;
}

.download-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.download-item:hover small {
    color: rgba(255,255,255,0.7);
}

.download-note {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-note a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.download-note a:hover {
    text-decoration: underline;
}

/* Characters Preview */
.characters-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.character-bubble {
    position: absolute;
    left: var(--x);
    top: var(--y);
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.character-bubble:hover {
    opacity: 1;
}

.character-bubble .portrait-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    background: var(--bg-secondary);
    overflow: hidden;
}

.character-bubble img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.portrait-emoji {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.character-bubble .portrait-emoji {
    width: 64px;
    height: 64px;
    border-width: 3px;
    font-size: 32px;
}

.char-name {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* Game Container */
.game-container,
.claude-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 200;
    display: none;
    flex-direction: column;
}

.game-container.active,
.claude-container.active {
    display: flex;
}

.game-header,
.claude-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.game-controls button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.game-controls button:hover {
    background: var(--accent-primary);
}

.game-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    padding: 1rem;
}

.game-wrapper iframe {
    width: 100%;
    max-width: 1280px;
    height: 100%;
    max-height: 720px;
    aspect-ratio: 16/9;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.game-loading {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.game-loading.hidden {
    display: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Claude Watch Mode */
.claude-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    overflow: hidden;
}

.claude-game {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.claude-game iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.claude-thoughts {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.claude-thoughts h3 {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--accent-secondary);
}

.thoughts-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.thought {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-primary);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.claude-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

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

/* Responsive */
@media (max-width: 900px) {
    .claude-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 200px;
    }
    
    .claude-thoughts {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    .hero {
        padding: 5rem 1.5rem 2rem;
    }
    
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .character-bubble {
        display: none;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
    }
    
    .card-content h3 {
        font-size: 1.1rem;
    }
}

/* How It Works Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.character-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.character-card .portrait-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.character-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.character-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.character-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.character-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.character-ai {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    width: fit-content;
    margin-top: 0.25rem;
}

.character-ai.claude {
    background: rgba(217, 119, 6, 0.2);
    color: #f59e0b;
}

.character-ai.openai {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.character-ai.grok {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.character-ai.gemini {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.character-ai.deepseek {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* How to Play Modal */
.modal-large {
    max-width: 800px;
}

.play-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.play-section:last-of-type {
    border-bottom: none;
}

.play-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.play-section p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.play-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.play-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.play-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.play-list li strong {
    color: var(--text-primary);
}

.claude-section {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.watch-claude-btn {
    background: linear-gradient(135deg, var(--accent-primary), #ff8f5a);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.watch-claude-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

@media (max-width: 600px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}
