:root {
  --navy: #15254a;
  --navy-deep: #09152f;
  --navy-soft: #243b70;
  --orange: #f7931b;
  --orange-light: #ffb44f;
  --white: #ffffff;
  --paper: #f5f7fc;
  --ink: #14213d;
  --muted: #61708f;
  --cyan: #43d3ff;
  --green: #38d996;
  --red: #ff5d73;
  --shadow: 0 18px 55px rgba(2, 10, 30, .28);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
  color: var(--white);
  background: var(--navy-deep);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--navy-deep); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(67, 211, 255, .16), transparent 24rem),
    radial-gradient(circle at 85% 28%, rgba(247, 147, 27, .18), transparent 28rem),
    linear-gradient(145deg, #071128 0%, #15254a 50%, #0d1c3b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image:
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ambient span {
  position: absolute;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgba(67, 211, 255, .12);
  border-radius: 38% 62% 57% 43%;
  animation: float 18s linear infinite;
}
.ambient span:nth-child(1) { left: 4%; top: 30%; }
.ambient span:nth-child(2) { right: 7%; top: 58%; animation-delay: -6s; border-color: rgba(247,147,27,.18); }
.ambient span:nth-child(3) { left: 48%; top: 8%; width: 8rem; height: 8rem; animation-delay: -11s; }
@keyframes float { 50% { transform: translateY(-24px) rotate(180deg); } to { transform: rotate(360deg); } }

.site-header {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  border: 0;
  background: var(--white);
  border-radius: 18px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.brand img { display: block; width: clamp(230px, 31vw, 420px); height: 66px; object-fit: contain; }
.header-actions { display: flex; gap: 10px; }
.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 15px;
  background: rgba(255,255,255,.09);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: .2s ease;
}
.icon-button:hover, .icon-button:focus-visible { background: var(--orange); color: var(--navy); transform: translateY(-2px); }

#app { position: relative; z-index: 2; min-height: calc(100vh - 110px); outline: none; }
.page { max-width: 1440px; margin: 0 auto; padding: 22px clamp(18px, 4vw, 58px) 70px; animation: page-in .35s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

.hero-row { display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; align-items: end; margin: 18px 0 34px; }
.eyebrow { margin: 0 0 8px; color: var(--orange-light); text-transform: uppercase; letter-spacing: .16em; font-size: .82rem; font-weight: 900; }
h1, h2, h3 { margin-top: 0; }
h1 { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(2.7rem, 6vw, 6rem); line-height: .95; letter-spacing: -.035em; margin-bottom: 16px; }
.hero-copy { max-width: 760px; margin: 0; font-size: clamp(1rem, 1.5vw, 1.25rem); color: #d7e0f6; line-height: 1.55; }
.event-challenge {
  justify-self: end;
  width: min(100%, 390px);
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--orange), #ffbb56);
  color: var(--navy);
  box-shadow: 0 12px 38px rgba(247,147,27,.26);
  transform: rotate(1.2deg);
}
.event-challenge strong { display: block; font-size: 1.25rem; margin-bottom: 4px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 40px 0 18px; }
.section-heading h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.section-heading p { margin: 0; color: #b9c5e0; }
.game-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.game-grid.support { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.game-card {
  position: relative;
  min-height: 218px;
  padding: 19px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  text-align: left;
  color: white;
  background: linear-gradient(155deg, rgba(255,255,255,.14), rgba(255,255,255,.055));
  box-shadow: 0 12px 38px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  cursor: pointer;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.game-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%, var(--card-colour, rgba(247,147,27,.35)), transparent 42%); opacity: .48; }
.game-card::after { content: "PLAY  →"; position: absolute; right: 18px; bottom: 16px; color: var(--orange-light); font-size: .78rem; font-weight: 900; letter-spacing: .12em; }
.game-card.support-card::after { content: "EXPLORE  →"; }
.game-card:hover, .game-card:focus-visible { transform: translateY(-7px) rotate(-.4deg); border-color: rgba(255,255,255,.48); box-shadow: 0 22px 48px rgba(0,0,0,.3); }
.game-card > * { position: relative; z-index: 1; }
.game-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 19px; background: rgba(5,14,36,.55); font-size: 2rem; margin-bottom: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.game-card h3 { font-size: 1.18rem; margin-bottom: 7px; }
.game-card p { margin: 0; color: #cdd6eb; font-size: .92rem; line-height: 1.4; padding-right: 6px; }
.best-chip { display: inline-block; margin-top: 13px; padding: 5px 9px; border-radius: 99px; background: rgba(4,13,35,.55); color: white; font-size: .74rem; font-weight: 800; }

.home-footer { display: flex; justify-content: center; margin-top: 42px; }
.text-button { border: 0; background: transparent; color: #aebbd7; text-decoration: underline; cursor: pointer; padding: 10px; }
.text-button:hover { color: white; }

.game-page { max-width: 1180px; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 8px 0 20px; }
.back-button { border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.08); color: white; border-radius: 14px; padding: 11px 16px; font-weight: 800; cursor: pointer; }
.back-button:hover { background: rgba(255,255,255,.16); }
.game-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: clamp(1.5rem, 3vw, 2.3rem); }
.game-title span { font-size: 1.8rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.game-stage, .leaderboard-panel {
  background: rgba(249,251,255,.96);
  color: var(--ink);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.game-stage { min-height: 540px; padding: clamp(20px, 4vw, 42px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.leaderboard-panel { padding: 22px; }
.leaderboard-panel h3 { margin-bottom: 16px; }
.leaderboard-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.leaderboard-list li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: #eef2fa; }
.leaderboard-list li:first-child { background: #fff0d9; box-shadow: inset 4px 0 var(--orange); }
.rank { font-weight: 900; color: var(--muted); }
.score-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.score-value { color: var(--navy-soft); font-weight: 900; }
.empty-board { color: var(--muted); line-height: 1.5; }

.button { border: 0; border-radius: 15px; padding: 13px 20px; font-weight: 900; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--orange); color: var(--navy); box-shadow: 0 8px 22px rgba(247,147,27,.28); }
.button-secondary { background: var(--navy); color: white; }
.button-quiet { background: #e7ebf3; color: var(--ink); }
.button-danger { background: var(--red); color: #2b0610; }
.instructions { max-width: 660px; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.metric { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(3rem, 9vw, 7rem); line-height: 1; color: var(--navy); margin: 18px 0; }
.metric small { display: block; margin-top: 10px; font-family: inherit; font-size: .2em; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.status-line { min-height: 28px; font-weight: 800; color: var(--navy-soft); }

.click-target { width: min(420px, 80vw); aspect-ratio: 1.7; border: 0; border-radius: 32px; background: linear-gradient(145deg, var(--orange-light), var(--orange)); color: var(--navy); font-family: "Arial Black", Impact, sans-serif; font-size: clamp(2rem, 6vw, 4.5rem); box-shadow: 0 15px 0 #c56a00, 0 25px 42px rgba(247,147,27,.3); cursor: pointer; user-select: none; }
.click-target:active { transform: translateY(10px); box-shadow: 0 5px 0 #c56a00; }
.click-target[disabled] { filter: grayscale(.7); opacity: .55; cursor: not-allowed; }

.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(62px, 92px)); gap: 12px; }
.memory-card { aspect-ratio: 1; border: 0; border-radius: 16px; background: var(--navy); color: white; font-size: clamp(1.7rem, 5vw, 2.8rem); cursor: pointer; box-shadow: 0 6px 0 #071128; transform-style: preserve-3d; }
.memory-card.revealed, .memory-card.matched { background: white; box-shadow: inset 0 0 0 3px var(--orange); }
.memory-card.matched { background: #ddf9ed; }

.reaction-pad { width: min(680px, 90vw); min-height: 310px; border: 0; border-radius: 30px; display: grid; place-items: center; padding: 25px; font-family: "Arial Black", Impact, sans-serif; font-size: clamp(2rem, 6vw, 4.5rem); color: white; background: var(--navy); cursor: pointer; transition: background .12s ease; }
.reaction-pad.waiting { background: #c33a4c; }
.reaction-pad.ready { background: #159765; }

.simon-grid { display: grid; grid-template-columns: repeat(2, minmax(115px, 190px)); gap: 14px; margin: 22px 0; }
.simon-pad { aspect-ratio: 1; border: 0; border-radius: 28px; cursor: pointer; opacity: .72; box-shadow: inset 0 -10px rgba(0,0,0,.2); transition: .12s ease; }
.simon-pad:nth-child(1) { background: #ff536b; }
.simon-pad:nth-child(2) { background: #3bcf8e; }
.simon-pad:nth-child(3) { background: #ffd04e; }
.simon-pad:nth-child(4) { background: #428bff; }
.simon-pad.active { opacity: 1; transform: scale(.94); filter: brightness(1.35); box-shadow: 0 0 35px currentColor; }

.word-board { display: grid; gap: 7px; margin: 18px 0; }
.word-row { display: grid; grid-template-columns: repeat(5, 54px); gap: 7px; }
.letter-tile { width: 54px; height: 54px; display: grid; place-items: center; border: 2px solid #ccd3e1; border-radius: 9px; font-size: 1.65rem; font-weight: 900; text-transform: uppercase; }
.letter-tile.correct { background: #36ad75; border-color: #36ad75; color: white; }
.letter-tile.present { background: #e7a82d; border-color: #e7a82d; color: white; }
.letter-tile.absent { background: #69758d; border-color: #69758d; color: white; }
.word-input { width: 290px; max-width: 90%; text-transform: uppercase; letter-spacing: .34em; text-align: center; font-size: 1.5rem; font-weight: 900; padding: 13px; border: 2px solid #b8c1d5; border-radius: 14px; }

.typing-quote { max-width: 720px; padding: 22px; border-radius: 18px; background: #edf1f8; text-align: left; font-size: 1.3rem; line-height: 1.7; color: #52617e; }
.typing-input { width: min(720px, 100%); min-height: 120px; resize: none; border: 3px solid #bdc7da; border-radius: 18px; padding: 16px; font-size: 1.1rem; line-height: 1.55; }

.colour-word { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(3.5rem, 10vw, 7.5rem); margin: 20px 0 32px; letter-spacing: .03em; }
.answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(640px, 100%); }
.answer-button { border: 0; border-radius: 14px; padding: 15px 10px; background: var(--navy); color: white; font-weight: 900; cursor: pointer; }
.answer-button:hover { background: var(--orange); color: var(--navy); }

.bug-grid { display: grid; grid-template-columns: repeat(4, minmax(64px, 104px)); gap: 10px; margin: 22px 0; }
.bug-hole { aspect-ratio: 1; border: 0; border-radius: 50%; background: #dce4f1; color: var(--navy); font-size: 2.7rem; cursor: pointer; box-shadow: inset 0 8px 16px rgba(12,28,61,.15); }
.bug-hole.active { background: #fff0d9; animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.65); } }

.card-display { width: 150px; height: 210px; border-radius: 18px; background: white; border: 4px solid var(--navy); display: grid; place-items: center; font-family: Georgia, serif; font-size: 4.8rem; font-weight: 900; box-shadow: 0 15px 35px rgba(21,37,74,.2); margin: 18px; }
.choice-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.lights-grid { display: grid; grid-template-columns: repeat(5, minmax(48px, 74px)); gap: 9px; margin: 22px 0; }
.light-tile { aspect-ratio: 1; border: 0; border-radius: 14px; background: #cbd3e2; cursor: pointer; box-shadow: inset 0 -5px rgba(21,37,74,.12); }
.light-tile.on { background: var(--orange); box-shadow: 0 0 22px rgba(247,147,27,.65), inset 0 -5px rgba(150,80,0,.2); }

.logic-inputs, .logic-outputs { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 18px 0; }
.logic-switch { min-width: 130px; padding: 18px; border: 0; border-radius: 18px; background: #dce3ef; color: var(--navy); font-weight: 900; cursor: pointer; }
.logic-switch.on { background: var(--green); }
.gate-output { min-width: 125px; padding: 18px; border-radius: 18px; color: white; background: var(--red); font-weight: 900; }
.gate-output.on { background: #159765; }
.equation-box { width:min(760px,100%); padding:18px; border-radius:18px; background:#edf1f8; font-size:clamp(.98rem,1.65vw,1.35rem); font-weight:900; line-height:1.45; overflow-wrap:normal; word-break:normal; }
.equation-box p { margin:.45em 0; }
.truth-tables { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.truth-card { padding: 14px; border-radius: 15px; background: #f0f3f9; }
.truth-card table { width: 100%; border-collapse: collapse; }
.truth-card th, .truth-card td { padding: 7px; border-bottom: 1px solid #d5ddea; }
.truth-card tr.active { background: #fff0d9; }

.binary-register { width: min(780px,100%); display:grid; grid-template-columns:repeat(8,1fr); gap:8px; margin:20px 0; }
.bit-column { min-width:0; padding:9px 4px 12px; border:2px solid #c9d2e2; border-radius:15px; background:#e8edf5; color:var(--navy); cursor:pointer; transition:.16s ease; }
.bit-column:hover { transform:translateY(-3px); border-color:var(--orange); }
.bit-column.on { background:var(--orange); border-color:#d87500; box-shadow:0 7px 20px rgba(247,147,27,.28); }
.bit-weight,.bit-power { display:block; font-size:.75rem; font-weight:800; color:#64718a; }
.bit-value { display:block; margin:6px 0; font-family:"Arial Black",Impact,sans-serif; font-size:clamp(1.7rem,4vw,2.7rem); }
.number-readouts { width:min(680px,100%); display:grid; grid-template-columns:2fr 1fr 1fr; gap:10px; margin:5px 0 18px; }
.number-readouts div { padding:14px; border-radius:15px; background:#edf1f8; }
.number-readouts span,.challenge-target span { display:block; color:var(--muted); font-size:.75rem; font-weight:900; text-transform:uppercase; letter-spacing:.12em; }
.number-readouts strong { display:block; margin-top:5px; color:var(--navy); font-family:"Arial Black",Impact,sans-serif; font-size:clamp(1.25rem,3vw,2rem); overflow-wrap:anywhere; }
.equation-box.compact { width:min(680px,100%); padding:15px; margin-bottom:18px; font-size:1.05rem; }
.challenge-target { min-width:220px; padding:17px 28px; border-radius:19px; background:var(--navy); color:white; box-shadow:0 10px 28px rgba(21,37,74,.22); }
.challenge-target strong { display:block; margin-top:3px; color:var(--orange-light); font-family:"Arial Black",Impact,sans-serif; font-size:3rem; }
.binary-live { margin:4px 0; font-size:1.2rem; color:var(--muted); }
.binary-live strong { color:var(--navy); font-size:1.8rem; }
.challenge-progress { padding:9px 14px; border-radius:99px; background:#edf1f8; color:var(--navy-soft); font-weight:900; margin-bottom:14px; }

.algorithm-controls,.flow-inputs { display:flex; flex-wrap:wrap; align-items:end; justify-content:center; gap:12px; margin-bottom:18px; }
.algorithm-controls select,.flow-inputs select,.flow-inputs input { min-height:46px; border:2px solid #bdc7da; border-radius:12px; background:white; padding:9px 12px; color:var(--navy); font-weight:800; }
.array-bars { width:min(720px,100%); min-height:120px; display:flex; justify-content:center; align-items:flex-end; gap:9px; margin:18px 0; }
.array-item { width:70px; min-height:82px; display:grid; place-items:center; align-content:center; border-radius:15px; background:#dfe6f1; border:3px solid transparent; transition:.25s ease; }
.array-item strong { font-size:1.45rem; color:var(--navy); }
.array-item span { margin-top:6px; color:var(--muted); font-size:.7rem; }
.array-item.active { background:#fff0d9; border-color:var(--orange); transform:translateY(-7px); }
.array-item.sorted { background:#daf5e9; }
.array-item.found { background:var(--green); border-color:#16845e; }
.algorithm-message { width:min(720px,100%); min-height:58px; display:grid; place-items:center; padding:13px 18px; border-radius:15px; background:#edf1f8; color:var(--navy); font-weight:900; margin:8px 0 16px; }
.pseudocode { width:min(720px,100%); margin:0 0 18px; padding:14px; border-radius:14px; background:#101d3b; color:#dbe6ff; text-align:left; white-space:pre-wrap; line-height:1.8; }
.pseudocode span { display:block; padding:2px 8px; border-left:3px solid transparent; }
.pseudocode span.active { background:rgba(247,147,27,.18); border-color:var(--orange); color:white; }

.code-palette,.current-code { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:12px 0; }
.code-symbol,.code-chip,.code-slot { width:54px; height:54px; display:grid; place-items:center; border-radius:50%; border:0; font-size:1.45rem; font-weight:900; }
.code-symbol { cursor:pointer; box-shadow:0 6px 0 rgba(0,0,0,.22); }
.code-symbol:active { transform:translateY(4px); box-shadow:0 2px 0 rgba(0,0,0,.22); }
.code-slot { background:#e5eaf2; color:#8e99ad; border:2px dashed #abb6c9; }
.symbol-0 { background:#ff5d73; color:#63111e; }.symbol-1 { background:#43d3ff; color:#0c4860; }.symbol-2 { background:#ffd04e; color:#5e4700; }.symbol-3 { background:#38d996; color:#0c5138; }.symbol-4 { background:#9766ff; color:white; }.symbol-5 { background:#f7931b; color:#543000; }
.code-history { width:min(680px,100%); display:grid; gap:7px; margin-top:12px; }
.code-attempt { display:grid; grid-template-columns:30px 1fr auto; align-items:center; gap:10px; padding:8px 12px; border-radius:14px; background:#edf1f8; }
.attempt-number { font-weight:900; color:var(--muted); }.attempt-code { display:flex; gap:5px; }.attempt-code .code-chip { width:34px; height:34px; font-size:.95rem; }
.feedback { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }.feedback b { padding:5px 8px; border-radius:99px; font-size:.73rem; }.feedback .exact { background:#d8f4e8; color:#116744; }.feedback .misplaced { background:#fff0d9; color:#854b00; }

.flow-inputs label { display:grid; gap:5px; color:var(--muted); font-size:.78rem; font-weight:900; text-align:left; text-transform:uppercase; letter-spacing:.08em; }
.attempts-badge,.flow-trace-progress { padding:10px 14px; border-radius:99px; background:#edf1f8; color:var(--navy-soft); font-weight:900; }
.flow-trace-progress { margin:-6px 0 15px; font-size:.86rem; }
.flowchart { width:min(700px,100%); display:grid; justify-items:center; color:var(--navy); }
.flow-node { width:min(300px,85%); padding:10px 15px; border:3px solid #9eabc1; background:white; font-weight:900; transition:.2s ease; }
.flow-node.terminator { border-radius:99px; }.flow-node.process { border-radius:8px; }.flow-node.decision { width:235px; padding:18px 12px; border-radius:8px; transform:skew(-8deg); }.flow-node.output { border-radius:8px 24px 8px 24px; }.flow-node.loop { border-radius:8px; border-style:dashed; color:#59408e; }
.flow-node.active { border-color:var(--orange); background:#fff0d9; box-shadow:0 0 0 6px rgba(247,147,27,.17); transform:scale(1.04); }.flow-node.decision.active { transform:skew(-8deg) scale(1.04); }.flow-node.visited { border-color:#38b780; background:#e4f7ef; }
.flow-arrow { color:#71809a; font-weight:900; line-height:1.1; }.flow-branches,.flow-outcomes { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:18px; }.flow-branches span { color:var(--muted); font-size:.78rem; font-weight:900; }.flow-outcomes .flow-node { width:100%; }

.score-dialog { width: min(92vw, 480px); border: 0; border-radius: 26px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.48); }
.score-dialog::backdrop { background: rgba(4,11,27,.78); backdrop-filter: blur(6px); }
.score-dialog form { padding: 34px; position: relative; overflow: hidden; }
.dialog-burst { position: absolute; right: -15px; top: -28px; color: #fff0d9; font-size: 9rem; transform: rotate(14deg); z-index: -1; }
.score-dialog label { display: block; font-weight: 900; margin-top: 20px; }
.score-dialog input { width: 100%; margin-top: 8px; padding: 13px 14px; border: 2px solid #b8c1d5; border-radius: 13px; font-size: 1.1rem; }
.score-summary { font-size: 1.15rem; color: var(--navy-soft); font-weight: 800; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: .86rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 13px; background: #071128; color: white; box-shadow: var(--shadow); transition: .25s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 18px; background: var(--orange); animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

.attract-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(circle, #203a70, #071128 70%); cursor: pointer; }
.attract-screen[hidden] { display: none; }
.attract-content img { width: min(680px, 80vw); max-height: 180px; object-fit: contain; background: white; border-radius: 24px; padding: 14px; }
.attract-content h2 { font-family: "Arial Black", Impact, sans-serif; font-size: clamp(2.5rem, 7vw, 6rem); max-width: 900px; line-height: 1; margin: 28px auto 14px; }
.attract-content p { font-size: 1.25rem; }
.attract-icons { display: flex; justify-content: center; gap: 24px; margin-top: 32px; font-size: 3rem; }
.attract-icons span { animation: bounce 1.4s ease-in-out infinite; }
.attract-icons span:nth-child(2) { animation-delay: .15s; }
.attract-icons span:nth-child(3) { animation-delay: .3s; }
.attract-icons span:nth-child(4) { animation-delay: .45s; }
@keyframes bounce { 50% { transform: translateY(-14px); } }

@media (max-width: 1120px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  .hero-row, .game-layout { grid-template-columns: 1fr; }
  .event-challenge { justify-self: start; }
  .leaderboard-panel { order: 2; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-grid.support { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 580px) {
  .site-header { align-items: stretch; }
  .brand { flex: 1; min-width: 0; padding: 6px 8px; }
  .brand img { width: 100%; height: 52px; }
  .icon-button { width: 42px; height: 42px; }
  .header-actions { align-items: center; }
  h1 { font-size: 2.75rem; }
  .game-grid, .game-grid.support { grid-template-columns: 1fr; }
  .game-card { min-height: 178px; }
  .game-stage { min-height: 470px; padding: 18px; }
  .game-topbar { align-items: flex-start; }
  .game-title { font-size: 1.35rem; }
  .memory-grid { grid-template-columns: repeat(4, minmax(54px, 72px)); }
  .word-row { grid-template-columns: repeat(5, 46px); }
  .letter-tile { width: 46px; height: 46px; }
  .bug-grid { grid-template-columns: repeat(4, minmax(52px, 75px)); }
  .truth-tables { grid-template-columns: 1fr; }
  .binary-register { gap:4px; }.bit-weight,.bit-power { font-size:.62rem; }.bit-column { padding-inline:2px; }
  .number-readouts { grid-template-columns:1fr; }
  .array-bars { gap:4px; }.array-item { width:43px; min-height:68px; }
  .code-attempt { grid-template-columns:24px 1fr; }.feedback { grid-column:2; justify-content:flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
