/* ============================================
   SHADOW SOVEREIGN - ARCANE CHESS
   Dark Fantasy Chess Game Theme
   ============================================ */

/* Import main theme variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: #16161f;
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --cyan: #00ffff;
    --purple: #9b59b6;
    --magenta: #ff00ff;
    --red: #e74c3c;
    --green: #2ecc71;
    --blue: #3498db;
    --legendary: #ff8000;
    --epic: #a335ee;
    --rare: #0070dd;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --font-title: 'Cinzel', serif;
    --font-fantasy: 'MedievalSharp', cursive;
    
    /* Chess specific */
    --board-light: #e8dcc4;
    --board-dark: #4a3728;
    --board-selected: rgba(255, 215, 0, 0.4);
    --board-valid-move: rgba(0, 255, 255, 0.3);
    --board-last-move: rgba(155, 89, 182, 0.3);
    --board-check: rgba(231, 76, 60, 0.5);
}

/* ============================================
   GAME CONTAINER
   ============================================ */
.game-container {
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at center, rgba(155, 89, 182, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 1rem;
    position: relative;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='none'/%3E%3Cpath d='M10 10h80v80H10z' fill='none' stroke='%23ffd700' stroke-width='0.1' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    opacity: 0.2;
    pointer-events: none;
}

/* Back Button */
.back-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--gold-dark);
    color: var(--gold);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-title);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    background: var(--gold-dark);
    color: var(--bg-primary);
    transform: translateX(-5px);
}

.back-icon {
    font-size: 1.2rem;
}

/* ============================================
   GAME HEADER
   ============================================ */
.game-header {
    text-align: center;
    padding: 1rem 1rem 0.5rem;
    margin-bottom: 0.5rem;
}

.game-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 3rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        filter: drop-shadow(0 0 10px var(--cyan));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 20px var(--cyan)) drop-shadow(0 0 40px var(--purple));
        transform: scale(1.1);
    }
}

.game-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--gold), var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin: 0;
    letter-spacing: 3px;
}

.game-subtitle {
    font-family: var(--font-fantasy);
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.game-tagline {
    font-style: italic;
    color: var(--purple);
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* ============================================
   MENU SECTION
   ============================================ */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.menu-card {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.menu-header {
    text-align: center;
    margin-bottom: 2rem;
}

.menu-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.menu-header h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.8rem;
    margin: 0;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.menu-btn:hover {
    transform: translateX(10px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.menu-btn.legendary {
    border-color: var(--legendary);
}

.menu-btn.legendary:hover {
    background: rgba(255, 128, 0, 0.1);
    box-shadow: 0 0 30px rgba(255, 128, 0, 0.4);
}

.menu-btn.epic {
    border-color: var(--epic);
}

.menu-btn.epic:hover {
    background: rgba(163, 53, 238, 0.1);
    box-shadow: 0 0 30px rgba(163, 53, 238, 0.4);
}

.menu-btn.rare {
    border-color: var(--rare);
}

.menu-btn.rare:hover {
    background: rgba(0, 112, 221, 0.1);
    box-shadow: 0 0 30px rgba(0, 112, 221, 0.4);
}

.btn-icon {
    font-size: 2rem;
}

.btn-text {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--text-primary);
    display: block;
}

.btn-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Game Description */
.game-description {
    width: 100%;
}

.desc-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--purple);
    border-radius: 12px;
    padding: 1.5rem;
}

.desc-card h3 {
    font-family: var(--font-title);
    color: var(--cyan);
    margin-bottom: 1rem;
}

.desc-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.highlight {
    color: var(--legendary);
    font-weight: bold;
}

.twist-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.twist-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.twist-list .icon {
    font-size: 1.2rem;
}

/* ============================================
   SOVEREIGN SELECTION
   ============================================ */
.sovereign-selection {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.selection-card {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 16px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.selection-card.white-selection {
    border-color: var(--gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.selection-card.dark-selection {
    border-color: var(--purple);
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.2);
}

.selection-header {
    margin-bottom: 2rem;
}

.selection-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.selection-header h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.selection-header p {
    color: var(--text-secondary);
    font-style: italic;
}

.piece-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.selectable-piece {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selectable-piece:hover,
.selectable-piece.hovered {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.piece-symbol {
    font-size: 3rem;
}

.piece-name {
    font-family: var(--font-title);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.piece-power {
    font-size: 0.7rem;
    color: var(--cyan);
}

.selection-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* AI Selecting Animation */
.ai-selecting {
    padding: 3rem;
}

.oracle-thinking {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.oracle-icon {
    font-size: 4rem;
    animation: oracle-pulse 1.5s ease-in-out infinite;
}

@keyframes oracle-pulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 10px var(--purple));
    }
    50% { 
        transform: scale(1.2) rotate(15deg);
        filter: drop-shadow(0 0 30px var(--purple)) drop-shadow(0 0 50px var(--cyan));
    }
}

.thinking-dots {
    display: flex;
    gap: 0.5rem;
}

.thinking-dots span {
    width: 10px;
    height: 10px;
    background: var(--purple);
    border-radius: 50%;
    animation: dot-bounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   GAME AREA
   ============================================ */
.game-area {
    display: grid;
    grid-template-columns: 1fr auto 220px;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .move-history {
        order: 3;
        width: 100%;
        max-width: 500px;
    }
}

/* Player Info */
.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    min-width: 300px;
}

.player-info.top {
    grid-column: 2;
    grid-row: 1;
}

.player-info.bottom {
    grid-column: 2;
    grid-row: 3;
}

@media (max-width: 1024px) {
    .player-info.top,
    .player-info.bottom {
        grid-column: 1;
        width: 100%;
        max-width: 500px;
    }
    
    .player-info.top { grid-row: 1; }
    .player-info.bottom { grid-row: 3; }
}

.player-info.active {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.player-avatar {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    border: 2px solid var(--gold-dark);
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.1rem;
}

.player-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-left: auto;
}

.captured {
    font-size: 1.2rem;
    opacity: 0.7;
}

.captured.white {
    color: #f5efdf;
    -webkit-text-stroke: 0.8px #2b2b40;
    text-stroke: 0.8px #2b2b40;
}

.captured.black {
    color: #16161f;
    -webkit-text-stroke: 0.8px #d8c089;
    text-stroke: 0.8px #d8c089;
}

.check-warning {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--red);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    color: var(--red);
    animation: pulse-warning 1s ease-in-out infinite;
}

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

/* Board Container */
.board-container {
    position: relative;
    grid-column: 2;
    grid-row: 2;
}

@media (max-width: 1024px) {
    .board-container {
        grid-column: 1;
        grid-row: 2;
    }
}

/* Chess Board */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border: 4px solid var(--gold-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 215, 0, 0.1);
}

.chess-board.game-over {
    pointer-events: none;
}

.board-square {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.board-square.light {
    background: var(--board-light);
}

.board-square.dark {
    background: var(--board-dark);
}

.board-square.selected {
    background: var(--board-selected) !important;
}

.board-square.valid-move {
    background: var(--board-valid-move) !important;
}

.board-square.last-move {
    background: var(--board-last-move) !important;
}

.board-square.in-check {
    background: var(--board-check) !important;
    animation: check-pulse 0.8s ease-in-out infinite;
}

.board-square.revealed-sovereign {
    background: var(--board-selected) !important;
    position: relative;
    z-index: 3;
    animation: revealed-pulse 1.2s ease-in-out infinite;
}

@keyframes revealed-pulse {
    0%, 100% { box-shadow: inset 0 0 0 3px var(--gold), 0 0 14px rgba(255, 215, 0, 0.45); }
    50% { box-shadow: inset 0 0 0 3px var(--gold), 0 0 26px rgba(255, 215, 0, 0.9); }
}

@keyframes check-pulse {
    0%, 100% { box-shadow: inset 0 0 20px rgba(231, 76, 60, 0.5); }
    50% { box-shadow: inset 0 0 40px rgba(231, 76, 60, 0.8); }
}

.board-square:hover {
    filter: brightness(1.1);
}

/* Chess Pieces */
.chess-piece {
    position: relative;
    font-size: clamp(2.5rem, 6vw, 4rem);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    user-select: none;
}

.chess-piece:hover {
    transform: scale(1.1);
}

.chess-piece[draggable="true"] {
    cursor: grab;
}

.chess-piece[draggable="true"]:active {
    cursor: grabbing;
}

.chess-piece.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.board-square.drop-target {
    background: rgba(0, 255, 255, 0.4) !important;
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.6);
}

.chess-piece .piece-icon {
    display: inline-block;
    line-height: 1;
}

.chess-piece.white .piece-icon {
    color: #f5efdf;
    -webkit-text-stroke: 1.5px #2b2b40;
    text-stroke: 1.5px #2b2b40;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.chess-piece.black .piece-icon {
    color: #16161f;
    -webkit-text-stroke: 1.5px #d8c089;
    text-stroke: 1.5px #d8c089;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.85);
}

.chess-piece.sovereign {
    position: relative;
}

.chess-piece.sovereign::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: sovereign-glow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes sovereign-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

.sovereign-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 0.8rem;
    animation: indicator-pulse 1s ease-in-out infinite;
}

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

.sovereign-indicator.revealed {
    top: -16px;
    right: -6px;
    font-size: 1.4rem;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.95));
    z-index: 4;
}

.chess-piece.just-moved {
    animation: piece-move 0.3s ease-out;
}

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

/* Move Indicator */
.move-indicator {
    position: absolute;
    width: 30%;
    height: 30%;
    background: var(--cyan);
    border-radius: 50%;
    opacity: 0.6;
    z-index: 1;
}

.move-indicator.capture {
    width: 90%;
    height: 90%;
    background: transparent;
    border: 4px solid var(--red);
    opacity: 0.7;
}

/* Right column wrapper: result panel (on game over) stacked above the chronicle.
   Spanning all rows keeps the panel's height from inflating row 1, so the board
   stays put with no gap above it. */
.side-column {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

/* Game Over Side Panel */
.game-over-panel {
    text-align: center;
    padding: 1.25rem 1rem;
    background: rgba(14, 11, 26, 0.96);
    border: 1px solid var(--gold);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.15);
    animation: panel-appear 0.4s ease-out;
}

@keyframes panel-appear {
    0% { transform: translateY(-12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.victory-icon {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: victory-bounce 0.6s ease-out;
}

@keyframes victory-bounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.game-over-panel h2 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.3rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.game-over-panel p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.game-over-buttons .menu-btn {
    padding: 0.7rem 1rem;
    width: 100%;
}

@media (max-width: 1024px) {
    .side-column {
        grid-column: 1;
        grid-row: auto;
        order: 3;
        width: 100%;
        max-width: 500px;
    }
}

/* Move History */
.move-history {
    background: var(--bg-tertiary);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.move-history h3 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 0.5rem;
}

.moves-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.move-pair {
    display: grid;
    grid-template-columns: 30px 1fr 1fr;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.move-pair:hover {
    background: var(--bg-secondary);
}

.move-number {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.move {
    font-family: monospace;
    font-size: 0.9rem;
}

.move.white {
    color: var(--text-primary);
}

.move.black {
    color: var(--purple);
}

/* ============================================
   RULES SECTION
   ============================================ */
.rules-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.rules-card {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 3px solid var(--gold-dark);
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

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

.close-rules:hover {
    color: var(--gold);
}

.rules-card h2 {
    font-family: var(--font-title);
    color: var(--gold);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.rules-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gold-dark);
}

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

.rules-section h3 {
    font-family: var(--font-title);
    color: var(--cyan);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.rules-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.rules-section ul {
    list-style: none;
    padding: 0;
}

.rules-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.rules-section li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold);
}

/* Piece Guide */
.piece-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.piece-info {
    background: var(--bg-secondary);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.piece-info span:first-child {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.piece-info strong {
    color: var(--gold);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.piece-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .menu-card {
        padding: 1.5rem;
    }
    
    .menu-btn {
        padding: 1rem;
    }
    
    .player-info {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        min-width: auto;
    }
    
    .captured-pieces {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .piece-selection-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .back-button {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .piece-selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .selectable-piece {
        padding: 0.8rem;
    }
    
    .piece-symbol {
        font-size: 2.5rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.rules-card::-webkit-scrollbar,
.move-history::-webkit-scrollbar {
    width: 6px;
}

.rules-card::-webkit-scrollbar-track,
.move-history::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.rules-card::-webkit-scrollbar-thumb,
.move-history::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

.rules-card::-webkit-scrollbar-thumb:hover,
.move-history::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ============================================
   THINKING INDICATOR
   ============================================ */
.thinking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.thinking-text {
    color: var(--cyan);
    animation: thinking-pulse 1.5s ease-in-out infinite;
}

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

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    animation: thinking-dot 1.4s ease-in-out infinite both;
}

.thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes thinking-dot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
