/* The game's look (the designer's Figma file, 2026-10): wooden planks for buttons, tabs and tiles, a
   small-caps serif, dark green panels. Loaded after style.css, which keeps the layout; this file only
   dresses it. The textures are in assets/ui, the fonts in assets/fonts. */

/* Latin and Cyrillic (en, ru, uk), as Google Fonts splits them; OFL fonts kept with the game, which runs offline */
@font-face { font-family: 'Bona Nova SC'; font-weight: 400; font-display: swap; src: url('../assets/fonts/BonaNovaSC-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Bona Nova SC'; font-weight: 400; font-display: swap; src: url('../assets/fonts/BonaNovaSC-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bona Nova SC'; font-weight: 700; font-display: swap; src: url('../assets/fonts/BonaNovaSC-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Bona Nova SC'; font-weight: 700; font-display: swap; src: url('../assets/fonts/BonaNovaSC-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Philosopher'; font-weight: 700; font-display: swap; src: url('../assets/fonts/Philosopher-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Philosopher'; font-weight: 700; font-display: swap; src: url('../assets/fonts/Philosopher-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: 'Bona Nova SC', Georgia, 'Times New Roman', serif;
  --font-title: 'Philosopher', Georgia, serif;
  --bg: #0d140d;              /* panels, bars */
  --bg-deep: #070b07;         /* fields, behind everything */
  --edge: #2d313b;            /* a panel's thin border */
  --text: #eeeeee;
  --text-bright: #ffffff;
  --text-dim: #8a91a0;        /* headings, options not chosen */
  --text-menu: #b6c1b8;       /* the main menu's buttons */
  --warn: #e74c3c;
  --gold: #f1c40f;
  --glow: 0 0 10px #2a2d18;   /* round anything chosen */
  --plank: url('../assets/ui/plank.webp');
  --plank-green: url('../assets/ui/plank-green.webp');
  --plank-green-hover: url('../assets/ui/plank-green-hover.webp');
  --plank-green-pressed: url('../assets/ui/plank-green-pressed.webp');
  --plank-teal: url('../assets/ui/plank-teal.webp');
  --plank-dark: url('../assets/ui/frame.webp');
  --plank-red: url('../assets/ui/frame-red.webp');
}

html, body, button, input, select, textarea { font-family: var(--font); }
#game-container, #main-area { background: var(--bg-deep); }

/* ---- Planks: every button-like thing is a piece of wood; chosen ones are green with a glow */
.btn, .menu-button, #play-button, .tab-btn, .wave-option, .map-option, .battle-size-option, .map-source-option, .editor-size-option,
.difficulty-option, .cards-option, .fps-option, .faction-option, .menu-gear, #seed-reroll, #btn-generate-name,
.item-row .item-name, .item-row .item-delete, .item-row .item-confirm, .item-row .item-cancel,
.resources-grid div, .resource-group-members div {
  background: var(--plank) center / cover;
  border: none;
  border-radius: 6px;
  color: var(--text);
}
/* options and tabs not chosen are quieter */
.tab-btn, .wave-option, .map-option, .battle-size-option, .map-source-option, .editor-size-option, .difficulty-option, .cards-option, .fps-option,
.faction-option { color: var(--text-dim); }
[data-sheet="battle-settings"] .battle-size-option:not(.active) { color: #fff; }
@media (hover: hover) {
  .tab-btn:not(:disabled):hover, .wave-option:not(:disabled):hover, .map-option:not(:disabled):hover,
  .battle-size-option:not(:disabled):hover, .map-source-option:not(:disabled):hover, .editor-size-option:not(:disabled):hover,
  .difficulty-option:not(:disabled):hover, .cards-option:not(:disabled):hover, .fps-option:not(:disabled):hover, .faction-option:not(:disabled):hover { color: var(--text); }
  .btn:not(:disabled):hover, .menu-button:not(:disabled):hover { color: var(--text-bright); }
  /* the plank's own light, not a filter over the text too */
  button:not(:disabled):hover { filter: none; }
}
.btn.active, .tab-btn.active, .wave-option.active, .map-option.active, .battle-size-option.active, .map-source-option.active,
.editor-size-option.active, .difficulty-option.active, .cards-option.active, .fps-option.active, .faction-option.active,
.item-row .item-name.active, .resources-grid .resource-group.open, .menu-button-primary, #play-button {
  background: var(--plank-green) center / cover;
  border: none;
  color: var(--text-bright);
  box-shadow: var(--glow);
}
@media (hover: hover) {
  .menu-button-primary:not(:disabled):hover, #play-button:not(:disabled):hover, .btn.active:not(:disabled):hover {
    background-image: var(--plank-green-hover);
  }
}
.menu-button-primary:not(:disabled):active, #play-button:not(:disabled):active, .btn.active:not(:disabled):active {
  background-image: var(--plank-green-pressed);
}
/* a build mode switched on in the panel: teal, so it reads as "on" rather than "chosen" */
#build-actions .btn.active, #tab-farming .btn.active { background-image: var(--plank-teal); }
.menu-button:disabled, .faction-option:disabled { color: var(--text-dim); opacity: 1; }
button.cant-afford { opacity: 0.55; }

/* buttons that say something about a settler keep their colour, laid over the wood */
.btn-demolish { background: var(--plank-red) center / cover; }
.btn-disarm { background: linear-gradient(rgba(211, 84, 0, 0.6), rgba(211, 84, 0, 0.6)), var(--plank) center / cover; }
.btn-armor { background: linear-gradient(rgba(39, 174, 96, 0.55), rgba(39, 174, 96, 0.55)), var(--plank) center / cover; }
.item-row .item-confirm { background: var(--plank-red) center / cover; color: var(--text-bright); }
.item-row .item-question { color: var(--gold); }

/* ---- The bars and panels */
#top-bar, #dock { background: transparent; }
#top-bar, #dock { border: none; box-shadow: none; }
#sheet-frame, #resources-panel { background: var(--bg); border: 1px solid var(--edge); }
#resources-panel { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); }
/* the middle of the top bar and the chip of the tool picked: framed dark planks */
.top-battle, .top-editor, #placing-chip, #info-card { background: var(--plank-dark) center / cover; }
/* Endless's wave and the Plague's stats: the same dark plate, white numbers on it (the plank's grain under small
   gold letters hardly read) */
.top-wave, body[data-hud="plague"] .plague-stats { background: rgba(7, 11, 7, 0.9); border: 1px solid rgba(200, 192, 206, 0.32);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35); }
.btn-pause-square { background: var(--plank) center / cover; border: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.btn-pause-square.paused { background-image: var(--plank-green); box-shadow: var(--glow); }
.btn-worldmap { background: var(--plank) center / cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.placing-close { background: var(--plank-red) center / cover; }
/* the strip of the main stock: small planks on a dark band */
#resource-strip { background: rgba(7, 11, 7, 0.78); border: 1px solid var(--edge); color: var(--text); font-family: var(--font); }
.strip-chip { background: var(--plank) center / cover; }
.strip-more { color: var(--text-dim); }
/* each dock button has its own plank; the selected tab turns green */
#dock .dock-btn { background: var(--plank) center / cover; border: 1px solid var(--edge); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); color: var(--text-dim); }
#dock .dock-btn.active { background: var(--plank-green) center / cover; color: var(--text-bright); box-shadow: var(--glow); }
/* the eraser is a mode, not a sheet: on, it turns gold */
@media (hover: hover) {
  #dock .dock-btn:not(.active):hover { background: var(--plank) center / cover; color: var(--text); }
}
.panel-heading, .wave-settings, .seed-settings, .generator-fields h2 { color: var(--text-dim); text-transform: none; letter-spacing: 0; }
/* a setting's name over its choices: bigger and lighter than the dim grey, which hardly read on the scene behind */
.wave-settings, .seed-settings > label { font-size: 13px; color: #d4cfb6; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.resources-grid div, .resource-group-members div { font-weight: 400; padding: 4px 3px; }
.resources-grid .resource-group { border: none; }
.resource-group-members { background: var(--bg); border: 1px solid var(--edge); }
.selected-unit-box { background: var(--plank-dark) center / cover; border: none; }
#seed-input, .menu-number, .generator-field input { background: var(--bg-deep); border: 1px solid var(--edge); }

/* ---- Toasts: a red plank for a warning, a green one for done (showNotification sets .ok) */
#toast-notification { background: var(--plank-red) center / cover; border: none; font-weight: 700; }
#toast-notification.ok { background: var(--plank-green) center / cover; box-shadow: var(--glow); }

/* ---- The main menu */
.main-menu-content {
  /* (no blur of the scene behind: it was worked out again every frame over the moving scene, and made a screen's
     fading in stutter; a see-through dark green, the scene showing through it, as Lima made it: near solid, it read as a
     flat green board) */
  background: rgba(30, 50, 34, 0.42);
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}
/* a screen itself is clear: the pane under it is #menu-glass, the same one from screen to screen */
#main-menu .main-menu-content[data-screen] { background: none; box-shadow: none; }
#menu-glass { position: absolute; z-index: 0; pointer-events: none; border-radius: 8px; opacity: 0;
  background: rgba(30, 50, 34, 0.42); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  /* (it's moved by a transform the graphics card plays, placeGlass: smooth while the scene keeps the page busy) */
  transform-origin: 0 0; transition: opacity 0.2s ease; }
#menu-glass.on { opacity: 1; }
/* a short screen (a phone on its side): the first screen's buttons smaller, so the three fit under the name */
@media (max-height: 520px) {
  .main-menu-content[data-screen="home"], .main-menu-content[data-screen="modes"] { gap: 8px; }
  /* (the pause menu's too: its buttons all alike, none looking pressed) */
.main-menu-content[data-screen="home"] .menu-button, .main-menu-content[data-screen="modes"] .menu-button, .main-menu-content[data-screen="editor-hub"] .menu-button, .main-menu-content[data-screen="start"] .menu-button, #pause-menu .menu-button, #main-menu #play-button, #main-menu #plague-play { min-height: 46px; font-size: 17px; border-width: 16px 22px; }
}
body.menu-ui-hidden #menu-glass, body.loading #menu-glass { display: none; }
@media (prefers-reduced-motion: reduce) { #menu-glass { transition: none; } }
#main-menu, .menu-overlay { background: rgba(7, 11, 7, 0.92); }
body.menu-world #main-menu { background: transparent; }
.main-menu-content h1 { font-weight: 700; letter-spacing: 0; }
/* Back: a small plank with its arrow and word in the pane's top left corner, the same on every screen: a way back to the
   screen before, not a window shut, so not a cross (Lima); Esc and Android's back do it too (menu.screens.js menuBack) */
.menu-back { position: absolute !important; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  min-height: 0; height: 26px; padding: 0 10px 0 6px !important; border-radius: 6px; background: var(--plank) center / cover;
  color: #f1ead2; font-size: 12px !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); }
.menu-back .ic { width: 14px; height: 14px; }
/* (a screen with it a row taller at the top: its name under it, not beside it, where a long one ran into it on a phone) */
#main-menu .main-menu-content:has(> .menu-back) { padding-top: 40px; }
@media (hover: hover) { .menu-back:hover { color: #fff; filter: brightness(1.12); } }
.menu-back:active { filter: brightness(0.9); }
/* (a screen's gear, the map generator: top right, across from it; the pane's name clear of both) */
.menu-gear { left: auto !important; right: 12px !important; top: 10px !important; width: 34px; height: 34px; padding: 0 !important;
  display: grid; place-items: center; border: none !important; background: rgba(0, 0, 0, 0.22) !important; }
.main-menu-content[data-screen] > h1 { padding: 0 44px; }

/* the first screen's buttons (and Play's modes): a plank framed in metal corners, the corners kept whatever the size */
.main-menu-content[data-screen="home"], .main-menu-content[data-screen="modes"], .main-menu-content[data-screen="editor-hub"], .main-menu-content[data-screen="start"], #pause-menu .main-menu-content { gap: 16px; }
/* (the pause menu's too: its buttons all alike, none looking pressed) */
.main-menu-content[data-screen="home"] .menu-button, .main-menu-content[data-screen="modes"] .menu-button, .main-menu-content[data-screen="editor-hub"] .menu-button, .main-menu-content[data-screen="start"] .menu-button, #pause-menu .menu-button, #main-menu #play-button, #main-menu #plague-play {
  min-height: 62px;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-menu);
  text-shadow: 4px 5px 4px rgba(0, 0, 0, 0.25);
  background: none;
  box-shadow: none;
  border-style: solid;
  border-width: 22px 28px;
  border-image: url('../assets/ui/menu-button.webp') 80 100 fill / 22px 28px stretch;
  border-radius: 0;
}
@media (hover: hover) {
  .main-menu-content[data-screen="home"] .menu-button:not(:disabled):hover, .main-menu-content[data-screen="modes"] .menu-button:not(:disabled):hover, .main-menu-content[data-screen="start"] .menu-button:not(:disabled):hover { color: var(--text-bright) !important; filter: brightness(1.12); }
}
.main-menu-content[data-screen="home"] .menu-button:disabled, .main-menu-content[data-screen="modes"] .menu-button:disabled { color: var(--text-dim) !important; filter: saturate(0.4) brightness(0.8); }

/* the game's name: old gold letters with a dark edge below and a soft shadow (a gradient fill can't take a
   text-shadow, so the shadows are filters) */
.menu-title { color: transparent; text-shadow: none; font-family: var(--font-title); font-weight: 700; letter-spacing: 2px; }
.menu-title span {
  background: linear-gradient(90deg, #67614f 0%, #999177 50%, #67614f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 0 #3d2b00) drop-shadow(-2px 8px 9px rgba(0, 0, 0, 0.75));
}

/* ---- The defeat screen */
.defeat-box { background: var(--bg); border: 1px solid #c0392b; }
.defeat-title { font: 700 32px var(--font); }

/* A plank not chosen raised, not sunk: a light edge on top, a shadow under it, its words
   light (the dark plank and dim words read as a button already pressed); pressed, it goes down a little */
html:root :is(.btn, .menu-button, .tab-btn, .wave-option, .map-option, .battle-size-option, .map-source-option, .editor-size-option,
  .difficulty-option, .cards-option, .fps-option, .faction-option, .menu-gear, #seed-reroll, #btn-generate-name, .item-row .item-name,
  .item-row .item-delete, #dock .dock-btn):not(.active):not(.on):not(.menu-button-primary):not(#play-button) {
  background: linear-gradient(to bottom, rgba(255, 238, 200, 0.12), rgba(0, 0, 0, 0.16)), var(--plank) center / cover;
  box-shadow: inset 0 1px 0 rgba(255, 235, 190, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.45);
}
html:root :is(.btn, .menu-button, .tab-btn, .wave-option, .fps-option, .faction-option, #dock .dock-btn):not(:disabled):active { transform: translateY(1px); }
html:root .wave-options.segmented > button, html:root .wave-options.switch > button { background: transparent !important; box-shadow: none !important; }
html:root .wave-options.segmented > button:not(.active) { color: #cfc8ad; }
html:root .music-toggle.on, html:root .music-listen.on { background: var(--plank-green) center / cover; border-color: transparent; }
/* (not the framed buttons of the first screens and the pause: they're a picture of their own, plank and frame; the raised
   look put a second plank under the frame of all but the first, and their words another colour) */
html:root :is(.main-menu-content[data-screen="home"], .main-menu-content[data-screen="modes"], .main-menu-content[data-screen="editor-hub"], .main-menu-content[data-screen="start"], #pause-menu) .menu-button, html:root #main-menu #play-button, html:root #main-menu #plague-play {
  background: none !important; box-shadow: none !important; color: var(--text-menu) !important;
}
/* (a mode's Play: under its settings, framed as the first screens' buttons, not across the whole screen) */
#main-menu #play-button, #main-menu #plague-play { width: min(100%, 420px); justify-self: center; margin: 8px auto 0; text-transform: none; }
