/* Modernist Minimalist Design - Stark Contrast */
:root {
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    /* ==========================================================================
       Game-Theming Variables

       Games can override these in their styles.css to customize appearance.
       This eliminates CSS specificity battles - just set variables once.
       ========================================================================== */

    /* Page backgrounds */
    --game-page-bg: var(--white);
    --game-page-text: var(--black);

    /* Section cards */
    --game-card-bg: var(--white);
    --game-card-border: 2px solid var(--black);
    --game-card-nested-bg: var(--gray-50);
    --game-card-nested-border: 1px solid var(--gray-300);

    /* Stat blocks */
    --game-stat-bg: var(--white);
    --game-stat-border: 2px solid var(--black);
    --game-stat-label-color: var(--gray-600);
    --game-stat-value-color: var(--black);

    /* Buttons */
    --game-button-bg: var(--black);
    --game-button-color: var(--white);
    --game-button-border: 2px solid var(--black);
    --game-button-hover-bg: var(--white);
    --game-button-hover-color: var(--black);

    /* Text content */
    --game-text-bg: var(--gray-50);
    --game-text-border: 1px solid var(--gray-300);
    --game-text-color: inherit;

    /* Section titles */
    --game-title-color: var(--gray-700);
    --game-title-border: 2px solid var(--black);

    /* Section rows (rows with titles) */
    --game-row-bg: var(--gray-50);
    --game-row-border: 1px solid var(--gray-300);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Arial', sans-serif;
    background: var(--game-page-bg);
    background-attachment: fixed;
    color: var(--game-page-text);
    min-height: 100vh;
    padding: 10px;
    line-height: 1.3;
    font-size: 13px;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.play-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
}

@media (min-width: 1080px) {
    .play-layout {
        grid-template-columns: 1fr 320px;
        grid-template-rows: auto 1fr;
        align-items: start;
    }

    .play-layout header {
        grid-column: 1 / -1;
    }

    .play-layout .game-container {
        grid-column: 1;
        grid-row: 2 / 4;
    }

    .play-layout .events-container {
        grid-column: 2;
        grid-row: 2;
        position: sticky;
        top: 24px;
        max-height: calc(50vh - 60px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .play-layout .reviews-container {
        grid-column: 2;
        grid-row: 3;
        max-height: calc(50vh - 60px);
        overflow-y: auto;
    }
}

/* Header - Minimal */
header {
    position: relative;
    background: var(--game-page-bg);
    border: 2px solid var(--game-page-text);
    padding: 10px 12px;
    margin-bottom: 10px;
}

header h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--game-page-text);
}

header p {
    color: var(--game-page-text);
    opacity: 0.6;
    font-size: 12px;
    margin-top: 2px;
}

.header-buttons {
    position: absolute;
    top: 10px;
    right: 12px;
    display: flex;
    gap: 6px;
}

.back-button,
.reset-button,
.evolve-button {
    padding: 6px 12px;
    border: 2px solid var(--game-page-text);
    background: var(--game-page-bg);
    color: var(--game-page-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.1s ease;
}

.back-button:hover,
.reset-button:hover,
.evolve-button:hover {
    background: var(--game-page-text);
    color: var(--game-page-bg);
}

/* Milestone Selector */
.milestone-selector {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.milestone-selector label {
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
}

.milestone-selector select {
    padding: 6px 10px;
    border: 2px solid var(--black);
    background: var(--white);
    color: var(--black);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    min-width: 280px;
}

.milestone-selector select:focus {
    outline: none;
    background: var(--gray-50);
}

/* Game Selection - Row Layout */
.game-list-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Column header row */
.game-list-header {
    display: grid;
    grid-template-columns: 1fr 55px 55px 55px 70px 70px 180px;
    gap: 0 12px;
    padding: 6px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 2px solid var(--black);
}

.game-list-header span {
    text-align: center;
}

.game-list-header span:first-child {
    text-align: left;
}

.game-list-header span:last-child {
    text-align: right;
}

/* Each game row uses the same grid */
.game-row {
    background: var(--white);
    border: 2px solid var(--black);
    border-bottom: none;
    padding: 10px 16px;
    transition: background 0.1s ease;
}

.game-row:last-child {
    border-bottom: 2px solid var(--black);
}

.game-row:hover {
    background: var(--gray-50);
}

.game-row-grid {
    display: grid;
    grid-template-columns: 1fr 55px 55px 55px 70px 70px 180px;
    gap: 0 12px;
    align-items: center;
}

/* Left column: game info */
.game-row-info {
    min-width: 0;
}

.game-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-row-header h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin: 0;
    white-space: nowrap;
}

.game-row-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.game-row-rating .star {
    font-size: 12px;
    line-height: 1;
}

.game-row-rating .star.filled {
    color: #f59e0b;
}

.game-row-rating .star.half {
    color: #f59e0b;
    opacity: 0.6;
}

.game-row-rating .star.empty {
    color: var(--gray-300);
}

.game-row-rating .no-rating {
    font-size: 10px;
    color: var(--gray-400);
}

.game-row-rating .review-count {
    font-size: 10px;
    color: var(--gray-500);
    margin-left: 3px;
}

.game-row-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-description {
    font-size: 11px;
    color: var(--gray-600);
}

.latest-review {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
}

/* Stat cells - centered in their grid column */
.game-row-stat {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--black);
    line-height: 1;
}

.game-row-stat.date {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
}

/* Action buttons column */
.game-row-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.game-row-actions button {
    padding: 5px 12px;
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--black);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
}

.game-row-actions button:hover {
    background: var(--white);
    color: var(--black);
}

.game-row-actions .restart-button {
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
}

.game-row-actions .restart-button:hover {
    background: var(--black);
    color: var(--white);
}

.game-row-actions .evolve-button {
    background: #FF9800;
    border-color: #FF9800;
    color: var(--white);
}

.game-row-actions .evolve-button:hover {
    background: #e68a00;
    border-color: #e68a00;
}

/* Responsive: stack on small screens */
@media (max-width: 900px) {
    .game-list-header {
        display: none;
    }

    .game-row-grid {
        grid-template-columns: 1fr;
        gap: 6px 0;
    }

    .game-row-stat {
        display: none;
    }

    .game-row-actions {
        justify-content: flex-start;
    }

    .game-row-actions button {
        flex: 1;
    }
}

/* Game Container Layout */
.game-container {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   Scene Layout - Generic structural styles for scene-based game UIs

   Games can define their own styles.css to customize appearance.
   These are minimal structural defaults that work without game-specific CSS.
   ========================================================================== */

/* Scene container - CSS Grid for natural stacking.
   overflow MUST be visible so content can grow beyond the aspect ratio.
   Games must NOT set overflow:hidden on .layout-scene — it clips buttons/content. */
.layout-scene {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: visible !important;
    border-radius: 16px;
    width: 100%;
    max-width: 100vw;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    min-height: 500px;
}

/* Scene rows */
.scene-row {
    display: flex;
    width: 100%;
}

.scene-row-top {
    flex-direction: column;
}

.scene-row-middle {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
}

.scene-row-bottom {
    flex-direction: column;
}

/* Scene columns - share space equally, only populated columns are in the DOM */
.scene-col {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
}

.scene-col-left {
    align-items: flex-start;
}

.scene-col-center {
    align-items: center;
    justify-content: flex-start;
}

.scene-col-right {
    align-items: flex-end;
}

/* Scene region - base styles, no absolute positioning */
.scene-region {
    box-sizing: border-box;
}

/* Overlay - positioned over scene center */
.scene-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
}

/* Reset inherited styles inside scene regions */
.scene-region .section-card {
    background: transparent;
    border: none;
    padding: 0;
}

.scene-region .layout-vertical {
    gap: 6px;
}

.scene-region .layout-horizontal {
    gap: 6px;
}

/* Horizontal children in scenes - use flex instead of grid */
.scene-region .horizontal-children {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-template-columns: none;
}

/* Default scene text styling (white for visibility over images) */
.scene-region .text-content {
    background: transparent;
    border: none;
    color: white;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.4;
}

/* Default scene stat block styling */
.scene-region .stat-block {
    background: transparent;
    border: none;
    padding: 4px 8px;
    min-width: auto;
}

.scene-region .stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.scene-region .stat-value {
    color: white;
    font-size: 13px;
    font-weight: 600;
}

/* Default scene button styling */
.scene-region .action-button {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
}

.scene-region .action-button:hover {
    background: white;
}

.scene-region .action-button:disabled {
    background: rgba(128, 128, 128, 0.5);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

/* Mobile responsive - scene basics */
@media (max-width: 768px) {
    .layout-scene {
        min-height: 350px;
    }

    .scene-region .action-button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

.layout-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout-horizontal {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.horizontal-children {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
}

.section-card {
    background: var(--game-card-bg);
    border: var(--game-card-border);
    padding: 8px 10px;
}

.section-card .section-card {
    background: var(--game-card-nested-bg);
    border: var(--game-card-nested-border);
    padding: 6px 8px;
    margin-top: 4px;
}

.page-root {
    background: var(--game-page-bg);
    border: none;
    padding: 0;
}

.page-root.section-card {
    background: var(--game-page-bg);
    border: none;
    padding: 0;
}

.section-row {
    background: transparent;
    border: none;
    padding: 0;
}

.section-row:has(.section-title) {
    background: var(--game-row-bg);
    border: var(--game-row-border);
    padding: 8px;
}

.section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--game-title-color);
    margin-bottom: 4px;
    border-bottom: var(--game-title-border);
    padding-bottom: 3px;
}

/* Collapsible sections */
.collapsible .section-title {
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.collapsible .section-title:hover {
    color: var(--black);
}

.collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.collapsible .collapsible-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collapsible.collapsed .collapsible-content {
    display: none;
}

.collapsible.collapsed {
    padding-bottom: 4px;
}

.collapsible.collapsed .section-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Stat Block */
.stat-block {
    background: var(--game-stat-bg);
    border: var(--game-stat-border);
    padding: 6px 8px;
    min-width: 80px;
    flex: 1;
}

.stat-label {
    font-size: 9px;
    color: var(--game-stat-label-color);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
    font-weight: 600;
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--game-stat-value-color);
    letter-spacing: -0.3px;
}

/* Buttons - Clean */
.action-button {
    padding: 6px 10px;
    background: var(--game-button-bg);
    color: var(--game-button-color);
    border: var(--game-button-border);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
}

.action-button:hover {
    background: var(--game-button-hover-bg);
    color: var(--game-button-hover-color);
}

.action-button:active {
    transform: translate(1px, 1px);
}

.horizontal-children .action-button {
    width: 100%;
    justify-content: center;
}

/* Text Content */
.text-content {
    padding: 6px 8px;
    background: var(--game-text-bg);
    border: var(--game-text-border);
    color: var(--game-text-color);
    margin: 3px 0;
    font-size: 12px;
    line-height: 1.4;
}

/* Monospace text for visualizations (maps, trails, ASCII art) */
.text-monospace {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.2;
    white-space: pre;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
    .text-monospace {
        font-size: 9px;
        line-height: 1.1;
    }
}

/* SVG Container */
.svg-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.svg-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.svg-wrapper svg {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

@media (max-width: 600px) {
    .svg-wrapper {
        max-width: 100% !important;
    }
}

/* Grid Layout (Maps, Boards, Inventories) */
.layout-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grid-container {
    --grid-cols: 9;  /* Set by JS */
    --cell-size: minmax(28px, 1fr);  /* Responsive cell sizing */

    display: grid;
    grid-template-columns: repeat(var(--grid-cols), var(--cell-size));
    background: var(--gray-100);
    border: 2px solid var(--black);
    padding: 4px;
    width: 100%;
    max-width: min(100%, calc(var(--grid-cols) * 64px + 8px));  /* Cap at 64px per cell */
    margin: 0 auto;
    gap: 2px;
}

.grid-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;  /* Keep cells square */
    font-size: clamp(14px, 4vw, 20px);  /* Responsive font size */
    background: var(--white);
    border: 1px solid var(--gray-300);
    user-select: none;
    min-width: 0;  /* Allow shrinking below content size */
}

/* Cell States */
.grid-cell--hidden {
    background: var(--gray-800);
    color: var(--gray-800);
    cursor: default;
}

.grid-cell--adjacent {
    background: var(--gray-400);
    color: var(--white);
}

.grid-cell--adjacent.grid-cell--clickable {
    cursor: pointer;
    transition: all 0.1s ease;
}

.grid-cell--adjacent.grid-cell--clickable:hover {
    background: var(--gray-600);
    transform: scale(1.08);
    border-color: var(--black);
    z-index: 1;
}

.grid-cell--explored {
    background: var(--gray-100);
    color: var(--black);
    cursor: default;
}

.grid-cell--current {
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
    font-weight: bold;
}

.grid-cell--clickable {
    cursor: pointer;
}

.grid-cell--clickable:active {
    transform: scale(0.95);
}

/* Grid cells with SVG content */
.grid-cell--svg {
    padding: 0;
    background: transparent !important;
    overflow: hidden;
}

.grid-cell--svg svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* SVG layer inside grid cells */
.grid-cell-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.grid-cell-svg-layer svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* SVG cells override state backgrounds */
.grid-cell--svg {
    position: relative;
}

.grid-cell--svg.grid-cell--hidden,
.grid-cell--svg.grid-cell--adjacent,
.grid-cell--svg.grid-cell--explored,
.grid-cell--svg.grid-cell--current {
    background: transparent !important;
}

/* Grid cells with background images */
.grid-cell--has-bg {
    border: none !important;
    position: relative;
}

.grid-cell--has-bg.grid-cell--hidden,
.grid-cell--has-bg.grid-cell--adjacent,
.grid-cell--has-bg.grid-cell--explored {
    background-color: transparent !important;
}

.grid-cell--has-bg.grid-cell--current {
    outline: 3px solid var(--white);
    outline-offset: -3px;
    z-index: 1;
    background-color: transparent !important;
}

/* Overlay image on grid cells */
.grid-cell-overlay {
    position: absolute;
    top: 6%;
    left: 6%;
    width: 88%;
    height: 88%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
    image-rendering: auto;
}

/* Icon overlay text when cell has background image */
.grid-cell-icon-overlay {
    position: absolute;
    z-index: 2;
    font-size: clamp(14px, 3vw, 22px);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.grid-cell--has-overlay {
    position: relative;
}

.grid-cell--has-overlay.grid-cell--clickable:hover .grid-cell-overlay {
    filter: brightness(1.15);
    transition: filter 0.15s ease;
}

/* Badge overlay on grid cells */
.grid-cell-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    pointer-events: none;
    min-width: 16px;
    text-align: center;
}

/* When grid uses tile images, remove default grid chrome */
.grid-container--tiled {
    background: transparent;
    border: none;
    padding: 0;
    gap: 0 !important;
}

.grid-container--tiled .grid-cell {
    border: none;
}

/* SVG Container (Illustrations) */
.svg-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.svg-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    min-height: 100px;
}

.svg-content svg {
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 100px;
    display: block;
}

/* Nested SVG containers should be slightly smaller */
.section-card .svg-container {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
}

/* ==========================================================================
   Image Element
   ========================================================================== */

.image-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.game-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.clickable-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1.05);
}

.image-placeholder {
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    min-height: 100px;
}

/* Scene layout image styling */
.layout-scene .game-image {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.layout-scene .clickable-image:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Image Hotspot Overlays
   ========================================================================== */

.image-hotspot-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}

.image-hotspot-wrapper .game-image {
    width: 100%;
    display: block;
    height: auto;
}

.image-hotspot {
    position: absolute;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.image-hotspot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.image-hotspot-label {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    margin-bottom: 4px;
    z-index: 100;
}

.image-hotspot:hover .image-hotspot-label {
    display: block;
}

/* Events */
.events-container {
    background: var(--game-card-bg);
    color: var(--game-page-text);
    border: 2px solid var(--game-page-text);
    padding: 10px;
    overflow: hidden;
}

.events-container h3 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--game-page-text);
    margin-bottom: 8px;
    border-bottom: 2px solid var(--game-page-text);
    padding-bottom: 4px;
}

#events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    padding-right: 4px;
}

.event {
    padding: 6px 8px;
    border-left: 3px solid var(--game-page-text);
    background: var(--game-card-nested-bg);
    font-size: 12px;
    line-height: 1.3;
}

.event-info {
    border-left-color: var(--gray-500);
}

.event-success {
    border-left-color: var(--game-page-text);
}

.event-warning {
    border-left-color: var(--gray-700);
}

.event-error {
    border-left-color: var(--game-page-text);
    background: var(--game-card-bg);
}

.event-action {
    border-left-color: var(--game-page-text);
}

.event-narrator {
    border-left-color: var(--gray-400);
    font-style: italic;
    opacity: 0.85;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10100;  /* Above tutorial overlay (9999) */
}

.modal {
    background: var(--game-card-bg);
    color: var(--game-page-text);
    border: 2px solid var(--game-page-text);
    padding: 16px;
    max-width: 400px;
    width: 90%;
}

.modal h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 13px;
    line-height: 1.4;
    color: var(--gray-700);
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--black);
    font-size: 12px;
    background: var(--white);
    color: var(--black);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: var(--gray-50);
}

.button-group {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.confirm-button,
.cancel-button {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--black);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
}

.confirm-button {
    background: var(--black);
    color: var(--white);
}

.confirm-button:hover {
    background: var(--white);
    color: var(--black);
}

.cancel-button {
    background: var(--white);
    color: var(--black);
}

.cancel-button:hover {
    background: var(--black);
    color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--black);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-700);
}

/* Resume Banner */
.resume-banner {
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--black);
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.resume-banner p {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.resume-btn,
.dismiss-btn {
    padding: 8px 16px;
    border: 2px solid var(--white);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s;
    margin: 0 6px;
}

.resume-btn {
    background: var(--white);
    color: var(--black);
}

.resume-btn:hover {
    background: var(--black);
    color: var(--white);
}

.dismiss-btn {
    background: var(--black);
    color: var(--white);
}

.dismiss-btn:hover {
    background: var(--white);
    color: var(--black);
}

/* Utility */
.loading,
.error,
.no-games {
    text-align: center;
    padding: 30px;
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
}

.error {
    color: var(--black);
}

/* Compact nested sections */
.section-card .section-card .horizontal-children {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 4px;
}

.section-card .section-card .stat-block {
    padding: 5px 6px;
    min-width: 70px;
}

.section-card .section-card .stat-label {
    font-size: 8px;
    margin-bottom: 1px;
}

.section-card .section-card .stat-value {
    font-size: 13px;
}

.section-card .section-card .section-title {
    font-size: 9px;
    margin-bottom: 3px;
    letter-spacing: 0.6px;
}

/* Reviews Section */
.reviews-container {
    background: var(--game-card-bg);
    color: var(--game-page-text);
    border: 2px solid var(--game-page-text);
    padding: 10px;
    margin-top: 10px;
}

.reviews-container h3 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--game-page-text);
    margin-bottom: 8px;
    border-bottom: 2px solid var(--game-page-text);
    padding-bottom: 4px;
}

.reviews-summary-content {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.reviews-stars {
    color: var(--game-page-text);
    font-size: 14px;
    letter-spacing: 1px;
}

.reviews-avg {
    font-weight: 700;
    font-size: 14px;
}

.reviews-count {
    color: var(--gray-500);
    font-size: 12px;
}

#reviews-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 1079px) {
    #reviews-list {
        max-height: 300px;
    }
}

.review-item {
    padding: 8px;
    background: var(--game-card-nested-bg);
    border-left: 3px solid var(--game-page-text);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.review-agent {
    font-weight: 600;
    font-size: 12px;
    color: var(--game-page-text);
}

.review-rating {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--game-page-text);
}

.review-meta {
    font-size: 10px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.review-feedback {
    font-size: 12px;
    line-height: 1.4;
    color: var(--game-text-color, var(--gray-700));
}

.review-more-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    text-decoration: underline;
}

.review-more-btn:hover {
    color: var(--black);
}
