/* Ink Strike: everything on screen looks drawn on the same notebook page. */
:root {
  color-scheme: light;
  --paper: #f3eedf;
  --paper-2: #e9e2cd;
  --ink: #1d3690;
  --ink-soft: rgba(29, 54, 144, 0.55);
  --red: #c8302c;
  --rule: rgba(110, 140, 220, 0.35);
  --hand: "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
  --marker: "Permanent Marker", "Patrick Hand", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--hand); }
#view, #view canvas { position: fixed; inset: 0; display: block; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ menu */
.sheet {
  position: fixed; inset: 0; z-index: 20; overflow: auto;
  display: grid; place-items: center; padding: 24px 16px;
  background:
    linear-gradient(90deg, transparent 0 62px, rgba(200, 48, 44, 0.35) 62px 64px, transparent 64px),
    repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px),
    rgba(243, 238, 223, 0.94);
}
.sheet.see-through { background: repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px), rgba(243, 238, 223, 0.82); }
.page { width: min(760px, 100%); padding-left: 56px; position: relative; }
.back { position: absolute; top: -8px; left: 56px; color: var(--ink); font-size: 18px; text-decoration: none; }
.back:hover { text-decoration: underline wavy; }
h1 {
  font-family: var(--marker); font-weight: 400; font-size: clamp(54px, 10vw, 104px); line-height: 1;
  margin: 28px 0 4px; color: var(--ink); transform: rotate(-2deg); letter-spacing: 1px;
  text-shadow: 3px 2px 0 rgba(200, 48, 44, 0.25);
}
.sub { font-size: 24px; margin: 6px 0 22px; }
.sub span { display: block; color: var(--red); }
.big {
  font-family: var(--marker); font-size: 30px; color: var(--paper); background: var(--ink);
  border: none; padding: 12px 30px 10px; cursor: pointer; transform: rotate(-1deg);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 4px 5px 0 rgba(29, 54, 144, 0.25);
}
.big:hover { background: var(--red); }
.big:focus-visible { outline: 3px dashed var(--red); outline-offset: 6px; }
.note { font-size: 20px; min-height: 1em; margin: 14px 0 0; }
.columns { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; margin-top: 22px; font-size: 19px; line-height: 32px; }
.keys { margin: 0; padding: 0; list-style: none; }
.rules p { margin: 0 0 12px; }
kbd {
  font-family: var(--hand); font-size: 17px; padding: 0 6px; border: 1.5px solid var(--ink);
  border-radius: 4px 7px 5px 6px; background: rgba(255, 255, 255, 0.4);
}
.fine { margin-top: 26px; font-size: 16px; color: var(--ink-soft); }
.stats-line { font-size: 22px; }
.stats-line b { font-family: var(--marker); font-weight: 400; color: var(--red); }
@media (max-width: 680px) { .columns { grid-template-columns: 1fr; } .page { padding-left: 24px; } .back { left: 24px; } .sheet { background-size: auto; } }

/* ------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: 22px; }
#hud > * { position: absolute; }
#radar {
  top: 14px; left: 14px; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(243, 238, 223, 0.88); border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 rgba(29, 54, 144, 0.2);
}
#round-box { top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 18px; align-items: baseline; padding: 4px 18px; background: rgba(243, 238, 223, 0.85); border: 2px solid var(--ink); border-radius: 12px 4px 14px 5px; }
#round { font-family: var(--marker); font-size: 20px; }
#timer { font-family: var(--marker); font-size: 30px; min-width: 70px; text-align: center; }
#timer.bomb { color: var(--red); }
#alive { color: var(--red); }
#killfeed { top: 14px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 19px; }
#killfeed div { background: rgba(243, 238, 223, 0.88); padding: 0 10px; border: 1.5px solid var(--ink-soft); border-radius: 6px; animation: feed 5s forwards; }
#killfeed .hs { color: var(--red); }
@keyframes feed { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

#crosshair { left: 50%; top: 50%; width: 0; height: 0; --gap: 6px; }
#crosshair i { position: absolute; background: var(--ink); box-shadow: 0 0 0 1px rgba(243, 238, 223, 0.8); }
#crosshair i:nth-child(1), #crosshair i:nth-child(2) { width: 2px; height: 9px; left: -1px; }
#crosshair i:nth-child(3), #crosshair i:nth-child(4) { height: 2px; width: 9px; top: -1px; }
#crosshair i:nth-child(1) { top: calc(-9px - var(--gap)); }
#crosshair i:nth-child(2) { top: var(--gap); }
#crosshair i:nth-child(3) { left: calc(-9px - var(--gap)); }
#crosshair i:nth-child(4) { left: var(--gap); }
#crosshair.hide { display: none; }
#hitmarker { left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; opacity: 0; transition: opacity .18s; }
#hitmarker::before, #hitmarker::after { content: ""; position: absolute; left: 12px; top: -2px; width: 2.5px; height: 30px; background: var(--red); transform: rotate(45deg); clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%, 0 65%, 100% 65%, 100% 100%, 0 100%); }
#hitmarker::after { transform: rotate(-45deg); }
#hitmarker.on { opacity: 1; transition: none; }
#hitmarker.head::before, #hitmarker.head::after { background: #8a1410; width: 3.5px; }

#damage { inset: 0; position: absolute; }
#damage i { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px; border-top: 6px solid var(--red); border-radius: 50%; animation: hurt 1s forwards; }
@keyframes hurt { from { opacity: 0.9; } to { opacity: 0; } }

#scope { inset: 0; display: none; background: radial-gradient(circle at 50% 50%, transparent 0 min(34vw, 34vh), var(--paper) calc(min(34vw, 34vh) + 1px)); }
#scope::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(68vw, 68vh); height: min(68vw, 68vh); transform: translate(-50%, -50%); border: 4px solid var(--ink); border-radius: 50%; background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat; }
#scope.on { display: block; }

#banner {
  top: 26%; left: 50%; transform: translateX(-50%) rotate(-1.5deg); text-align: center; font-family: var(--marker);
  font-size: clamp(30px, 4.5vw, 52px); color: var(--ink); text-shadow: 2px 2px 0 var(--paper), -2px -2px 0 var(--paper), 2px -2px 0 var(--paper), -2px 2px 0 var(--paper);
  opacity: 0; transition: opacity .4s; white-space: nowrap;
}
#banner small { display: block; font-family: var(--hand); font-size: 0.48em; color: var(--red); }
#banner.on { opacity: 1; }
#banner.red { color: var(--red); }

#progress { left: 50%; top: 60%; transform: translateX(-50%); text-align: center; font-size: 22px; }
#progress b { display: block; width: 260px; height: 16px; border: 2px solid var(--ink); border-radius: 3px 8px 4px 9px; background: var(--paper); margin-top: 4px; overflow: hidden; }
#progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--ink) 0 3px, transparent 3px 7px); }
#hint { left: 50%; bottom: 120px; transform: translateX(-50%); font-size: 22px; background: rgba(243, 238, 223, 0.85); padding: 0 12px; border-radius: 6px; }
#hint:empty { display: none; }

#vitals, #weapon { bottom: 18px; background: rgba(243, 238, 223, 0.88); border: 2.5px solid var(--ink); padding: 2px 16px 0; box-shadow: 3px 3px 0 rgba(29, 54, 144, 0.2); }
#vitals { left: 18px; border-radius: 6px 14px 5px 12px; display: flex; gap: 10px; align-items: baseline; }
#vitals .label { font-size: 20px; }
#health { font-family: var(--marker); font-size: 44px; line-height: 1.1; min-width: 80px; }
#health.low { color: var(--red); }
#weapon { right: 18px; text-align: right; border-radius: 14px 6px 12px 5px; display: grid; }
#weapon-name { font-size: 18px; }
#ammo { font-family: var(--marker); font-size: 40px; line-height: 1.05; }
#ammo small { font-family: var(--hand); font-size: 22px; }
#nades { font-size: 18px; color: var(--red); }
