* { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    background:
      radial-gradient(ellipse 640px 620px at 50% 40%, rgba(255,244,224,0.16), rgba(255,244,224,0) 72%),
      radial-gradient(ellipse 90% 85% at 50% 50%, rgba(0,0,0,0) 55%, rgba(40,20,8,0.22) 100%),
      repeating-conic-gradient(#e8b98a 0% 25%, #dfa878 0% 50%) 0 0 / 48px 48px;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100%;
  }
  #wrap {
    display: flex;
    align-items: flex-start;
    gap: 18px;
  }
  /* metal pipe frame: brushed sheen + 4 corner rivets, layered as
     background-image on the static frame element (no per-frame cost) */
  #frame {
    position: relative;
    padding: 10px;
    border: 3px solid #4a4a4a;
    border-radius: 6px;
    background-color: #b0b0b0;
    background-repeat: no-repeat;
    background-image:
      radial-gradient(circle at 32% 32%, #ffffff 0%, #d4d4d4 28%, #787878 62%, rgba(90,90,90,0) 82%),
      radial-gradient(circle at 32% 32%, #ffffff 0%, #d4d4d4 28%, #787878 62%, rgba(90,90,90,0) 82%),
      radial-gradient(circle at 32% 32%, #ffffff 0%, #d4d4d4 28%, #787878 62%, rgba(90,90,90,0) 82%),
      radial-gradient(circle at 32% 32%, #ffffff 0%, #d4d4d4 28%, #787878 62%, rgba(90,90,90,0) 82%),
      linear-gradient(115deg, rgba(255,255,255,0) 28%, rgba(255,255,255,0.45) 41%, rgba(255,255,255,0) 55%),
      linear-gradient(180deg, #e4e4e4, #9a9a9a);
    background-position:
      2px 2px,
      right 2px top 2px,
      2px bottom 2px,
      right 2px bottom 2px,
      0 0,
      0 0;
    background-size:
      7px 7px, 7px 7px, 7px 7px, 7px 7px,
      100% 100%, 100% 100%;
    box-shadow:
      inset 0 0 0 2px #efefef,
      inset 0 0 0 4px #8f8f8f,
      4px 4px 0 rgba(0,0,0,0.25);
  }
  #overlay {
    position: absolute;
    left: 10px; right: 10px; top: 10px; bottom: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 6, 4, 0.7);
    text-align: center;
    letter-spacing: 1px;
  }
  /* bordered plaque: same hard-border + offset-shadow language as the side panel boxes */
  #overlay .plaque {
    background: #fdfdf6;
    color: #1a1a1a;
    border: 3px solid #2b2b2b;
    box-shadow:
      inset 0 0 0 2px rgba(0,0,0,0.06),
      5px 5px 0 rgba(0,0,0,0.4);
    padding: 22px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 18px;
  }
  #overlay .big { font-size: 28px; letter-spacing: 4px; }
  #overlay .dim { font-size: 12px; opacity: 0.65; letter-spacing: 2px; }
  #popups {
    position: absolute;
    left: 10px; right: 10px; top: 10px; bottom: 10px;
    overflow: hidden;
    pointer-events: none;
  }
  .popup {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #fdfdf6;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.7), -1px -1px 0 rgba(0,0,0,0.5);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
    animation: popupFloat 700ms ease-out forwards;
  }
  .popup.combo { color: #f7c05e; font-size: 15px; }
  @keyframes popupFloat {
    0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
    20%  { opacity: 1; transform: translate(-50%, -60%) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -130%) scale(1); }
  }
  @media (prefers-reduced-motion: reduce) {
    .popup { animation: popupFadeOnly 700ms ease-out forwards; }
  }
  @keyframes popupFadeOnly {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
  }
  #game {
    display: block;
    width: 320px;
    height: 640px;
    image-rendering: pixelated;
    background: #0a0a0a;
    border: 3px solid #333;
  }
  #panel {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
  }
  .box {
    background: #fdfdf6;
    border: 3px solid #2b2b2b;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    padding: 8px;
  }
  .box .label {
    font-size: 11px;
    letter-spacing: 2px;
    color: #8a8a8a;
    margin-bottom: 6px;
  }
  .box canvas {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto;
    image-rendering: pixelated;
    background: #0a0a0a;
    border: 2px solid #2b2b2b;
  }
  .stat { font-size: 17px; line-height: 1.2; }
  .stat .small {
    font-size: 11px;
    letter-spacing: 2px;
    color: #8a8a8a;
  }
  /* score is the hero stat: bigger value, warm accent label, heavier border */
  .box.hero {
    border-width: 4px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    padding: 9px 8px 11px;
  }
  .box.hero .small { color: #b4790f; letter-spacing: 3px; }
  .box.hero #score { font-size: 32px; letter-spacing: 0.5px; }
  #previewRow { display: flex; gap: 12px; }
  #previewRow .box { flex: 1; }
  #previewRow canvas { width: 60px; height: 60px; }
  #legend {
    font-size: 12px;
    background: rgba(253,253,246,0.9);
    border: 2px solid #2b2b2b;
    padding: 6px 14px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    max-width: 544px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
  }
  #legend .li { white-space: nowrap; }
  #legend .li:not(:last-child)::after {
    content: "\00b7";
    margin: 0 8px;
    opacity: 0.5;
  }
  #game { touch-action: none; }
  #overlay { touch-action: none; }
  /* touch bar + touch legend: hidden on desktop, shown for coarse pointers
     and narrow layouts */
  #touchbar {
    display: none;
    gap: 10px;
  }
  .tbtn {
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    color: #1a1a1a;
    background: #fdfdf6;
    border: 3px solid #2b2b2b;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    padding: 9px 12px;
    touch-action: manipulation;
  }
  .tbtn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.25);
  }
  #legendTouch { display: none; }
  @media (pointer: coarse), (max-width: 620px) {
    #touchbar { display: flex; }
    #legend { display: none; }
    #legendTouch {
      display: block;
      font-size: 11px;
      text-align: center;
      background: rgba(253,253,246,0.9);
      border: 2px solid #2b2b2b;
      padding: 4px 10px;
      box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
      max-width: calc(100vw - 20px);
    }
    #touchbar {
      flex-wrap: wrap;
      justify-content: center;
      max-width: calc(100vw - 12px);
    }
  }
  /* portrait / narrow: compact HUD below the field, buttons at thumb reach */
  @media (max-width: 620px) {
    body {
      justify-content: flex-start;
      padding: 10px 0 16px;
      gap: 8px;
    }
    #wrap {
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    #game {
      width: min(calc((100svh - 300px) / 2), calc(100vw - 64px), 320px);
      height: auto;
      aspect-ratio: 1 / 2;
    }
    #panel {
      width: min(calc(100vw - 24px), 346px);
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      padding-top: 0;
    }
    #panel .box { min-width: 0; overflow: hidden; }
    #panel > .box:last-child { grid-column: span 2; }
    #previewRow {
      grid-column: span 2;
      gap: 6px;
      min-width: 0;
    }
    #previewRow canvas { width: 44px; height: 44px; }
    .box { padding: 5px 6px; }
    .box .label { font-size: 9px; margin-bottom: 3px; }
    .stat { font-size: 13px; line-height: 1.15; }
    .stat .small { font-size: 9px; letter-spacing: 1px; }
    .box.hero { grid-column: span 2; padding: 6px 8px; }
    .box.hero #score { font-size: 22px; }
  }

/* --- anul.space site chrome (added by build-site.mjs) --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px 0;
}
.hub-back {
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  font-size: 14px;
  color: #1a1a1a;
  text-decoration: none;
  background: #fdfdf6;
  border: 3px solid #2b2b2b;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
  padding: 6px 12px;
}
.hub-back:hover { background: #ffe9b3; }
.wordmark {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  letter-spacing: 6px;
  color: #1a1a1a;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}
@media (max-width: 620px) {
  .topbar { padding-top: 2px; gap: 10px; }
  .wordmark { font-size: 17px; letter-spacing: 4px; }
  /* the topbar costs ~44px of height: shrink the field budget to match */
  #game { width: min(calc((100svh - 344px) / 2), calc(100vw - 64px), 320px); }
}
