/* GRAVETIDE's look (2026-11-26, owner: «весь uix должен быть шикарным»): the kit of our hi3d sheets (assets/ui/kit,
   cut by tools/cut_ui_kit*.py): carved wood and brass frames as 9-slice border-images, a leather tile at its own size
   under every panel (never a see-through grey box), lacquered kit buttons with their four painted states, gold on dark,
   Cormorant for headings. Linked from index.html before the modules' own styles; the modules use the same pieces. */
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500 700; font-display: swap; src: url(/assets/fonts/cg-cyr.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500 700; font-display: swap; src: url(/assets/fonts/cg-lat.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant SC'; font-weight: 700; font-display: swap; src: url(/assets/fonts/csc7-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant SC'; font-weight: 700; font-display: swap; src: url(/assets/fonts/csc7-lat.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --k-gold: #f1d58e; --k-gold2: #ffd98a; --k-ink: #f3e6c8; --k-dim: #d9bd80; --k-red: #ff9c86;
  --k-display: 'Cormorant Garamond', Georgia, 'Palatino Linotype', serif;
  --k-caps: 'Cormorant SC', 'Cormorant Garamond', Georgia, serif;
  --k-bg: radial-gradient(ellipse at 50% 35%, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%), url(/assets/ui/kit/leather.png) 0 0 / 224px 224px repeat, #22180f;
  --k-card-bg: linear-gradient(rgba(255,226,160,.035), rgba(0,0,0,.18)), #1d140d;
}

/* lining figures everywhere: Cormorant's old-style digits hang below the line and look off-centre on the plates */
*, *::before, *::after { font-feature-settings: 'lnum' 1 !important; }   /* (important: every 'font:' shorthand of the modules would reset it) */

/* ---- the base button of every screen: the kit's lacquered plate in brass (was a flat yellow gradient) */
button { font: 700 17px/1 var(--k-display); letter-spacing: .03em; color: #fbe9c2; text-shadow: 0 1px 2px #000, 0 0 8px rgba(0,0,0,.5);
  background: none; box-shadow: none; border-radius: 0; border: 0 solid transparent; border-image: url(/assets/ui/kit/btn.png) 40 36 fill / 20px 20px;
  padding: 11px 28px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; position: relative; overflow: visible; transition: transform .1s, filter .12s; }
button:hover:not(:disabled) { border-image-source: url(/assets/ui/kit/btn_hover.png); }
button:active:not(:disabled) { border-image-source: url(/assets/ui/kit/btn_down.png); transform: translateY(1px); }
button:disabled { border-image-source: url(/assets/ui/kit/btn_off.png); color: #cfc8bb; filter: none; cursor: default; }

/* ---- a panel: the carved frame over the leather */
.panel { background: var(--k-bg); background-clip: border-box; border: 18px solid transparent; border-image: url(/assets/ui/kit/frame.png) 112 / 44px; border-radius: 0; backdrop-filter: none; box-shadow: none; filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.k-card { border: 0 solid transparent; border-image: url(/assets/ui/kit/card_frame.png) 30 / 14px; background: var(--k-card-bg); background-clip: padding-box; }

/* ---- the toasts: a red cloth ribbon each, the words centred in its middle */
#toasts { top: 84px; gap: 4px; }
#toasts div { display: flex; align-items: center; justify-content: center; min-height: 42px; box-sizing: border-box; padding: 3px 64px 15px; max-width: min(640px, 92vw); text-align: center;
  font: 700 17px/1.15 var(--k-display); color: #fff0cc; text-shadow: 0 1px 3px rgba(60,0,0,.95); border: 0 solid transparent; border-image: url(/assets/ui/kit/ribbon.png) 0 150 fill / 0 52px;
  background: none; border-radius: 0; backdrop-filter: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
/* the words stay on the ribbon's front band (owner: text never runs past its plate, anywhere): the strip of toasts has
   its own width so a ribbon is not squeezed, one line only on the ribbon; a longer message goes on the carved plate,
   whose face grows with its lines, at the same inset both ends */
html body #toasts { width: min(760px, 94vw); }
html body #toasts div { white-space: nowrap; padding: 3px 78px 15px; }
html body #toasts div.long { white-space: normal; min-height: 52px; padding: 10px 46px 18px; border-image: url(/assets/ui/kit/header.png) 50 70 fill / 23px 32px; text-shadow: 0 1px 2px #000; color: #fbe9c2; line-height: 1.2; }
#note { font-family: var(--k-display); font-weight: 700; }

/* ---- the loading screen */
.screen { background: radial-gradient(ellipse at center, #0f1a20, #05090c); }
.screen .box { max-width: 560px; text-align: center; }
.screen h1 { font: 700 46px/1 var(--k-display); letter-spacing: .3em; padding-left: .3em; background: linear-gradient(#fff1c8, #e2b45c 60%, #9c7030); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.screen p.sub { font: 600 17px var(--k-display); color: var(--k-dim); }

/* ---- ashore (src/game/shore.js): painted medallions, the words on a little plaque under each; the run one big on a phone */
html body #shoreUi .btns { bottom: 14px; gap: 18px; align-items: flex-end; }
html body #shoreUi button { width: 76px; height: 96px; min-height: 0; padding: 0; border: 0; border-image: none; background: none; box-shadow: none; border-radius: 0; -webkit-tap-highlight-color: transparent; flex-direction: column; justify-content: flex-start; gap: 3px;
  font: 700 14px/1 var(--k-display); color: #fbe9c2; filter: drop-shadow(0 4px 8px rgba(0,0,0,.65)); }
html body #shoreUi button::before { content: ''; width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--ic) center / contain no-repeat; transition: transform .12s, filter .12s; }
html body #shoreUi button:hover:not(:disabled)::before { transform: scale(1.07); filter: brightness(1.12) drop-shadow(0 0 10px rgba(255,205,110,.8)); }
html body #shoreUi button:active:not(:disabled)::before { transform: scale(.93); }
html body #shoreUi button:disabled { opacity: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.65)); } html body #shoreUi button:disabled::before { filter: grayscale(1) brightness(.55); }
html body #shoreUi button > span.c { display: flex; align-items: center; justify-content: center; height: 24px; padding: 0 10px 5px; box-sizing: border-box; white-space: nowrap; border: 0 solid transparent; border-image: url(/assets/ui/kit/header.png) 50 70 fill / 11px 15px; text-shadow: 0 1px 2px #000; }
html body #shoreUi button small { position: absolute; top: 0; right: 2px; display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border-radius: 50%; font: 700 11px/1 var(--k-caps); color: #2a1606; background: radial-gradient(circle at 40% 35%, #fff0c4, #c99a48); opacity: 1; box-shadow: 0 0 0 1px #3a2a14; }
html body #shoreUi button.on::before { animation: kGlow 1.3s ease-in-out infinite; }
html body #shoreUi button.on > span.c { color: #ffe08a; }
html body #shoreUi #shAct { --ic: url(/assets/ui/spyglass.png); } html body #shoreUi #shAct[data-k="dig"] { --ic: url(/assets/ui/dig.png); } html body #shoreUi #shAct[data-k="lair"] { --ic: url(/assets/ui/kit/b_attack.png); } html body #shoreUi #shAct[data-k="boat"] { --ic: url(/assets/ui/kit/b_boats.png); }
html body #shoreUi #shRun { --ic: url(/assets/ui/kit/b_move.png); } html body #shoreUi #shMaps { --ic: url(/assets/ui/scroll.png); } html body #shoreUi #shBack { --ic: url(/assets/ui/kit/b_boats.png); }
html body #shoreUi .land { right: 18px; bottom: 150px; --ic: url(/assets/ui/anchor.png); width: auto; min-width: 96px; }
html body #shoreUi .land::before { width: 84px; height: 84px; }
html body #shoreUi .pill { bottom: 128px; display: flex; align-items: center; justify-content: center; height: 46px; box-sizing: border-box; padding: 0 52px 9px; font: 700 18px/1 var(--k-display); color: #fbe9c2; text-shadow: 0 1px 2px #000;
  background: none; border-radius: 0; border: 0 solid transparent; border-image: url(/assets/ui/kit/header.png) 50 70 fill / 23px 32px; }
html body #shoreUi .bar { bottom: 112px; width: 300px; height: 22px; box-sizing: border-box; padding: 5px 13px; background: none; border-radius: 0; overflow: visible; border: 0 solid transparent; border-image: url(/assets/ui/kit/bar.png) 27 30 fill / 11px 13px; }
html body #shoreUi .bar i { border-radius: 3px; background: linear-gradient(#ffe08a, #c4862a); box-shadow: 0 0 8px rgba(255,200,90,.5); }
html body #shoreUi .maps { background: var(--k-bg); background-clip: border-box; border: 20px solid transparent; border-image: url(/assets/ui/kit/frame.png) 112 / 48px; border-radius: 0; padding: 14px 18px; font: 600 16px/1.3 var(--k-display); }
html body #shoreUi .maps h3 { font: 700 24px/1 var(--k-display); color: var(--k-gold); }
html body #shoreUi .maps .m { border-top: 0; padding: 10px 0; background: url(/assets/ui/kit/divider.png) center top / 70% 14px no-repeat; }
html body #shoreUi .maps button { width: auto; height: auto; min-height: 38px; padding: 9px 22px; border-image: url(/assets/ui/kit/btn.png) 40 36 fill / 19px 19px; font-size: 15px; flex-direction: row; }
html body #shoreUi .maps button::before { display: none; }
@keyframes kGlow { 50% { filter: drop-shadow(0 0 14px rgba(255,214,120,1)) brightness(1.15); } }
@media (max-height: 520px) {
  html body #shoreUi .btns { gap: 10px; bottom: 6px; } html body #shoreUi button { width: 64px; height: 80px; font-size: 12px; } html body #shoreUi button::before { width: 60px; height: 60px; }
  html body #shoreUi .pill { bottom: 92px; height: 38px; font-size: 15px; } html body #shoreUi .bar { bottom: 82px; }
  html body #shoreUi .land { bottom: 96px; } html body #shoreUi .land::before { width: 66px; height: 66px; }
}
/* on a phone the run is held and toggled with a thumb: the biggest of them */
@media (pointer: coarse) { html body #shoreUi #shRun { width: 96px; height: 116px; } html body #shoreUi #shRun::before { width: 92px; height: 92px; } }
@media (pointer: coarse) and (max-height: 520px) { html body #shoreUi #shRun { width: 84px; height: 100px; } html body #shoreUi #shRun::before { width: 80px; height: 80px; } }
@media (max-height: 520px) { #toasts { top: 70px; } html body #toasts div { font-size: 14px; min-height: 34px; padding: 2px 56px 12px; border-image-width: 0 38px; max-width: 86vw; } html body #toasts div.long { padding: 8px 34px 14px; border-image-width: 17px 24px; } }

/* the one short line for a refused action: small, above the ability bar, gone in two seconds */
#quickNote { position: fixed; left: 50%; bottom: calc(88px + var(--sb, 0px)); transform: translate(-50%, 6px); z-index: 40; max-width: min(520px, 80vw); padding: 6px 14px; box-sizing: border-box; font: 600 14px/1.2 var(--k-display); color: #ffe2c0; text-align: center; text-shadow: 0 1px 2px #000; background: #2a0e08; border-radius: 6px; box-shadow: 0 0 0 1px #7a3a28; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#quickNote.on { opacity: 1; transform: translate(-50%, 0); }
/* ---- the phone's notch and corners (owner 2026-11-27, iPhone 15 Pro Max: the port's rail under the island, «В море» cut):
   every screen keeps inside the safe area; the page is drawn edge to edge (viewport-fit=cover) and the UI is inset */
:root { --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); }
html body #lh { inset: var(--st) var(--sr) var(--sb) var(--sl); }
html body #lport { padding: var(--st) var(--sr) var(--sb) var(--sl); box-sizing: border-box; }
html body .wk { max-width: calc(100vw - var(--sl) - var(--sr) - 12px); max-height: calc(100dvh - var(--st) - var(--sb) - 8px); }
html body #lst { padding-left: var(--sl); padding-right: var(--sr); box-sizing: border-box; }
html body #shoreUi { left: var(--sl); right: var(--sr); }
html body #toasts { max-width: calc(100vw - var(--sl) - var(--sr) - 16px); }
/* ---- a big screen (VK's moderation, 2026-12-03 — the classic game was turned down for «tiny text and buttons» on a big
   monitor): the windows and the HUD grow with the screen in steps, each step small enough that a window (940×660 at
   its own scale) still fits whole; the phone's own steps down are hud.js's (--s .78 / .64) */
:root { --wz: 1; }
@media (min-width: 1200px) and (min-height: 800px) { :root { --wz: 1.15; } html body #lh { --s: 1.15; } }
@media (min-width: 1400px) and (min-height: 880px) { :root { --wz: 1.25; } html body #lh { --s: 1.25; } }
@media (min-width: 1600px) and (min-height: 1000px) { :root { --wz: 1.4; } html body #lh { --s: 1.4; } }
@media (min-width: 1900px) and (min-height: 1200px) { :root { --wz: 1.6; } html body #lh { --s: 1.6; } }
/* the cards, the boarding's plates and books grow with the windows; the port's own screen (1180×780) by its own steps */
html body :is(#evCard, #evMg, #evGoals, #sa-card, #sa-chip, #sa-hunt, #sc-asks, #evBl, #evMk, #bfTop, #bfOrd, #bfSide, #bfDuel, #bfOffer, #lbPlaque, #lbReady, #lbCorner, #lbBook > *, #bfBook > *, #toasts) { zoom: var(--wz); }
@media (min-width: 1500px) and (min-height: 960px) { html body #lport .lp-box { zoom: 1.15; } }
@media (min-width: 1900px) and (min-height: 1200px) { html body #lport .lp-box { zoom: 1.4; } }
html body .wk { zoom: var(--wz); max-width: calc((100vw - var(--sl) - var(--sr) - 12px) / var(--wz)); max-height: calc((100dvh - var(--st) - var(--sb) - 8px) / var(--wz)); }
@media (max-height: 520px) {
  html body #lport .lp-box { width: calc(100% - 8px); height: calc(100% - 6px); }
}

/* ---- a phone's windows without the blurred shadow (2026-12-01, owner: «жму меню, жму настройки и заново загружается
   все»): a 'filter: drop-shadow' on a window the size of the screen is drawn by the browser into a blurred layer of its
   own on the GPU, over the sea's buffers — on a phone short of memory the GPU is taken away (webglcontextlost) and the
   page reloads (src/main.js). A plain box-shadow costs no layer. */
@media (pointer: coarse) {
  .wk, .panel { filter: none !important; box-shadow: 0 8px 22px rgba(0,0,0,.6); }
}
