/* HerpDerp skin as in Siege Happens and Lords: flat brown slabs with gold corner ornaments,
   fat orange buttons with an ink outline, parchment cards. Jersey 10 is grid-drawn and sharp
   only at its design size (56/3 px), so all text uses that size or twice it. */
@font-face {
  font-family: 'Jersey 10';
  src: url(/assets/Jersey10.woff2) format('woff2'), url(../assets/herpderp/ui/fonts/Jersey10.ttf) format('truetype');
  font-display: swap;
}
:root {
  --wood: #6e3f1c;
  --wood-dark: #3a2210;
  --wood-light: #8f5a2c;
  --parch: #ead6a4;
  --gold: #ffd43a;
  --ink: #2b1a0e;
  --text: #fff6dc;
  --muted: #eed9a8;
  /* Readable text (15.11.2026): plain sans face for all text at --px; the pixel face only for
     gold titles (--title, sharp at --tpx or twice that). */
  --px: 16px;
  --tpx: 18.667px;
  --px2: 37.333px;
  --nx2: 28px; /* big numbers in the sans face */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --title: 'Jersey 10', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --ink-outline: 1px 0 0 #2b1a0e, -1px 0 0 #2b1a0e, 0 1px 0 #2b1a0e, 0 -1px 0 #2b1a0e, 1px 1px 0 #2b1a0e, -1px 1px 0 #2b1a0e, 1px -1px 0 #2b1a0e, -1px -1px 0 #2b1a0e;
}
* { box-sizing: border-box; font-size: var(--px); font-weight: 600; font-style: normal; letter-spacing: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2a12; color: var(--text); font-family: var(--font); font-synthesis: none; -webkit-font-smoothing: antialiased; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
/* Puddlehold pixel cursor, same file as Schlammschlacht (ledestru/dotp scripts/cursors.py); hotspot must match there. */
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; image-rendering: pixelated; cursor: url(../assets/ui/cursor_move.png) 2 2, default; }
/* HerpDerp v6: light haze at the top, soft dark edge and a warm wash over the world, same as Raid. */
#atmosphere {
  position: fixed; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(206,214,222,.14) 0%, rgba(206,214,222,.05) 18%, rgba(206,214,222,0) 36%),
    radial-gradient(ellipse 78% 72% at 50% 55%, rgba(20,12,4,0) 60%, rgba(20,12,4,.26) 100%),
    linear-gradient(rgba(255,186,96,.06), rgba(255,186,96,.06));
}
#hurt-edge { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(200,20,10,0) 40%, rgba(200,20,10,.7) 78%, rgba(120,0,0,.95) 100%); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { opacity: .9; }
a { color: var(--gold); }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #1d2a12; z-index: 50; text-shadow: var(--ink-outline); }

/* Panels */
.panel {
  background: var(--wood); border: 12px solid #2b1a0e; border-radius: 14px;
  border-image-source: url(../assets/herpderp/ui/panel.png); border-image-slice: 36 fill; border-image-width: 36px; border-image-repeat: round;
  box-shadow: 0 6px 0 rgba(0,0,0,.28); padding: 22px 26px;
}
.screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; background: rgba(20, 12, 4, .45); overflow-y: auto; padding: 12px; }
#menu { background: radial-gradient(ellipse at center, rgba(29, 42, 18, .35), rgba(10, 8, 4, .85)); }
.menu-panel { width: min(720px, 100%); text-align: center; }
.small-panel { width: min(460px, 100%); text-align: center; }
h1, h2 { margin: 6px 0; font-family: var(--title); font-size: var(--tpx); font-weight: 400; -webkit-font-smoothing: none; }
.cards-title, .cards-count { font-family: var(--title); font-weight: 400; -webkit-font-smoothing: none; }
.cards-title { font-size: var(--tpx); }
#end-title { font-size: var(--px2) !important; color: var(--gold); text-shadow: var(--ink-outline), 3px 3px 0 #2b1a0e; transform: scale(1.6); margin: 18px 0 14px; }
.tagline { margin: 10px 0 14px; }
h2 { color: var(--gold); text-shadow: var(--ink-outline); }

/* Buttons */
.btn {
  font-family: var(--font); cursor: pointer; padding: 6px 16px; margin: 6px;
  background: linear-gradient(#ffb64a, #ec8c22); color: #2b1a0e; border: 3px solid #2b1a0e; border-radius: 12px;
  box-shadow: 0 4px 0 #2b1a0e, inset 0 2px 0 rgba(255,255,255,.45);
}
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #2b1a0e; }
.btn:disabled { background: #55361a; color: #c7ad84; box-shadow: 0 3px 0 #2b1a0e; cursor: default; }
.btn.big { padding: 10px 28px; }
.btn.tiny { width: 32px; height: 32px; padding: 0; margin: 0 2px; border-radius: 50%; line-height: 1; }
.btn.tiny.off { background: #8a6a44; position: relative; opacity: .8; }
.btn.tiny.off::after { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 3px; background: #7a2f10; transform: rotate(-45deg); border-radius: 2px; }
.btn.tiny svg { display: block; margin: 0 auto; }
.row { display: flex; justify-content: center; flex-wrap: wrap; }

/* Hero choice */
.hero-grid { display: grid; grid-template-columns: repeat(5, auto); justify-content: center; gap: 8px; margin: 8px 0; }
.hero-card { width: 96px; padding: 5px; background: var(--parch); color: var(--ink); border: 3px solid #5a4120; border-radius: 10px; box-shadow: 0 3px 0 #2b1a0e; cursor: pointer; }
.hero-card.on { border-color: var(--gold); background: #fff1c2; box-shadow: 0 0 0 3px var(--gold), 0 3px 0 #2b1a0e; }
.hero-card canvas { width: 72px; height: 72px; display: block; margin: 0 auto; }
.hero-card .nm { line-height: 1.05; margin-top: 4px; font-size: .8em; }
.hero-detail { min-height: 96px; background: var(--parch); color: var(--ink); border: 3px solid #5a4120; border-radius: 10px; padding: 8px 12px; text-align: left; margin: 6px 0 10px; }
.hero-detail b { color: #7a2f10; }
.privacy { text-align: left; margin-top: 8px; }
.privacy summary { cursor: pointer; color: var(--muted); }
.privacy-text { white-space: pre-line; color: var(--muted); max-height: 40vh; overflow-y: auto; }

/* Bars */
.bar { position: relative; height: 22px; background: #2a1708; border: 3px solid #2b1a0e; border-radius: 11px; overflow: hidden; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.25); }
.fill.hp { background: linear-gradient(#ff7a60, #d42a1c); }
.bar span { position: absolute; inset: 0; text-align: center; line-height: 16px; color: #fff6dc; text-shadow: var(--ink-outline); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud .card { pointer-events: auto; }
/* HerpDerp v6: on large desktops the HUD scales up so text and hotkeys keep their on-screen size.
   The touch stick is placed from screen pixels, so it cancels the zoom. */
@media (min-width: 1800px) and (min-height: 980px) { #hud { zoom: 1.25; } #hud #stick { zoom: .8; } }
@media (min-width: 2300px) and (min-height: 1300px) { #hud { zoom: 1.5; } #hud #stick { zoom: .6667; } }
.xpbar { position: fixed; left: 0; right: 168px; top: 0; z-index: 1; height: 18px; background: #2a1708; border-bottom: 3px solid #2b1a0e; }
.xpbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#7fd4ff, #2a7fd4); }
.xpbar span { position: absolute; inset: 0; text-align: center; line-height: 14px; text-shadow: var(--ink-outline); }
#topbar { white-space: nowrap;
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  background: var(--wood); border: 3px solid #2b1a0e; border-top: 0; border-radius: 0 0 22px 22px; padding: 4px 18px 6px;
  box-shadow: 0 6px 0 rgba(0,0,0,.28), inset 0 2px 0 var(--wood-light);
}
#topbar b { color: var(--gold); text-shadow: var(--ink-outline); }
#me { position: absolute; left: 10px; top: 28px; display: flex; gap: 8px; align-items: flex-start; }
#portrait canvas { width: 64px; height: 64px; background: var(--parch); border: 3px solid #2b1a0e; border-radius: 10px; display: block; }
.me-bars { width: 220px; }
.slots { display: grid; grid-template-columns: repeat(6, 34px); gap: 3px; margin-top: 4px; }
.slot { position: relative; width: 34px; height: 34px; background: rgba(43, 26, 14, .75); border: 2px solid #2b1a0e; border-radius: 7px; }
.slot.w { background: rgba(110, 63, 28, .85); }
.slot.evo { border-color: var(--gold); box-shadow: 0 0 6px var(--gold); }
.slot.pair { border-color: var(--gold); border-style: dashed; }
.slot.ready { border-color: var(--gold); animation: evo-ready 1s ease-in-out infinite alternate; }
@keyframes evo-ready { from { box-shadow: 0 0 2px var(--gold); } to { box-shadow: 0 0 10px var(--gold); } }
.slot.g { background: rgba(150, 110, 30, .9); border-color: var(--gold); margin: 4px auto 0; }
.slot.g.off canvas { opacity: .4; filter: grayscale(1); }
#portrait .slot canvas { width: 30px; height: 30px; background: none; border: 0; border-radius: 0; }
#portrait { display: flex; flex-direction: column; }
.slot canvas { width: 30px; height: 30px; display: block; }
canvas.mark { width: 1em; height: 1em; vertical-align: -0.15em; image-rendering: pixelated; }
.slot i canvas.mark { width: 18px; height: 18px; }
.slot i { position: absolute; right: 1px; bottom: -3px; color: var(--gold); text-shadow: var(--ink-outline); font-style: normal; line-height: 1; }
.dawn.urgent { color: #ff4a30; animation: dawn-urgent 1s ease-in-out infinite alternate; }
@keyframes dawn-urgent { from { opacity: 1; } to { opacity: .55; } }
.dawn { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); text-shadow: var(--ink-outline); color: var(--muted); white-space: nowrap; }
/* Top, below the own hero's slots: the level-up cards cover the bottom (24.10.2026). */
.bossbar { position: absolute; left: 50%; top: 142px; transform: translateX(-50%); width: min(560px, 90vw); text-align: center; text-shadow: var(--ink-outline); }
.bossbar .bar { height: 26px; }
.banner { position: absolute; top: 200px; left: 50%; transform: translateX(-50%); max-width: 92vw; text-align: center; padding: 6px 16px; background: var(--wood); border: 3px solid #2b1a0e; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.3); color: var(--gold); text-shadow: var(--ink-outline); }

/* Level-up cards: the night goes on while you pick, so they sit low and leave the hero visible. */
.cards { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(820px, 98vw); text-align: center; background: rgba(58, 34, 16, .92); border: 3px solid #2b1a0e; border-radius: 14px; padding: 8px 8px 6px; }
.cards-title { color: var(--gold); text-shadow: var(--ink-outline); }
/* Shield countdown sits above the card box so it never covers a card. */
.cards-count { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 6px; font-size: 64px; line-height: 1; color: var(--gold); text-shadow: var(--ink-outline); pointer-events: none; white-space: nowrap; }
.cards-count.go { font-size: 44px; color: #fff6dc; }
.cards-count.pop { animation: countpop .35s ease-out; }
@keyframes countpop { from { transform: translateX(-50%) scale(1.6); opacity: .3; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.cards-row { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.card { flex: 1 1 0; max-width: 260px; min-width: 0; background: var(--parch); color: var(--ink); border: 3px solid #5a4120; border-radius: 10px; box-shadow: 0 3px 0 #2b1a0e; padding: 6px 8px; cursor: pointer; text-align: left; display: grid; grid-template-columns: 40px 1fr; gap: 4px 8px; align-items: start; }
.card.evo { border-color: var(--gold); background: linear-gradient(#fff3c4, var(--parch)); box-shadow: 0 0 10px var(--gold), 0 3px 0 #2b1a0e; }
.card:hover { border-color: var(--gold); filter: brightness(1.05); }
.card canvas { width: 40px; height: 40px; grid-row: span 2; }
.card .nm { line-height: 1; }
.card .tag { color: #7a2f10; line-height: 1; }
.card .ds { grid-column: span 2; line-height: 1; }
.card .key { color: #8a6a44; }

/* Touch stick */
.stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 3px solid rgba(43, 26, 14, .7); background: rgba(255, 241, 194, .15); }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 212, 58, .7); border: 3px solid #2b1a0e; }

/* End screen */
.stats { margin: 8px auto; border-collapse: collapse; }
.stats td { padding: 2px 12px; text-align: left; }
.stats td + td { text-align: right; color: var(--gold); text-shadow: var(--ink-outline); }
.stats tr.total td { border-top: 2px solid var(--gold); padding-top: 4px; }
.stats tr.total + tr td { padding-top: 10px; }
#end-hint { max-width: 34em; margin: 4px auto 8px; font-size: 0.8em; opacity: 0.8; }
.best { color: var(--gold); text-shadow: var(--ink-outline); }

@media (max-width: 640px) {
  .panel { padding: 14px 10px; }
  .hero-grid { gap: 6px; }
  .hero-card { width: auto; padding: 4px; border-width: 2px; }
  .hero-card canvas { width: 52px; height: 52px; }
  .hero-card .nm { display: none; }
  .cards-row { flex-direction: column; align-items: stretch; }
  .card { max-width: none; }
  .banner { top: 120px; }
}

/* Group play */
.group-box { margin-top: 10px; border-top: 3px solid #2b1a0e; padding-top: 6px; }
.form-row { align-items: center; gap: 6px; }
.form-row label { display: flex; align-items: center; gap: 6px; }
input { font-family: var(--font); font-size: var(--px); background: var(--parch); color: var(--ink); border: 3px solid #5a4120; border-radius: 8px; padding: 3px 8px; width: 9em; user-select: text; -webkit-user-select: text; }
.net-msg { color: var(--gold); text-shadow: var(--ink-outline); }
.link-row input { width: min(420px, 70vw); }
.lobby-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.lobby-entry { display: flex; align-items: center; gap: 6px; background: var(--parch); color: var(--ink); border: 3px solid #5a4120; border-radius: 10px; padding: 4px 6px; text-align: left; }
.lobby-entry canvas { width: 44px; height: 44px; flex: none; }
.lobby-entry .nm { line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-entry .hr { color: #7a2f10; line-height: 1; }
.lobby-entry.empty { opacity: .35; min-height: 58px; }
.small-grid .hero-card { width: auto; padding: 4px; border-width: 2px; }
.small-grid .hero-card canvas { width: 52px; height: 52px; }
.small-grid .hero-card .nm { display: none; }
.team { position: absolute; left: 10px; top: 140px; display: flex; flex-direction: column; gap: 3px; }
.team-entry { display: flex; align-items: center; gap: 6px; text-shadow: var(--ink-outline); line-height: 1; }
.team-entry .bar { width: 70px; height: 12px; border-width: 2px; }
.team-entry.ghost { opacity: .6; }
.buddy { color: #9ccc65; text-shadow: var(--ink-outline); white-space: nowrap; }
#team { display: flex; flex-direction: column; gap: 3px; }
.stats.players td { text-align: left; color: var(--text); }
.stats.players td.num { text-align: right; color: var(--gold); }
@media (max-width: 640px) { #end-title { width: fit-content; margin-left: auto; margin-right: auto; } } /* the scaled title widened the scroll area */
@media (max-width: 640px) { /* the group result table pushed the end screen sideways */
  .stats.players { font-size: .8em; }
  .stats.players td { padding: 2px 4px; }
  .stats.players td:first-child { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
  .team-entry .bar { width: 50px; }
  input { width: 7em; }
}
.lobby-entry > div { min-width: 0; }

/* Chat */
.chat-box { margin: 8px 0; text-align: left; }
.chat-box .chat-log { height: 110px; overflow-y: auto; background: rgba(43, 26, 14, .45); border: 3px solid #2b1a0e; border-radius: 10px; padding: 4px 8px; }
.chat-row { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.chat-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.chat-row .btn { margin: 0; }
.chat-line { line-height: 1.1; text-shadow: var(--ink-outline); word-break: break-word; }
.chat-line b { font-weight: 400; }
.chat-line.sys { color: var(--gold); }
.chat { position: absolute; left: 10px; bottom: 70px; width: min(380px, 70vw); }
.chat .chat-log { display: flex; flex-direction: column; gap: 2px; }
.chat .chat-line.old { display: none; }
.chat .phr-flag { pointer-events: auto; }
.chat-form { pointer-events: auto; background: rgba(58, 34, 16, .92); border: 3px solid #2b1a0e; border-radius: 12px; padding: 6px; margin-top: 4px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-quick .btn { margin: 0; padding: 2px 10px; }
@media (max-width: 640px) {
  .chat { bottom: 12px; width: calc(100vw - 20px); }
  .chat-box .chat-log { height: 80px; }
}

.team-icon { width: 34px; height: 34px; background: var(--parch); border: 3px solid #fff; border-radius: 8px; flex: none; }
.team-entry.ghost .team-icon { filter: grayscale(1); }
.team-col { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) { .team-icon { width: 26px; height: 26px; border-width: 2px; } }

.banner { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) { .banner { top: auto; bottom: 110px; } }
@media (max-width: 640px) { #portrait .slot canvas { width: 20px; height: 20px; } }

.imprint-link a { color: var(--gold, inherit); }

/* Menu = the Puddlehold lobby (client/vendor/puddlehold-lobby, draft C, 04.11.2026). */
#menu { place-items: start center; }
.menu-wrap { width: min(1040px, 100%); display: flex; flex-direction: column; gap: 8px; margin: auto 0; }
.menu-legal { text-align: center; }
.menu-legal .privacy, .menu-legal .imprint-link { display: inline-block; margin: 0 10px; vertical-align: top; }
.menu-daily { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.menu-daily p { margin: 0; line-height: 1.1; }
.lobby-hint { color: var(--muted); margin: 6px 0 2px; }
.daily-toggle { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0 0; cursor: pointer; }
.daily-toggle input { width: 18px; height: 18px; }
.daily-line { margin: 2px 0; color: var(--gold); text-shadow: var(--ink-outline); }
.daily-top { margin: 4px 0 0; padding-left: 22px; }
.daily-top li span { float: right; color: var(--gold); }
.heroes-panel { width: min(1100px, 100%); }
.heroes-panel .hero-grid { grid-template-columns: repeat(10, auto); }
@media (max-width: 640px) { /* 10 columns ran off a phone */
  .heroes-panel .hero-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .heroes-panel .hero-card canvas { width: 100%; max-width: 52px; height: auto; aspect-ratio: 1; }
}
@media (max-height: 520px) { /* landscape phone: compact cards, no names (as on portrait) */
  .hero-grid { gap: 6px; margin: 4px 0; }
  .hero-card { width: auto; padding: 4px; border-width: 2px; }
  .hero-card canvas { width: 48px; height: 48px; }
  .hero-card .nm { display: none; }
  .heroes-panel { padding: 8px 18px; }
  .heroes-panel h2 { font-size: 1em; }
  .heroes-panel .hero-detail { min-height: 0; margin: 4px 0 6px; padding: 6px 10px; }
  .heroes-panel .hero-detail + p { display: none; } /* keyboard hint; no use on a phone */
}
.heroes-panel h2 { margin-top: 0; }

/* Phones, upright and sideways: the level bar leaves the top strip, where it ran into the
   status bar, the menu button and the notch, and sits under the hit points like in Siege. */
@media (max-width: 640px), (max-height: 520px) {
  #hud { --sat: env(safe-area-inset-top, 0px); --sal: env(safe-area-inset-left, 0px); }
  .xpbar { position: relative; left: auto; right: auto; top: auto; z-index: auto; height: 16px; margin-top: 3px;
    border: 2px solid #2b1a0e; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
  .xpbar span { line-height: 12px; font-size: 15px; color: #fff6dc; }
  #topbar { top: var(--sat); gap: 8px; padding: 4px 10px 6px; }
  .dawn { top: calc(38px + var(--sat)); }
  #me { top: calc(62px + var(--sat)); left: calc(10px + var(--sal)); }
  .me-bars { width: 160px; }
  .slots { grid-template-columns: repeat(6, 24px); }
  .slot { width: 24px; height: 24px; }
  .slot canvas { width: 20px; height: 20px; }
  #portrait canvas { width: 44px; height: 44px; }
  .team { top: calc(166px + var(--sat)); left: calc(10px + var(--sal)); }
  .bossbar { top: calc(166px + var(--sat)); }
}
/* Sideways phones are short: the hero block goes to the top, the night clock beside the status bar. */
@media (max-height: 520px) and (min-width: 641px) {
  #me { top: calc(8px + var(--sat)); }
  .dawn { top: calc(38px + var(--sat)); left: auto; right: calc(64px + env(safe-area-inset-right, 0px)); transform: none; }
  .team { top: calc(112px + var(--sat)); }
  .bossbar { top: calc(46px + var(--sat)); }
}

/* Imprint, privacy policy and chat rules stay on screen at the bottom of the menu (11.11.2026);
   the texts live once on puddlehold.com instead of a copy per game. */
/* The three links are buttons with a 44 px tap target (SV-20). */
.menu-legal-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(30, 18, 8, .86); border-top: 2px solid #2b1a0e; }
.menu-legal-bar a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; color: #ffd43a; text-decoration: none; text-shadow: 1px 1px 0 #2b1a0e;
  background: var(--wood); border: 2px solid #5a4120; border-radius: 10px; box-shadow: 0 3px 0 #2b1a0e; }
.menu-legal-bar a:active { transform: translateY(2px); box-shadow: 0 1px 0 #2b1a0e; }
#menu { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }


/* ---- Revision 11.11.2026: phone layout, notes, start errors (SV-11..20, SV-31) ----
   css/style.css is shared with the phone games (same class names), so every rule below is scoped
   to body.survivor and leaves their look alone. */

/* Network notes: one banner above every screen, tap to dismiss (SV-13). */
#net-msg { position: fixed; z-index: 60; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100vw - 24px));
  margin: 0; padding: 8px 16px; text-align: center; background: var(--wood); border: 3px solid #2b1a0e; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.3); cursor: pointer; }
#end-sync { margin: 2px 0 0; color: var(--muted); opacity: .85; }

/* Key hints on the cards only once a keyboard is in use (SV-18). */
body.survivor .card .key { display: none; }
html.kbd body.survivor .card .key { display: inline; }

/* Boss name stays on one line so the bar has a fixed height and the team list can sit below it (SV-11). */
body.survivor #boss-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) and (min-height: 521px) { body.survivor #hud.boss .team { top: 196px; } }

@media (max-width: 640px), (max-height: 520px) {
  /* Messages: as wide as the screen allows, at most two (hud.js) (SV-19). */
  body.survivor .banner { left: 0; right: 0; margin: 0 auto; transform: none; width: max-content; max-width: calc(100vw - 24px); padding: 4px 12px; }
  /* Level-up cards: icon, name, one to three lines of effect; the box stays under half the height (SV-12). */
  body.survivor .cards { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 16px); padding: 4px 6px 3px; }
  body.survivor .cards-title, body.survivor #cards-hint { line-height: 1; }
  body.survivor .cards-row { gap: 5px; margin: 4px 0; }
  body.survivor .card { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0 8px; padding: 4px 8px; }
  body.survivor .card canvas { width: 36px; height: 36px; grid-row: span 2; }
  body.survivor .card .nm { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.survivor .card .tag { grid-column: 3; white-space: nowrap; text-align: right; }
  body.survivor .card .ds { grid-column: 2 / span 2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  body.survivor .cards-row[data-n="4"] .card .ds { -webkit-line-clamp: 1; }
}
@media (max-width: 640px) and (min-height: 760px) {
  body.survivor .cards-row:not([data-n="4"]) .card .ds { -webkit-line-clamp: 3; }
}
@media (max-width: 640px) {
  body.survivor .cards { max-height: 50dvh; }
  /* The team list sits under the boss bar while a boss is up (SV-11). */
  body.survivor .bossbar .bar { height: 22px; }
  body.survivor #hud.boss .team { top: calc(166px + var(--sat) + 50px); }
}

/* Phone sideways: messages at the right under boss bar and night clock instead of on the hero, narrower boss bar (SV-15). */
@media (max-height: 520px) and (min-width: 641px) {
  body.survivor .bossbar { width: clamp(160px, calc(100vw - 520px), 280px); }
  body.survivor .bossbar .bar { height: 20px; }
  body.survivor .banner { left: auto; right: calc(10px + env(safe-area-inset-right, 0px)); margin: 0; top: calc(94px + var(--sat)); max-width: min(300px, 38vw); }
  body.survivor .cards-row .card { max-width: none; }
  body.survivor .card .ds { -webkit-line-clamp: 3; }
}
