/* ============================================================
   DUNGEONS & DEPRESSION — STYLESHEET
   Esthétique macOS System 7 (1991) — Color + Lumon / Severance
   ============================================================ */

/* === FONTS & RESET === */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Jacquard+12&display=swap');

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

:root {
    --mac-bg: #ECECEC;
    --mac-white: #ffffff;
    --mac-black: #000000;
    --mac-border: #000000;
    --mac-gray: #ACACAC;
    --mac-dark-gray: #555555;
    --mac-light-gray: #DDDDDD;
    --mac-title-bg: #CCCCCC;
    --mac-highlight: #000000;
    --mac-text: #000000;
    --mac-text-dim: #666666;
    --mac-text-light: #999999;
    --mac-danger: #aa2222;
    --mac-success: #227722;
    --mac-warning: #886600;
    --mac-info: #336688;
    --mac-purple: #663388;
    --font-main: 'Press Start 2P', 'Courier New', monospace;
    --win-shadow: 2px 2px 0px rgba(0, 0, 0, 0.25);
}

/* Streamline Pixel icons — inherit text color, no extra spacing */
iconify-icon {
    color: currentColor;
    display: inline-block;
    vertical-align: middle;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--mac-bg);
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--mac-text);
}

/* === MENU BAR (macOS System 7 — functional dropdowns) === */
#mac-menubar {
    height: 22px;
    background: var(--mac-white);
    border-bottom: 2px solid var(--mac-black);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 9px;
    gap: 0;
    position: relative;
    z-index: 200;
    user-select: none;
}

#mac-menubar .menu-apple {
    font-size: 12px;
    cursor: default;
    padding: 2px 8px;
}

#mac-menubar .menu-dropdown {
    position: relative;
}

#mac-menubar .menu-item {
    cursor: default;
    padding: 2px 10px;
    height: 20px;
    display: flex;
    align-items: center;
}

#mac-menubar .menu-item:hover,
#mac-menubar .menu-dropdown.open .menu-item {
    background: var(--mac-black);
    color: var(--mac-white);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 20px;
    left: 0;
    min-width: 200px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
    z-index: 300;
    padding: 2px 0;
}

.menu-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 3px 16px;
    font-size: 9px;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dropdown-item:hover:not(.disabled) {
    background: var(--mac-black);
    color: var(--mac-white);
}

.dropdown-item.disabled {
    color: var(--mac-gray);
}

.dropdown-item .shortcut {
    margin-left: auto;
    color: var(--mac-text-dim);
    font-size: 8px;
}

.dropdown-item:hover .shortcut {
    color: var(--mac-light-gray);
}

.dropdown-divider {
    height: 1px;
    background: var(--mac-black);
    margin: 2px 8px;
}

/* === MAC WINDOW CHROME === */
.mac-window {
    border: 2px solid var(--mac-black);
    background: var(--mac-white);
    box-shadow: var(--win-shadow);
    position: relative;
}

.mac-title-bar {
    height: 20px;
    background: var(--mac-white);
    border-bottom: 2px solid var(--mac-black);
    display: flex;
    align-items: center;
    padding: 0 4px;
    position: relative;
    user-select: none;
}

/* Title bar horizontal lines pattern */
.mac-title-bar::after {
    content: '';
    position: absolute;
    left: 26px;
    right: 4px;
    top: 4px;
    bottom: 4px;
    background: repeating-linear-gradient(
        0deg,
        var(--mac-black) 0px,
        var(--mac-black) 1px,
        var(--mac-white) 1px,
        var(--mac-white) 3px
    );
}

.mac-title-bar .win-title {
    position: relative;
    z-index: 1;
    background: var(--mac-white);
    padding: 0 6px;
    font-size: 9px;
    margin: 0 auto;
    white-space: nowrap;
}

.mac-close-box {
    width: 12px;
    height: 12px;
    border: 1px solid var(--mac-black);
    background: var(--mac-white);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    cursor: pointer;
}

.mac-close-box:active {
    background: var(--mac-black);
}

.mac-window-body {
    padding: 8px;
}

/* === CRT OVERLAY (disabled — kept for DOM compat) === */
#crt-overlay {
    display: none;
}

/* === GAME CONTAINER === */
#game-container {
    width: 960px;
    max-width: 100vw;
    height: calc(100vh - 22px);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--mac-bg);
}

/* === SCREENS === */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    position: absolute;
    top: 0; left: 0;
    z-index: 100;
    background: rgba(236, 236, 236, 0.92);
}

.screen-title {
    color: var(--mac-text);
    font-size: 14px;
    margin-bottom: 20px;
}

/* === MENU BAR — hidden on title/help/gameover screens === */
body[data-screen="title"] #mac-menubar,
body[data-screen="help"] #mac-menubar,
body[data-screen="creation"] #mac-menubar,
body[data-screen="gameover"] #mac-menubar {
    display: none;
}

body[data-screen="title"] #game-container,
body[data-screen="help"] #game-container,
body[data-screen="creation"] #game-container,
body[data-screen="gameover"] #game-container {
    height: 100vh;
    width: 100%;
    max-width: 100%;
}

/* === SCREEN BACKGROUNDS (colored per screen) === */
#screen-title {
    background: linear-gradient(180deg, var(--mac-bg) 0%, #d8dce8 50%, #c8c0d8 100%);
}

#screen-help {
    background: linear-gradient(180deg, #d4eaf4 0%, #c0d8e8 50%, #aeccdc 100%);
}

#screen-creation {
    background: linear-gradient(180deg, #d8ecd8 0%, #c4e0c0 50%, #b4d4ac 100%);
}

#screen-gameover {
    background: linear-gradient(180deg, var(--mac-bg) 0%, #d8dce8 50%, #c8c0d8 100%);
}

#screen-map {
    background: linear-gradient(180deg, #ede8d8 0%, #e0d8c0 100%);
}

#screen-tasks {
    background: linear-gradient(180deg, #d4dff0 0%, #c4cfec 50%, #b4bfe0 100%);
}

#ascii-logo {
    font-family: 'Jacquard 12', 'Press Start 2P', monospace;
    color: #2a1a4e;
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 6px;
    text-align: center;
    white-space: pre-wrap;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px rgba(102, 51, 136, 0.3);
}

@keyframes text-shine {
    0%   { background-position: -50% 0; }
    35%  { background-position: 150% 0; }
    100% { background-position: 150% 0; }
}

.logo-dungeons {
    background: linear-gradient(
        112deg,
        #ddaa00 38%,
        #fff5aa 48%,
        #ffffff 52%,
        #ddaa00 62%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: text-shine 4.5s ease-in-out infinite;
}

.logo-depression {
    background: linear-gradient(
        112deg,
        #cc2222 38%,
        #ffaaaa 48%,
        #ffffff 52%,
        #cc2222 62%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: text-shine 4.5s ease-in-out infinite;
}

.title-subtitle {
    font-family: 'Jacquard 12', 'Press Start 2P', monospace;
    color: #663388;
    font-size: 20px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.title-tagline {
    color: var(--mac-text-dim);
    font-size: 10px;
    margin-bottom: 24px;
}

.title-menu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
}

.title-menu .retro-btn {
    min-width: 280px;
    font-size: 11px;
    padding: 10px 24px;
}

.title-footer {
    color: var(--mac-text-dim);
    font-size: 9px;
}

.title-footer a {
    color: var(--mac-purple);
    text-decoration: none;
}

.title-footer a:hover {
    text-decoration: underline;
}

.blink {
    animation: blink-anim 1.2s step-end infinite;
}

@keyframes blink-anim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === BUTTONS (macOS System 7 — 3D raised bevel) === */
.retro-btn {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--mac-text);
    background: var(--mac-light-gray);
    border: 2px solid var(--mac-black);
    border-radius: 8px;
    padding: 8px 20px;
    cursor: pointer;
    text-align: left;
    transition: none;
    min-width: 220px;
    box-shadow:
        inset 1px 1px 0px var(--mac-white),
        inset -1px -1px 0px var(--mac-gray),
        2px 2px 0px rgba(0, 0, 0, 0.2);
}

.retro-btn:hover:not(:disabled) {
    background: var(--mac-black);
    color: var(--mac-white);
    box-shadow:
        inset 1px 1px 0px #444,
        inset -1px -1px 0px #000,
        2px 2px 0px rgba(0, 0, 0, 0.2);
}

.retro-btn:active:not(:disabled) {
    background: var(--mac-black);
    color: var(--mac-white);
    box-shadow:
        inset -1px -1px 0px #444,
        inset 1px 1px 0px #000;
    transform: translate(1px, 1px);
}

.retro-btn:disabled {
    color: var(--mac-gray);
    border-color: var(--mac-gray);
    cursor: not-allowed;
    background: var(--mac-light-gray);
    box-shadow: inset 1px 1px 0px var(--mac-white), inset -1px -1px 0px var(--mac-gray);
}

.retro-btn.big {
    font-size: 12px;
    padding: 12px 30px;
    text-align: center;
    min-width: 300px;
    border-width: 3px;
    border-radius: 10px;
    display: block;
    margin: 12px auto 0;
}

.retro-btn.big:hover:not(:disabled) {
    background: var(--mac-black);
    color: var(--mac-white);
}

.retro-btn.combat {
    width: 100%;
    text-align: center;
    font-size: 10px;
    padding: 8px 12px;
    border-radius: 6px;
}

.retro-btn.combat.atk { border-color: var(--mac-danger); color: var(--mac-danger); }
.retro-btn.combat.atk:hover { background: var(--mac-danger); color: var(--mac-white); border-color: var(--mac-danger); }
.retro-btn.combat.flee { border-color: var(--mac-warning); color: var(--mac-warning); }
.retro-btn.combat.flee:hover { background: var(--mac-warning); color: var(--mac-white); border-color: var(--mac-warning); }
.retro-btn.combat.delay { border-color: var(--mac-purple); color: var(--mac-purple); }
.retro-btn.combat.delay:hover { background: var(--mac-purple); color: var(--mac-white); border-color: var(--mac-purple); }
.retro-btn.combat.delegate { border-color: var(--mac-info); color: var(--mac-info); }
.retro-btn.combat.delegate:hover { background: var(--mac-info); color: var(--mac-white); border-color: var(--mac-info); }

.retro-btn.action {
    width: 100%;
    font-size: 10px;
    padding: 6px 10px;
    text-align: center;
    border-radius: 6px;
    min-width: auto;
}

.retro-btn.action.small {
    font-size: 9px;
    padding: 5px 8px;
}

/* === CHARACTER CREATION === */
.creation-form {
    width: 100%;
    max-width: 800px;
}

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

.form-group label {
    display: block;
    color: var(--mac-text);
    font-size: 9px;
    margin-bottom: 6px;
    font-weight: normal;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--mac-text);
    background: var(--mac-white);
    border: 1px solid var(--mac-black);
    padding: 6px 10px;
    width: 100%;
    max-width: 300px;
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus {
    border-width: 2px;
    padding: 5px 9px;
    outline: none;
}

.form-group input[type="range"] {
    width: 200px;
    accent-color: var(--mac-black);
}

.class-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.class-card {
    border: 2px solid var(--mac-border);
    background: var(--mac-white);
    padding: 12px;
    cursor: pointer;
}

.class-card:hover {
    background: var(--mac-light-gray);
}

.class-card.selected {
    background: var(--mac-black);
    color: var(--mac-white);
}

.class-card.selected .class-name,
.class-card.selected .class-desc,
.class-card.selected .class-stats,
.class-card.selected .class-special {
    color: var(--mac-white);
}

.class-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.class-name {
    color: var(--mac-text);
    font-size: 10px;
    margin-bottom: 6px;
}

.class-desc {
    color: var(--mac-text-dim);
    font-size: 7px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.class-stats {
    font-size: 7px;
    color: var(--mac-text);
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.class-special {
    font-size: 7px;
    color: var(--mac-info);
}

/* Game screen override — needs to fill space, not center */
#screen-game.screen {
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
}

/* === MAIN GAME LAYOUT === */
.game-layout {
    display: grid;
    grid-template-columns: 540px 1fr;
    grid-template-rows: 420px;
    gap: 0;
    width: 100%;
}

.dungeon-panel {
    position: relative;
    background: #2a2a28;
    border-right: 2px solid var(--mac-black);
    height: 420px;
    overflow: hidden;
}

#dungeon-canvas {
    display: block;
    width: 540px;
    height: 420px;
    image-rendering: pixelated;
}

#compass {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 30px;
    height: 30px;
    border: 1px solid #999;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
}

#minimap-container {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 2px solid var(--mac-black);
    background: #e8e8e8;
}

#minimap-canvas {
    display: block;
    image-rendering: pixelated;
}

/* === INFO PANEL (Mac window style) === */
.info-panel {
    background: var(--mac-bg);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    font-size: 10px;
    height: 420px;
}

.panel-header {
    color: var(--mac-text);
    font-size: 11px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--mac-black);
    margin-bottom: 3px;
    background: linear-gradient(180deg, var(--mac-light-gray) 0%, var(--mac-gray) 100%);
    display: flex;
    align-items: center;
    gap: 4px;
}

.panel-header.red {
    color: var(--mac-danger);
    background: linear-gradient(180deg, #ffeeee 0%, #ffcccc 100%);
}

.stats-block, .task-block, .action-block {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    padding: 6px;
    box-shadow:
        inset 1px 1px 0px var(--mac-light-gray),
        inset -1px -1px 0px var(--mac-gray);
}

/* Navigation buttons grid (2×2 + utilities row) */
.action-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-bottom: 3px;
}

.action-nav-grid #btn-forward,
.action-nav-grid #btn-back {
    grid-column: 1 / -1;
}

.action-util-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
}

.action-util-grid .retro-btn {
    min-width: auto;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 9px;
}

.stat-label {
    color: var(--mac-text);
    min-width: 80px;
    flex-shrink: 0;
}

/* Stat bar icons */
.icon-energy     { color: #22aa22; }
.icon-focus      { color: #4488cc; }
.icon-motivation { color: #ccaa22; }
.icon-coffee     { color: #886600; }
.icon-guilt      { color: #aa2222; }
.icon-day        { color: #663388; }

/* Title screen button icons */
.icon-new-game   { color: #227733; }
.icon-load-game  { color: #225599; }
.icon-help-btn   { color: #663388; }
.icon-back-btn   { color: #555555; }

/* Class card icons */
.icon-class-chef      { color: #2255aa; }
.icon-class-freelance { color: #cc6600; }
.icon-class-stagiaire { color: #22aa44; }
.icon-class-cpo       { color: #663388; }

/* Gameover stat icons */
.icon-tasks { color: #2255aa; }
.icon-floor { color: #666666; }

.stat-bar {
    flex: 1;
    height: 10px;
    background: var(--mac-white);
    border: 1px solid var(--mac-black);
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    transition: width 0.3s;
}

/* macOS 7 color stat bars */
.stat-fill.energy {
    background: #22aa22;
}
.stat-fill.focus {
    background: #4488cc;
}
.stat-fill.motivation {
    background: #ccaa22;
}
.stat-fill.monster-hp {
    background: #cc3333;
}

.stat-value {
    color: var(--mac-text);
    min-width: 50px;
    text-align: right;
}

.stat-value.amber { color: var(--mac-warning); }
.stat-value.red { color: var(--mac-danger); }
.stat-value.curse { color: var(--mac-purple); }

.monster-name {
    color: var(--mac-danger);
    font-size: 10px;
    margin: 4px 0;
}

.monster-type {
    color: var(--mac-text-dim);
    font-size: 8px;
    margin-bottom: 6px;
    font-style: italic;
}

.action-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* === MESSAGE LOG (Mac window) === */
#message-log {
    height: 140px;
    background: var(--mac-white);
    border-top: 2px solid var(--mac-black);
    overflow-y: auto;
    padding: 8px 12px;
    font-size: 10px;
    line-height: 1.7;
}

#messages {
    color: var(--mac-text);
}

#messages .msg-combat { color: var(--mac-danger); }
#messages .msg-event { color: var(--mac-warning); }
#messages .msg-curse { color: var(--mac-purple); }
#messages .msg-system { color: var(--mac-text); font-weight: bold; }
#messages .msg-loot { color: var(--mac-info); }
#messages .msg-humor { color: var(--mac-text-dim); font-style: italic; }

/* === MAP SCREEN === */
.map-container {
    border: 2px solid var(--mac-black);
    background: var(--mac-white);
    margin-bottom: 15px;
    box-shadow: var(--win-shadow);
}

#map-canvas {
    display: block;
    image-rendering: pixelated;
}

.map-legend {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 9px;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--mac-text);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-color {
    width: 12px;
    height: 12px;
    display: inline-block;
    border: 1px solid var(--mac-black);
}

.legend-color.start { background: #aaccaa; }
.legend-color.explored { background: #c8c4bc; }
.legend-color.unexplored { background: var(--mac-light-gray); }
.legend-color.cursed { background: #ccaacc; }
.legend-color.boss { background: #ccaaaa; }
.legend-color.player { background: var(--mac-black); }

/* === TASK MANAGEMENT === */
.tasks-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 10px;
    width: 100%;
    max-width: 850px;
    max-height: 70vh;
    overflow-y: auto;
}

.tasks-form {
    grid-column: 1;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    padding: 12px;
    box-shadow: var(--win-shadow);
}

.tasks-form h3, .tasks-list h3, .tasks-stats h3 {
    color: var(--mac-text);
    font-size: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--mac-black);
    padding-bottom: 4px;
}

.tasks-list {
    grid-column: 2;
    grid-row: 1 / 3;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    padding: 12px;
    overflow-y: auto;
    max-height: 400px;
    box-shadow: var(--win-shadow);
}

.tasks-stats {
    grid-column: 1;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    padding: 12px;
    box-shadow: var(--win-shadow);
}

.task-item {
    border: 1px solid var(--mac-black);
    padding: 6px 8px;
    margin-bottom: 6px;
    font-size: 8px;
    background: var(--mac-white);
}

.task-item .task-item-name {
    color: var(--mac-danger);
    font-size: 9px;
    margin-bottom: 2px;
}

.task-item .task-item-info {
    color: var(--mac-text-dim);
}

.task-item.completed {
    border-color: var(--mac-gray);
    opacity: 0.6;
}

.task-item.completed .task-item-name {
    color: var(--mac-text-dim);
    text-decoration: line-through;
}

.dashboard-stat {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 9px;
    border-bottom: 1px solid var(--mac-gray);
    color: var(--mac-text);
}

.dashboard-stat span:last-child {
    color: var(--mac-text);
    font-weight: bold;
}

/* === EVENT OVERLAY (Mac dialog box) === */
.event-box {
    background: var(--mac-white);
    border: 3px solid var(--mac-black);
    padding: 24px;
    max-width: 550px;
    text-align: center;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.event-text {
    font-size: 10px;
    line-height: 2;
    color: var(--mac-text);
    margin-bottom: 20px;
    white-space: pre-line;
}

.event-text .hl { color: var(--mac-text); font-weight: bold; }

.event-icon-header {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.event-title {
    display: block;
    margin-bottom: 6px;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === GAME OVER (styled like title screen) === */
#ascii-logo-gameover {
    font-family: 'Jacquard 12', 'Press Start 2P', monospace;
    color: #2a1a4e;
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 6px;
    text-align: center;
    white-space: pre-wrap;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px rgba(102, 51, 136, 0.3);
}

.logo-game {
    background: linear-gradient(
        112deg,
        #ddaa00 38%,
        #fff5aa 48%,
        #ffffff 52%,
        #ddaa00 62%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: text-shine 4.5s ease-in-out infinite;
}

.logo-over {
    background: linear-gradient(
        112deg,
        #cc2222 38%,
        #ffaaaa 48%,
        #ffffff 52%,
        #cc2222 62%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: text-shine 4.5s ease-in-out infinite;
}

.gameover-skull-sep {
    display: block;
    color: #cc2222;
    font-size: 24px;
    margin: -8px 0 -4px;
}

.gameover-stats {
    font-size: 11px;
    line-height: 2.2;
    color: var(--mac-text);
    margin-bottom: 20px;
}

.gameover-stats span {
    font-weight: bold;
}

.gameover-quote {
    font-size: 10px;
    color: var(--mac-text-dim);
    font-style: italic;
    margin-bottom: 28px;
    max-width: 420px;
    text-align: center;
    line-height: 1.8;
}

/* === VICTORY OVERLAY (Mac dialog) === */
.victory-box {
    background: var(--mac-white);
    border: 3px solid var(--mac-black);
    padding: 30px;
    max-width: 500px;
    text-align: center;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

.victory-art {
    color: var(--mac-text);
    font-size: 8px;
    margin-bottom: 15px;
}

.victory-text {
    font-size: 9px;
    color: var(--mac-text);
    line-height: 2;
    margin-bottom: 20px;
}

/* === ABOUT DIALOG (macOS System 7 vintage) === */
#about-dialog {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-box {
    width: 380px;
}

.about-body {
    padding: 20px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--mac-white);
}

.about-logo {
    font-family: 'Jacquard 12', monospace;
    font-size: 36px;
    line-height: 1.1;
    margin-bottom: 8px;
}

.about-title-dungeons {
    color: #ddaa00;
}

.about-title-depression {
    color: #cc2222;
}

.about-subtitle {
    font-size: 9px;
    color: var(--mac-text-dim);
    margin-bottom: 4px;
    font-style: italic;
}

.about-version {
    font-size: 8px;
    color: var(--mac-text-dim);
    margin-bottom: 10px;
}

.about-divider {
    width: 100%;
    height: 1px;
    background: var(--mac-black);
    margin: 10px 0;
}

.about-desc {
    font-size: 8px;
    line-height: 1.9;
    color: var(--mac-text);
}

.about-credits {
    width: 100%;
    font-size: 8px;
}

.about-credits-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dotted var(--mac-gray);
}

.about-credits-row span:first-child {
    color: var(--mac-text-dim);
}

.about-credits-row a {
    color: var(--mac-purple);
    text-decoration: none;
}

.about-credits-row a:hover {
    text-decoration: underline;
}

.about-quote {
    font-size: 7px;
    font-style: italic;
    color: var(--mac-text-dim);
    line-height: 1.8;
    margin-bottom: 14px;
}

.about-ok-btn {
    min-width: 80px;
    text-align: center;
    font-size: 10px;
    padding: 6px 20px;
}

/* === HELP SCREEN === */
.help-content {
    max-width: 600px;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.help-section {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--win-shadow);
}

.help-section h3 {
    color: var(--mac-text);
    font-size: 9px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--mac-black);
    padding-bottom: 4px;
}

.help-section p {
    font-size: 7px;
    color: var(--mac-text);
    line-height: 2;
}

.key {
    background: var(--mac-light-gray);
    border: 1px solid var(--mac-black);
    border-radius: 3px;
    padding: 2px 6px;
    color: var(--mac-text);
    font-size: 7px;
}

.hl-monster { color: var(--mac-danger); }
.hl-atk { color: var(--mac-danger); }
.hl-flee { color: var(--mac-warning); }
.hl-delay { color: var(--mac-purple); }
.hl-delegate { color: var(--mac-info); }
.hl-curse { color: var(--mac-purple); font-weight: bold; }

/* === SCROLLBAR (Mac System 6 style) === */
::-webkit-scrollbar { width: 16px; }
::-webkit-scrollbar-track {
    background: var(--mac-white);
    border-left: 1px solid var(--mac-black);
}
::-webkit-scrollbar-thumb {
    background: var(--mac-light-gray);
    border: 1px solid var(--mac-black);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--mac-gray);
}
::-webkit-scrollbar-button {
    height: 16px;
    background: var(--mac-light-gray);
    border: 1px solid var(--mac-black);
}

/* === ANIMATIONS === */
@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.shake {
    animation: screen-shake 0.2s ease-in-out;
}

@keyframes flash-red {
    0% { background-color: rgba(170, 34, 34, 0.15); }
    100% { background-color: transparent; }
}

.flash-damage {
    animation: flash-red 0.3s ease-out;
}

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

.fade-in {
    animation: fade-in 0.4s ease-out;
}

/* === RESPONSIVE === */
@media (max-width: 960px) {
    #game-container {
        width: 100%;
    }

    .game-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    #dungeon-canvas {
        width: 100%;
        height: auto;
    }

    .class-grid {
        grid-template-columns: 1fr;
    }

    .tasks-layout {
        grid-template-columns: 1fr;
    }

    .tasks-list {
        grid-column: 1;
        grid-row: auto;
    }
}
