/* Style system for Cat-gammon */

:root {
    --bg-dark: #121319;
    --panel-bg: rgba(30, 31, 41, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #e67e22;
    --primary-glow: rgba(230, 126, 34, 0.4);
    --secondary-color: #2c3e50;
    --text-main: #f5f6fa;
    --text-muted: #a4b0be;
    
    /* Board colors */
    --board-felt: #eedcc6;
    --board-wood: #4d2b12;
    --board-wood-light: #6a3e1a;
    --point-red: #c0392b;
    --point-black: #2c3e50;
    --point-red-dark: #8c251b;
    --point-black-dark: #1a252f;
    
    /* Checkers */
    --checker-blonde: #fceab2;
    --checker-blonde-dark: #ffd778;
    --checker-grey: #b0c4de;
    --checker-grey-dark: #8a9ba8;
    
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(230, 126, 34, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(46, 204, 113, 0.05) 0px, transparent 50%);
}

.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* HEADER */
.app-header {
    text-align: center;
    margin-bottom: 5px;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 40%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.logo-cat {
    color: #e67e22;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* GAME LAYOUT */
.game-layout {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

/* PANELS */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* PYTHAGORAS PANEL */
.pythagoras-panel {
    align-items: center;
    text-align: center;
}

.cat-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.cat-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(230, 126, 34, 0.3);
    padding: 5px;
}

.avatar-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.2);
    animation: avatar-pulse 3s infinite ease-in-out;
}

#pythagoras-avatar {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Pythagoras blinking animation */
@keyframes avatar-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(230, 126, 34, 0.15); }
    50% { box-shadow: 0 0 30px rgba(230, 126, 34, 0.4); }
}

.cat-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-top: 5px;
}

.cat-title {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* SPEECH BUBBLE */
.speech-bubble-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.speech-bubble {
    position: relative;
    background: rgba(230, 126, 34, 0.08);
    border: 1px solid rgba(230, 126, 34, 0.25);
    border-radius: 12px;
    padding: 15px;
    color: #ffe4c4;
    font-size: 1.425rem;
    text-align: left;
    height: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

#speech-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    overflow-y: auto;
    flex-grow: 1;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent rgba(230, 126, 34, 0.25);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 9px 9px;
    border-style: solid;
    border-color: transparent transparent rgba(18, 19, 25, 1);
}

/* SCOREBOARD */
.scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 15px 0 5px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.score-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.score-blonde .score-label {
    color: var(--checker-blonde-dark);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.score-grey .score-label {
    color: var(--checker-grey);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    line-height: 1.2;
}

.score-vs {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    padding: 0 10px;
    opacity: 0.5;
}

/* BOARD PANEL */
.board-panel {
    padding: 12px;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.board-frame {
    display: grid;
    grid-template-columns: 55px 1fr 55px;
    background: var(--board-wood);
    border: 8px solid var(--board-wood-light);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0,0,0,0.7);
    width: 100%;
    min-width: 700px;
    height: 520px;
    overflow: hidden;
}

/* BEAR OFF AREA */
.bear-off-area {
    background: rgba(0, 0, 0, 0.35);
    border-right: 2px solid rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 2px;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.bear-off-area.valid-target {
    background: rgba(46, 204, 113, 0.15) !important;
    box-shadow: inset 0 0 25px rgba(46, 204, 113, 0.6) !important;
    cursor: pointer;
    animation: green-glow-pulse 1.5s infinite ease-in-out;
}

.bear-off-area.valid-target::before {
    content: 'CLICK TO BEAR OFF';
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-size: 0.65rem;
    font-weight: 800;
    color: #2ecc71;
    letter-spacing: 1.5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0.95;
}

@keyframes green-glow-pulse {
    0%, 100% { box-shadow: inset 0 0 15px rgba(46, 204, 113, 0.4); }
    50% { box-shadow: inset 0 0 35px rgba(46, 204, 113, 0.8); }
}

.borne-blonde-container {
    border-right: 2px solid rgba(0, 0, 0, 0.5);
    border-left: none;
}

.borne-grey-container {
    border-left: 2px solid rgba(0, 0, 0, 0.5);
    border-right: none;
}

.bear-off-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    opacity: 0.95;
    margin-bottom: 8px;
    transform: rotate(180deg);
}

.borne-list {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    overflow-y: auto;
}

/* FELT BACKGROUND */
.board-felt {
    background-color: var(--board-felt);
    display: grid;
    grid-template-rows: 1fr 50px 1fr;
    height: 100%;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.25);
}

.points-row {
    display: grid;
    grid-template-columns: 1fr 40px 1fr; /* Left quadrant, Bar, Right quadrant */
    height: 100%;
}

.quadrant {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    height: 100%;
}

/* POINT COLUMN */
.point-col {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.2s ease;
}

.top-row .point-col {
    flex-direction: column;
    justify-content: flex-start;
}

.bottom-row .point-col {
    flex-direction: column-reverse;
    justify-content: flex-start;
}

/* Point triangle styling */
.point-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.point-red .triangle-path {
    fill: var(--point-red);
}
.point-red .cat-tip-path {
    fill: var(--point-red-dark);
}

.point-black .triangle-path {
    fill: var(--point-black);
}
.point-black .cat-tip-path {
    fill: var(--point-black-dark);
}

/* Highlights for points */
.point-col.selected::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(241, 196, 15, 0.25);
    box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.6);
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    animation: gold-pulse 1.5s infinite ease-in-out;
}

.point-col.valid-target::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(46, 204, 113, 0.15);
    box-shadow: inset 0 0 10px rgba(46, 204, 113, 0.5);
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

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

/* BAR CENTER COLUMN */
.board-bar-center {
    background: #3e220e;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 2px 0 5px rgba(0,0,0,0.4), -2px 0 5px rgba(0,0,0,0.4);
    height: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.bar-checkers-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    padding: 8px 0;
}

.top-row .bar-checkers-container {
    justify-content: flex-start;
}

.bottom-row .bar-checkers-container {
    justify-content: flex-end;
}

/* BOARD DIVIDER (MIDDLE BAR & DICE ARENA) */
.board-divider {
    background: #3e220e;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    height: 50px;
    z-index: 15;
}

.divider-wood-line {
    background: #4a2810;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
}

.dice-arena {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    position: absolute;
    left: 60px;
    right: 60px;
    height: 50px;
    pointer-events: none;
    z-index: 20;
}

.dice-container {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* CHECKERS STYLING */
.checker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    z-index: 3;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.checker svg {
    width: 100%;
    height: 100%;
    display: block;
}

.checker:hover {
    transform: scale(1.15) translateY(-2px);
    z-index: 100;
}

.top-row .checker:hover {
    transform: scale(1.15) translateY(2px);
}

/* Checker SVG Colors */
.user-checker {
    fill: #1a1a1a;
    stroke: #ffd778;
    stroke-width: 1.5;
}
.user-checker-inner {
    fill: #2a2a2a;
}
.blonde-fur {
    fill: var(--checker-blonde);
}

.ai-checker {
    fill: #b22222;
    stroke: #e2e8f0;
    stroke-width: 1.5;
}
.ai-checker-inner {
    fill: #8b0000;
}
.grey-fur {
    fill: var(--checker-grey);
}

/* Borne off checkers list */
.borne-list .checker {
    width: 38px;
    height: 14px; /* Thin stacks when borne off */
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-bottom: -4px;
}

.borne-list .checker svg {
    display: none; /* Hide cat face when stacked flat in bear off */
}

.borne-blonde-container .checker {
    background: radial-gradient(circle, var(--checker-blonde) 20%, var(--checker-blonde-dark) 100%);
    border-color: #ffd778;
}

.borne-grey-container .checker {
    background: radial-gradient(circle, var(--checker-grey) 20%, var(--checker-grey-dark) 100%);
    border-color: #e2e8f0;
}

/* CONTROL PANEL */
.control-panel {
    gap: 15px;
}

.game-status-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.game-status-card h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: var(--secondary-color);
    color: #fff;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.status-badge.human-turn {
    background: #27ae60;
}

.status-badge.ai-turn {
    background: var(--primary-color);
}

.status-badge.finished {
    background: #9b59b6;
    animation: text-glow 2s infinite alternate;
}

.turn-info-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* BUTTONS */
.actions-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reset-container {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
    box-shadow: 0 6px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.6);
}

.btn-ai {
    background: linear-gradient(135deg, #7f8c8d 0%, #2c3e50 100%);
    color: #fff;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hidden {
    display: none !important;
}

/* REMAINING MOVES CARD */
.remaining-dice-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
}

.remaining-dice-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.moves-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.move-pill {
    background: rgba(230, 126, 34, 0.15);
    border: 1px solid rgba(230, 126, 34, 0.4);
    color: #ffd778;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.no-moves {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* LOG CARD */
.log-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 180px;
}

.log-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.log-list {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 5px;
}

.log-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 4px;
}

.log-item:last-child {
    border: none;
    color: #fff;
    font-weight: 500;
}

/* DICE DESIGNS */
.die-face {
    background: radial-gradient(circle, #ffffff 60%, #e6e6e6 100%);
    border: 2px solid #ccc;
    border-radius: 14px;
    width: 86px;
    height: 86px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 2px 4px #fff, inset 0 -4px 8px rgba(0,0,0,0.15);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 7px;
    gap: 4px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

.die-pip {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
}

.die-pip svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

/* DICE ROLL ANIMATION */
.dice-rolling-active {
    animation: dice-shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes dice-shake {
    0% { transform: translate(0, 0) rotate(0deg) scale(0.9); }
    15% { transform: translate(-8px, -15px) rotate(-25deg) scale(1.15); }
    30% { transform: translate(6px, 12px) rotate(45deg) scale(1.1); }
    45% { transform: translate(-10px, -6px) rotate(-70deg) scale(1.15); }
    60% { transform: translate(8px, 15px) rotate(90deg) scale(1.05); }
    75% { transform: translate(-5px, -10px) rotate(140deg) scale(1.1); }
    90% { transform: translate(3px, 6px) rotate(180deg) scale(0.98); }
    100% { transform: translate(0, 0) rotate(360deg) scale(1.0); }
}

/* Micro animations for pupils */
.pupil {
    transition: cx 0.2s ease, cy 0.2s ease;
}

/* Text glow */
@keyframes text-glow {
    from { text-shadow: 0 0 5px rgba(255,255,255,0.2), 0 0 10px var(--primary-color); }
    to { text-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 20px var(--primary-color); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .pythagoras-panel {
        align-items: center;
        text-align: center;
    }
    .cat-profile {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
        margin-bottom: 10px;
    }
    .avatar-container {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    .cat-details {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .cat-name {
        margin-top: 0;
        font-size: 1.85rem;
    }
    .cat-title {
        margin-bottom: 0;
        font-size: 1.1rem;
    }
    .speech-bubble-container {
        width: 100%;
        margin-top: 10px;
        flex-grow: 0;
    }
    .speech-bubble {
        margin-top: 0;
        margin-left: 0;
        height: 220px;
        flex-grow: 0;
        font-size: 1.9rem;
    }
    .log-list {
        font-size: 1.0rem;
    }
    .btn {
        font-size: 1.15rem;
        padding: 9px 12px;
    }
    .game-status-card h3 {
        font-size: 1.15rem;
    }
    .status-badge {
        font-size: 1.1rem;
        padding: 4px 14px;
    }
    .turn-info-text {
        font-size: 1.05rem;
    }
    .remaining-dice-card h4, .log-card h4 {
        font-size: 1.05rem;
    }
    .move-pill {
        font-size: 1.05rem;
        width: 23%;
        aspect-ratio: 1;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
    }
    .no-moves {
        font-size: 1.05rem;
    }
    .actions-container {
        display: flex;
        flex-direction: column;
    }
    .actions-container .btn {
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
    }
    .scoreboard {
        padding: 5px 12px;
        margin: 6px 0;
    }
    .score-team {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        justify-content: center;
    }
    .score-value {
        font-size: 1.2rem;
    }
    .control-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .game-status-card, .actions-container, .remaining-dice-card, .log-card, .reset-container {
        flex: 1 1 200px;
    }
    .game-status-card { order: 1; }
    .actions-container { order: 2; }
    .remaining-dice-card { order: 3; }
    .log-card {
        order: 4;
        height: 200px;
        flex-grow: 0;
    }
    .reset-container { order: 5; }
}

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: var(--panel-bg);
    border: 1px solid rgba(230, 126, 34, 0.4);
    border-radius: 20px;
    padding: 30px;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(230, 126, 34, 0.15);
    text-align: center;
    animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modal-body p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-game-preview {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-around;
}

.preview-item {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.preview-label {
    margin-bottom: 5px;
    font-weight: 500;
}

.preview-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-footer button {
    min-width: 140px;
}

/* CATS ILLUSTRATION */
.cats-illustration-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.cats-illustration-img {
    width: 100%;
    max-width: 540px; /* Large version under the game board on desktop */
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(230, 126, 34, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cats-desktop-only {
    display: flex;
}

.cats-mobile-only {
    display: none;
}

@media (max-width: 1100px) {
    .cats-desktop-only {
        display: none;
    }
    .cats-mobile-only {
        display: flex;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    .cats-illustration-img {
        max-width: 120px; /* Unchanged small size on mobile */
    }
}

/* Rules and More Buttons & Modals */
.extra-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.extra-buttons-row .btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.cat-games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-game-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: all 0.2s ease;
}

.cat-game-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(230, 126, 34, 0.4);
    transform: translateY(-2px);
}

.cat-game-favicon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

.cat-game-info {
    display: flex;
    flex-direction: column;
}

.cat-game-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.cat-game-url {
    color: var(--text-muted);
    font-size: 0.8rem;
}




