:root {
    --bg-deep: #0a0812;
    --bg-primary: #120a1a;
    --bg-secondary: #1a0f25;
    --bg-tertiary: #241530;
    --bg-elevated: #2e1a3d;
    
    --accent-pink: #ff1493;
    --accent-pink-dim: #c40075;
    --accent-purple: #a855f7;
    --accent-purple-dim: #7c3bc4;
    --accent-orange: #ff6b35;
    --accent-gold: #ffd700;
    --accent-coral: #ff4466;
    
    --text-primary: #f8e8f4;
    --text-secondary: #b8a0b8;
    --text-dim: #6a5060;
    
    --board-light: #2a1a3a;
    --board-dark: #1a0f25;
    --board-border: #3a2a4a;
    
    --highlight-valid: rgba(255, 107, 53, 0.4);
    --highlight-check: rgba(255, 20, 147, 0.5);
    --highlight-checkmate: rgba(255, 68, 102, 0.5);
    --highlight-last: rgba(168, 85, 247, 0.25);
    --highlight-selected: rgba(255, 20, 147, 0.35);
    
    --piece-white: #f8e8f4;
    --piece-black: #1a0f25;

    --border-subtle: rgba(255, 20, 147, 0.15);
    --border-glow: rgba(255, 20, 147, 0.4);
    
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Space Grotesk', sans-serif;
    
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

/* Particle System Styles */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}


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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    line-height: 1.5;
    opacity: 0;
    animation: page-fade-in 0.6s var(--ease-out-expo) forwards;
}

@keyframes page-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(255, 107, 53, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 9999;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1600px;
    height: 100%;
    padding: var(--space-lg);
    gap: var(--space-lg);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 300px;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-20px);
    animation: slide-in-left 0.5s var(--ease-out-expo) forwards;
    animation-delay: 0.2s;
}

.sidebar.right-sidebar {
    animation-delay: 0.4s;
    transform: translateX(20px);
    animation: slide-in-right 0.5s var(--ease-out-expo) forwards;
}

@keyframes slide-in-left {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink), transparent);
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-pink);
    text-shadow: 0 0 20px var(--accent-pink);
    animation: pulse-glow 2s ease-in-out infinite;
    opacity: 0;
    animation: pulse-glow 2s ease-in-out infinite, logo-glow-in 0.8s var(--ease-out-expo) forwards;
}

@keyframes logo-glow-in {
    0% { opacity: 0; transform: scale(0.8); filter: blur(4px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px var(--accent-pink); }
    50% { text-shadow: 0 0 30px var(--accent-pink), 0 0 40px var(--accent-pink); }
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    margin-top: var(--space-xs);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 2px;
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: var(--space-md);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-pink), transparent);
    opacity: 0.5;
}

.panel.move-log::before {
    background: linear-gradient(90deg, transparent, var(--accent-pink), transparent);
}

.panel.ai-coach::before {
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
}

.panel.ai-coach .panel-icon {
    color: var(--accent-purple);
}

.panel.captured-panel::before {
    background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
}

.panel.captured-panel .panel-icon {
    color: var(--accent-orange);
}

.panel.captured-panel.dark::before {
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.panel.captured-panel.dark .panel-icon {
    color: var(--accent-gold);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header.dark {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.panel-icon {
    font-size: 0.875rem;
    color: var(--accent-pink);
    opacity: 0.8;
}

.panel-header h3 {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 240, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px rgba(255, 20, 147, 0.25);
    transform: translateY(-1px);
}

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

.btn:active {
    transform: scale(0.95) translateY(0);
    transition-duration: 0.1s;
}

.btn-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-pink-dim) 0%, var(--accent-purple-dim) 100%);
    border-color: var(--accent-pink);
    color: var(--bg-deep);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.btn.primary:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
    border-color: var(--accent-pink);
}

.btn.primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-row {
    display: flex;
    gap: var(--space-sm);
    margin: var(--space-sm) 0;
}

.btn-row .btn {
    flex: 1;
}

.btn.toggle {
    justify-content: flex-start;
    padding-left: var(--space-md);
}

.toggle-indicator {
    width: 36px;
    height: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    position: relative;
    transition: all 0.2s var(--ease-out-expo);
    flex-shrink: 0;
}

.toggle-indicator::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all 0.2s var(--ease-out-expo);
}

.btn.toggle.active .toggle-indicator {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.4);
}

.btn.toggle.active .toggle-indicator::before {
    left: 18px;
    background: var(--bg-deep);
    transition: transform 0.25s var(--ease-out-expo), background 0.25s;
}

.captured-panel .pieces-box {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    min-height: 36px;
    font-size: 1.25rem;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.captured-panel .pieces-box span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.15s var(--ease-out-expo);
}

.captured-panel .pieces-box span:hover {
    transform: scale(1.2);
}

.piece-symbol-w {
    color: var(--piece-white);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.piece-symbol-b {
    color: var(--piece-black);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.3);
}

.board-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    min-width: 0;
    opacity: 0;
    transform: scale(0.9);
    animation: board-zoom-in 0.6s var(--ease-out-expo) forwards;
    animation-delay: 0.3s;
}

@keyframes board-zoom-in {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.board-wrapper {
    position: relative;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 
        0 0 60px rgba(255, 20, 147, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.board-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at center, transparent 0%, rgba(255, 20, 147, 0.05) 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out-expo);
}

.board-wrapper.active-glow::before {
    opacity: 1;
    animation: board-pulse 2s ease-in-out infinite;
}

@keyframes board-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.board-frame {
    position: relative;
    padding: var(--space-md);
}

.corner-tl, .corner-tr, .corner-bl, .corner-br {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-pink);
    opacity: 0.6;
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.scanline {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 240, 255, 0.02) 50%,
        transparent 100%
    );
    pointer-events: none;
    animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.rank-labels {
    position: absolute;
    left: 0;
    top: var(--space-md);
    bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 var(--space-sm);
}

.rank-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dim);
}

.file-labels {
    position: absolute;
    bottom: 0;
    left: var(--space-md);
    right: var(--space-md);
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm) 0 0;
}

.file-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dim);
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: min(65vh, 650px);
    height: min(65vh, 650px);
    border: 2px solid var(--board-border);
    box-shadow: 
        0 0 40px rgba(0, 255, 136, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.square {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    transition: background-color 0.15s;
}

.square.light {
    background-color: var(--board-light);
    box-shadow: inset 0 0 30px rgba(0, 255, 136, 0.05);
}

.square.dark {
    background-color: var(--board-dark);
    box-shadow: inset 0 0 40px rgba(0, 255, 136, 0.08);
}

.square.last-move::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--highlight-last);
    z-index: 1;
    animation: last-move-glow 2s ease-in-out infinite;
}

@keyframes last-move-glow {
    0%, 100% { background-color: var(--highlight-last); }
    50% { background-color: rgba(0, 240, 255, 0.35); }
}

.square.check::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--highlight-check) 0%, transparent 70%);
    z-index: 1;
    animation: check-pulse 1s ease-in-out infinite;
}

@keyframes check-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background-color: var(--highlight-valid);
    box-shadow: 0 0 10px var(--accent-orange);
    z-index: 2;
    animation: valid-pulse 2s ease-in-out infinite;
}

@keyframes valid-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.square.valid-move.capture::after {
    width: 85%;
    height: 85%;
    background-color: transparent;
    border: 3px solid var(--highlight-valid);
    box-shadow: 0 0 15px var(--accent-orange);
    border-radius: 4px;
}

.square.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--highlight-selected);
    z-index: 1;
}

.piece {
    font-size: clamp(2rem, 5vmin, 4.5rem);
    z-index: 3;
    cursor: grab;
    user-select: none;
    line-height: 1;
    transition: transform 0.1s var(--ease-out-expo);
    position: relative;
}

.piece:active {
    cursor: grabbing;
    transform: scale(1.08);
}

.piece.piece-moved {
    animation: piece-move-pop 0.3s var(--ease-out-expo);
}

@keyframes piece-move-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.piece.w {
    color: var(--piece-white);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3);
}

.piece.b {
    color: var(--piece-black);
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.2),
        0 0 15px rgba(0, 0, 0, 0.8);
}

.game-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    transition: all 0.3s var(--ease-out-expo);
}

.game-status.check {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(255, 0, 170, 0.2);
}

.game-status.checkmate {
    border-color: var(--accent-coral);
    background: rgba(255, 68, 102, 0.1);
    box-shadow: 0 0 30px rgba(255, 68, 102, 0.3);
}

.game-status.checkmate .status-indicator {
    background: var(--accent-coral);
    box-shadow: 0 0 20px var(--accent-coral);
}

.game-status.draw {
    border-color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-pink);
    animation: status-pulse 2s ease-in-out infinite;
    transition: all 0.3s var(--ease-out-expo);
}

.game-status.check .status-indicator {
    background: var(--accent-purple);
    box-shadow: 0 0 20px var(--accent-purple);
    animation: check-pulse 0.8s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px var(--accent-pink); }
    50% { opacity: 0.6; box-shadow: 0 0 8px var(--accent-pink); }
}

@keyframes check-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

#status-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.move-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 280px;
}

.move-list {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: 4px;
    padding: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--border-subtle);
}

.move-row {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: var(--space-sm);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.move-row:last-child {
    border-bottom: none;
}

.move-num {
    color: var(--text-dim);
    text-align: right;
    padding-right: var(--space-sm);
}

.move-w, .move-b {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 2px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.move-w:hover, .move-b:hover {
    background: var(--bg-tertiary);
    color: var(--accent-pink);
}

.move-list::-webkit-scrollbar {
    width: 4px;
}

.move-list::-webkit-scrollbar-track {
    background: transparent;
}

.move-list::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.ai-coach {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 380px;
}

.coach-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}

.coach-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-pink);
    border-radius: 50%;
}

.avatar-icon {
    font-size: 1.2rem;
    color: var(--accent-pink);
}

.avatar-pulse {
    position: absolute;
    inset: -3px;
    border: 1px solid var(--accent-pink);
    border-radius: 50%;
    animation: avatar-pulse 2s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes avatar-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0; }
}

.coach-title {
    display: flex;
    flex-direction: column;
}

.coach-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.coach-status {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.coach-status::before {
    content: '●';
    margin-right: 4px;
    font-size: 0.5rem;
}

.coach-chat {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-right: var(--space-sm);
}

.msg {
    display: flex;
    gap: var(--space-sm);
    animation: msg-slide-in 0.3s var(--ease-out-expo);
}

@keyframes msg-slide-in {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.msg-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-pink);
    opacity: 0.7;
}

.msg-content {
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 95%;
}

.msg.assistant .msg-content {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-left: 2px solid var(--accent-pink);
}

.msg.user {
    flex-direction: row-reverse;
}

.msg.user .msg-content {
    background: linear-gradient(135deg, var(--accent-pink-dim), var(--accent-purple));
    color: var(--bg-deep);
    border-left: none;
    border-right: 2px solid var(--accent-purple);
}

.msg.user .msg-icon {
    display: none;
}

.coach-chat::-webkit-scrollbar {
    width: 4px;
}

.coach-chat::-webkit-scrollbar-track {
    background: transparent;
}

.coach-chat::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.coach-input {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.coach-input input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.65rem var(--space-md);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s var(--ease-out-expo);
}

.coach-input input::placeholder {
    color: var(--text-dim);
}

.coach-input input:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.coach-input button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    color: var(--accent-pink);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s var(--ease-out-expo);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coach-input button:hover {
    background: var(--accent-pink);
    color: var(--bg-deep);
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px rgba(255, 20, 147, 0.4);
    transform: scale(1.05);
}

.coach-input button:active {
    transform: scale(0.95);
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s var(--ease-out-expo);
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    padding: var(--space-xl);
    border-radius: 8px;
    border: 1px solid var(--accent-pink);
    box-shadow: 
        0 0 60px rgba(0, 240, 255, 0.2),
        0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: modal-in 0.3s var(--ease-out-expo);
}

@keyframes modal-in {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-pink);
    margin-bottom: var(--space-lg);
}

.promotion-choices {
    display: flex;
    gap: var(--space-md);
}

.promo-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    min-width: 70px;
}

.promo-choice:hover {
    border-color: var(--accent-pink);
    background: var(--bg-elevated);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.promo-piece {
    font-size: 2rem;
    line-height: 1;
}

.promo-choice:nth-child(1) .promo-piece { color: var(--text-primary); }
.promo-choice:nth-child(2) .promo-piece { color: var(--text-secondary); }
.promo-choice:nth-child(3) .promo-piece { color: var(--accent-pink); }
.promo-choice:nth-child(4) .promo-piece { color: var(--accent-purple); }

.promo-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

@media (max-width: 1200px) {
    .app-container {
        padding: var(--space-md);
        gap: var(--space-md);
    }
    
    .sidebar {
        width: 260px;
    }
    
    .chessboard {
        width: min(55vh, 550px);
        height: min(55vh, 550px);
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar > * {
        flex: 1;
        min-width: 200px;
    }
    
    .logo-container {
        width: 100%;
        border-bottom: none;
        padding-bottom: var(--space-sm);
    }
    
    .board-area {
        order: -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}