:root {
  color-scheme: dark;
  --bg: #111522;
  --paper: #f2f4ec;
  --muted: #b0bdd0;
  --line: #465373;
  --acid: #d9f87c;
  --sky: #99f0e3;
  --rose: #ffac9e;
  font-family: Inter, "Avenir Next", system-ui, sans-serif;
  color: var(--paper);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 4px; }
.top { width: min(92%, 1160px); min-height: 71px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid #354158; }
.back { display: inline-flex; gap: 13px; align-items: center; padding: .7rem 0; color: var(--sky); }
.back img { display: block; width: auto; height: 24px; }
.new { background: #202e45; border: 1px solid var(--line); border-radius: 8px; font-size: .81rem; font-weight: 760; padding: 11px 13px; cursor: pointer; }
.new span { margin-left: 6px; color: var(--sky); }
.new:hover, .keys button:hover:not([aria-disabled="true"]) { background: #35425d; }
.layout { width: min(92%, 1160px); min-height: calc(100svh - 71px); margin: auto; display: grid; grid-template-columns: minmax(230px, .81fr) minmax(0, 1.19fr); gap: clamp(26px, 5vw, 76px); align-items: center; padding: clamp(25px, 6vh, 62px) 0; }
.scene { position: relative; overflow: hidden; isolation: isolate; border-radius: 19px; border: 1px solid #465d7c; background: radial-gradient(ellipse at 45% 38%, #2f4669 0%, #1d304d 58%, #16243b 100%); box-shadow: 0 21px 55px #080b166a; }
.scene::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(0deg, #a8e5ee14 0 1px, transparent 1px 22px),repeating-linear-gradient(90deg, #a8e5ee14 0 1px, transparent 1px 22px); mask-image: linear-gradient(#000, #0008); }
.scene canvas { display: block; width: 100%; height: auto; }
h1 { margin: 0; font-family: "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif; font-size: clamp(3.2rem, 8vw, 6.9rem); font-weight: 900; letter-spacing: -.074em; line-height: .92; }
.lead { margin: 13px 0 0; color: var(--muted); font-size: clamp(.85rem, 1.8vw, 1rem); }
.clue { margin: 21px 0 17px; padding: 11px 14px; border: 1px solid #395c6b; border-left: 3px solid var(--sky); border-radius: 7px; background: #1a2c3e; }
.clue span { color: var(--sky); font-size: .69rem; font-weight: 790; letter-spacing: .09em; text-transform: uppercase; }
.clue p { margin: 4px 0 0; line-height: 1.4; }
.word { display: flex; gap: clamp(4px, .9vw, 10px); margin: 0 0 11px; }
.word span { flex: 0 1 55px; min-width: 0; display: grid; place-items: center; height: clamp(36px, 6vw, 59px); border-bottom: 2px solid #89a2c4; background: #202e43; border-radius: 5px 5px 0 0; color: var(--paper); font-size: clamp(1.25rem, 3vw, 2.3rem); font-weight: 830; }
.word span[data-found] { color: var(--acid); border-color: var(--acid); }
.word span[data-answer] { color: var(--rose); border-color: var(--rose); }
.attempts { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); min-height: 23px; font-size: .79rem; }
#pips { display: flex; gap: 6px; }
#pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); }
#pips i.spent { background: transparent; border: 1px solid #7e90b0; }
.keys { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin-top: 13px; }
.keys button { display: grid; place-items: center; min-height: 43px; padding: 0; border: 1px solid #495878; border-bottom-width: 2px; border-radius: 6px; background: #26364d; color: var(--paper); font-weight: 800; cursor: pointer; }
.keys button[data-result="hit"] { background: #294636; color: #d2f8b0; border-color: #5c956c; }
.keys button[data-result="miss"] { background: #2c2935; color: #f2b6ab; border-color: #654e68; }
.keys button[aria-disabled="true"] { cursor: default; }
.keys button[aria-disabled="true"]:not([data-result]) { opacity: .55; }
.message { min-height: 2.7em; margin: 13px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.layout[data-phase="won"] .message { color: var(--acid); }
.layout[data-phase="lost"] .message { color: var(--rose); }
.layout[data-phase]:not([data-phase="playing"]) .message { font-weight: 760; }
@media (max-width: 740px) {
  .layout { grid-template-columns: 1fr; gap: 16px; align-content: start; max-width: 570px; }
  .scene { grid-row: 1; height: clamp(120px, 22svh, 205px); }
  .scene canvas { width: 100%; height: 100%; object-fit: contain; }
  .top { min-height: 59px; }
  .clue { margin-block: 14px 12px; }
  .lead { margin-top: 8px; }
}
@media (max-width: 390px) {
  .layout { width: calc(100% - 24px); padding-block: 16px; }
  .keys { gap: 4px; }
  .keys button { min-height: 40px; }
  .message { margin-top: 8px; }
}
