:root {
  --page-bg: #0B2A3A;
  --page-bg-2: #12475A;
  --surface: #103746;
  --surface-strong: #0D3140;
  --cream: #FFF7E8;
  --aqua: #59E1D2;
  --coral: #FF7D68;
  --mango: #FFC857;
  --mint: #B8F0D6;
  --bg: #07120f;
  --panel: rgba(7, 18, 24, 0.86);
  --border: rgba(255, 255, 255, 0.16);
  --line: rgba(124, 255, 188, 0.24);
  --line-soft: rgba(124, 255, 188, 0.12);
  --text: #edfdf4;
  --muted: #BFD8DC;
  --accent: #75f0a7;
  --accent-strong: #41d884;
  --danger: #ff6d6d;
  --brush-color: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255,200,87,.13), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(255,125,104,.10), transparent 30%),
    linear-gradient(145deg, #0B2A3A, #12475A);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.camo-site-header {
  width: min(100% - 48px, 1440px);
  margin: 0 auto;
  padding: 8px 0 2px;
  color: var(--cream);
}
.camo-site-header-inner {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 247, 232, 0.12);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(7, 19, 25, 0.72);
}
.camo-site-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--cream);
  text-decoration: none;
}
.camo-site-brand-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.24));
}
.camo-site-brand-words {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.camo-site-brand-words strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  line-height: 0.84;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.camo-site-brand-words span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 5px;
  padding: 3px 6px;
  background: var(--accent);
  color: #071411;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}
.camo-site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.camo-site-nav a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(255, 247, 232, 0.12);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.camo-site-brand:hover,
.camo-site-brand:focus-visible,
.camo-site-nav a:hover,
.camo-site-nav a:focus-visible {
  color: var(--aqua);
  outline: 2px solid rgba(89, 225, 210, 0.44);
  outline-offset: 3px;
}
body.is-playing .camo-site-header { display: none; }

.app-shell { width: min(100% - 48px, 1440px); margin: 0 auto; padding-bottom: 34px; }
.home-view { position: relative; isolation: isolate; padding-bottom: 54px; color: var(--cream); }
.home-view::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 247, 232, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 34%, rgba(89, 225, 210, 0.08) 0 3px, transparent 4px);
  background-size: 110px 110px, 160px 160px;
}
.hero { padding-top: 28px; }
.event-hero {
  display: block; min-height: 0; padding-bottom: 14px;
}
.hero-copy { max-width: 1120px; }
.hero-kicker-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.eyebrow { margin: 0 0 8px; color: var(--aqua); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-kicker-row .eyebrow { margin: 0; color: var(--mango); }
.live-chip {
  display: inline-flex; align-items: center; min-height: 30px; border: 1px solid rgba(89, 225, 210, 0.44); border-radius: 999px; padding: 7px 11px;
  background: rgba(89, 225, 210, 0.12); color: var(--mint); font-size: 0.74rem; font-weight: 950; letter-spacing: 0.06em; text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
.hero h1 {
  max-width: 1000px; margin-bottom: 12px; overflow-wrap: anywhere; color: var(--cream);
  font-size: clamp(44px, 6vw, 78px); line-height: 0.94; letter-spacing: -0.04em; text-shadow: 0 14px 36px rgba(4, 18, 25, 0.34);
}
.hero h1 span { color: var(--aqua); text-shadow: 0 0 30px rgba(89, 225, 210, 0.2); }
.subtitle { max-width: 760px; margin-bottom: 7px; color: var(--cream); font-size: clamp(1rem, 1.7vw, 1.24rem); line-height: 1.35; font-weight: 760; }
.winner-hook { max-width: 760px; margin-bottom: 0; color: var(--mint); font-size: 0.94rem; line-height: 1.38; }
.event-status-pills { display: flex; max-width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.event-status-pills span {
  display: inline-flex; min-height: 36px; align-items: center; border: 1px solid rgba(255, 247, 232, 0.18); border-radius: 999px; padding: 8px 12px;
  background: rgba(16, 55, 70, 0.64); color: var(--cream); font-size: 0.74rem; font-weight: 950; letter-spacing: 0.055em; text-transform: uppercase;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}
.event-status-pills span:nth-child(1) { border-color: rgba(89, 225, 210, 0.45); color: var(--aqua); }
.event-status-pills span:nth-child(2) { border-color: rgba(255, 200, 87, 0.46); color: var(--mango); }
.event-status-pills span:nth-child(3) { border-color: rgba(255, 125, 104, 0.46); color: #ffb0a2; }
.mission-flow { margin-top: 10px; }
.week-panel { margin-top: 18px; }
.weekly-timeline, .weekly-inspiration { margin-top: clamp(36px, 5vw, 64px); }
.section-heading { margin-bottom: 22px; }
.compact-heading { max-width: 780px; }
.section-heading h2 { margin: 0 0 8px; color: var(--cream); font-size: clamp(38px, 4vw, 58px); line-height: 1; letter-spacing: -0.035em; }
.section-subtitle { max-width: 660px; margin: 0; color: var(--muted); line-height: 1.55; }
.mission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mission-card {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px 10px; align-items: start; min-height: 0; border: 1px solid rgba(255, 247, 232, 0.14); border-radius: 8px; padding: 12px 14px;
  background: linear-gradient(180deg, rgba(16, 55, 70, 0.82), rgba(13, 49, 64, 0.92)); box-shadow: 0 16px 44px rgba(4, 18, 25, 0.18);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.mission-card:hover { transform: translateY(-3px); border-color: currentColor; box-shadow: 0 20px 54px rgba(4, 18, 25, 0.24); }
.mission-card-aqua { color: var(--aqua); }
.mission-card-coral { color: var(--coral); }
.mission-card-mango { color: var(--mango); }
.mission-icon { display: none; }
.mission-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mission-card span { color: currentColor; font-size: 1.45rem; font-weight: 950; line-height: 1; opacity: 0.95; }
.mission-card h3 { margin: 2px 0 0; color: var(--cream); font-size: 0.92rem; letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; }
.mission-card p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.32; }
.challenge-grid { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; max-width: 1280px; margin-left: 0; margin-right: auto; }
.challenge-card {
  --card-accent: var(--aqua);
  position: relative; display: flex; min-height: 390px; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(89, 225, 210, 0.24); border-radius: 8px; background: linear-gradient(180deg, rgba(16, 55, 70, 0.95), rgba(13, 49, 64, 0.98));
  box-shadow: 0 22px 60px rgba(4, 18, 25, 0.25); transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.challenge-card,
.challenge-card:visited { color: inherit; text-decoration: none; }
.challenge-card::before { content: ""; display: block; height: 4px; flex: 0 0 auto; background: linear-gradient(90deg, transparent, var(--card-accent), transparent); opacity: 0.88; }
.challenge-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--card-accent) 76%, white 0%); box-shadow: 0 28px 70px rgba(4, 18, 25, 0.34), 0 0 22px color-mix(in srgb, var(--card-accent) 18%, transparent); }
.challenge-card.is-clickable { cursor: pointer; }
.challenge-card.is-clickable:focus-visible { border-color: var(--card-accent); outline: 3px solid color-mix(in srgb, var(--card-accent) 34%, transparent); outline-offset: 3px; }
.challenge-card.is-clickable:active { transform: translateY(-1px); }
.challenge-card.disabled { opacity: 0.78; }
.challenge-aqua { --card-accent: var(--aqua); }
.challenge-coral { --card-accent: var(--coral); border-color: rgba(255, 125, 104, 0.28); }
.card-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0f3b4c; }
.card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.challenge-card:hover .card-image img { transform: scale(1.035); }
.coming-soon-art {
  display: grid; width: 100%; height: 100%; place-items: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 125, 104, 0.12) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, #0f3b4c, #123345);
  color: #ffb0a2; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
}
.card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 15px 16px 16px; }
.card-identity { margin: 0; color: var(--card-accent); font-size: 0.7rem; font-weight: 950; letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; }
.card-body .eyebrow { margin: 0; color: var(--muted); font-size: 0.68rem; }
.card-body h3 { margin: 0; color: var(--cream); font-size: 1.42rem; line-height: 1.08; }
.card-description { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.32; }
.card-facts { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.pill { display: inline-flex; min-height: 26px; align-items: center; border: 1px solid rgba(255, 247, 232, 0.14); border-radius: 999px; padding: 5px 9px; background: rgba(255, 255, 255, 0.055); color: var(--cream); font-size: 0.68rem; font-weight: 900; line-height: 1; text-transform: uppercase; }
.card-facts .pill:nth-child(1) { border-color: color-mix(in srgb, var(--card-accent) 52%, transparent); background: color-mix(in srgb, var(--card-accent) 13%, transparent); color: var(--card-accent); }
.card-facts .pill:nth-child(2) { border-color: rgba(255, 247, 232, 0.16); background: rgba(255, 255, 255, 0.055); color: var(--muted); }
.card-facts .pill:nth-child(3) { border-color: rgba(255, 200, 87, 0.42); background: rgba(255, 200, 87, 0.12); color: var(--mango); }
.card-body .play-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; margin-top: auto; width: 100%; }
.challenge-aqua .play-button:not(:disabled) { border-color: rgba(89, 225, 210, 0.72); background: linear-gradient(180deg, var(--aqua), #35c7ba); color: #082938; }
.challenge-coral .play-button:not(:disabled) { border-color: rgba(255, 125, 104, 0.72); background: linear-gradient(180deg, var(--coral), #ff6a53); color: #32130f; }
.challenge-coral .play-button:disabled { border-color: rgba(255, 125, 104, 0.28); background: rgba(255, 125, 104, 0.12); color: #ffb0a2; opacity: 1; }
.weekly-timeline { padding-bottom: 12px; }
.weekly-timeline .section-heading h2 { font-size: clamp(30px, 3.2vw, 46px); }
.timeline-list {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none;
  border: 1px solid rgba(255, 247, 232, 0.14); border-radius: 8px; background: rgba(16, 55, 70, 0.64); overflow: hidden;
}
.timeline-list li { position: relative; min-width: 0; padding: 24px 18px 18px; }
.timeline-list li + li { border-left: 1px solid rgba(255, 247, 232, 0.12); }
.timeline-list span { display: block; width: 14px; height: 14px; margin-bottom: 14px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 6px rgba(89, 225, 210, 0.12); }
.timeline-list li:nth-child(2) span { background: var(--coral); box-shadow: 0 0 0 6px rgba(255, 125, 104, 0.12); }
.timeline-list li:nth-child(3) span { background: var(--mango); box-shadow: 0 0 0 6px rgba(255, 200, 87, 0.12); }
.timeline-list li:nth-child(4) span { background: var(--mint); box-shadow: 0 0 0 6px rgba(184, 240, 214, 0.12); }
.timeline-list strong { display: block; margin-bottom: 7px; color: var(--cream); font-size: 0.84rem; font-weight: 950; letter-spacing: 0.07em; text-transform: uppercase; }
.timeline-list p { margin: 0; color: var(--muted); line-height: 1.42; }
.weekly-inspiration { padding-bottom: 10px; }
.weekly-inspiration .section-heading h2 { font-size: clamp(30px, 3.2vw, 46px); }
.inspiration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.inspiration-card {
  position: relative; display: grid; min-height: 260px; align-content: start; overflow: hidden; border: 1px solid rgba(255, 247, 232, 0.14); border-radius: 8px; padding: clamp(18px, 2.5vw, 26px);
  background: linear-gradient(180deg, rgba(16, 55, 70, 0.82), rgba(13, 49, 64, 0.92)); box-shadow: 0 22px 60px rgba(4, 18, 25, 0.22);
}
.inspiration-card h3 { position: relative; margin: 0 0 12px; color: var(--cream); font-size: clamp(1.35rem, 2.2vw, 2rem); line-height: 1.04; }
.inspiration-card p { position: relative; margin: 0; color: var(--muted); line-height: 1.55; }
.inspiration-card .eyebrow { position: relative; margin-bottom: 12px; }
.inspiration-mark { position: absolute; inset: auto 18px 18px auto; width: 118px; height: 118px; opacity: 0.28; pointer-events: none; }
.inspiration-avocado { border-color: rgba(89, 225, 210, 0.34); }
.inspiration-avocado .eyebrow { color: var(--aqua); }
.inspiration-avocado .inspiration-mark {
  border: 2px solid rgba(89, 225, 210, 0.64); border-radius: 24% 76% 30% 70% / 60% 32% 68% 40%;
  background:
    radial-gradient(ellipse at 54% 56%, rgba(255, 200, 87, 0.82) 0 9px, rgba(255, 200, 87, 0.08) 10px, transparent 18px),
    radial-gradient(ellipse at 50% 50%, rgba(184, 240, 214, 0.74) 0 34px, rgba(89, 225, 210, 0.34) 35px, transparent 58px);
  box-shadow: -24px -16px 0 -18px rgba(184, 240, 214, 0.82), 0 0 28px rgba(89, 225, 210, 0.22);
}
.inspiration-chocolate { border-color: rgba(255, 125, 104, 0.34); }
.inspiration-chocolate .eyebrow { color: var(--coral); }
.inspiration-chocolate .inspiration-mark {
  background:
    radial-gradient(ellipse at 52% 25%, rgba(255, 247, 232, 0.68) 0 18px, transparent 20px),
    linear-gradient(135deg, rgba(255, 200, 87, 0.68), rgba(255, 125, 104, 0.44) 42%, rgba(91, 47, 31, 0.92) 43% 62%, rgba(255, 247, 232, 0.52) 63% 74%, rgba(91, 47, 31, 0.86) 75%);
  border-radius: 44% 56% 48% 52% / 38% 42% 58% 62%;
  transform: rotate(8deg);
  box-shadow: 0 0 24px rgba(255, 125, 104, 0.18);
}

.play-button, .finish-button, .tool-button, .ghost-button, .size-button, .secondary-button, .icon-button, .hex-display {
  border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.06); transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.play-button, .finish-button { min-height: 44px; padding: 10px 15px; border-color: rgba(117, 240, 167, 0.62); background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #06100d; font-weight: 900; }
.home-view .play-button { border-color: rgba(255, 200, 87, 0.68); background: linear-gradient(180deg, var(--mango), #ffae4f); color: #0d3140; }
.tool-button, .ghost-button, .size-button, .secondary-button, .icon-button { min-height: 38px; padding: 8px 11px; }
.icon-button { width: 38px; padding: 0; font-weight: 900; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
.tool-button.active, .size-button.active { border-color: var(--accent); background: rgba(117, 240, 167, 0.18); }
.play-button:not(:disabled):hover, .finish-button:not(:disabled):hover, .tool-button:not(:disabled):hover, .ghost-button:hover, .size-button:not(:disabled):hover, .secondary-button:not(:disabled):hover, .icon-button:hover,
.play-button:not(:disabled):focus-visible, .finish-button:not(:disabled):focus-visible, .tool-button:not(:disabled):focus-visible, .ghost-button:focus-visible, .size-button:not(:disabled):focus-visible, .secondary-button:not(:disabled):focus-visible, .icon-button:focus-visible {
  transform: translateY(-1px); border-color: var(--accent); outline: 2px solid rgba(117, 240, 167, 0.28); outline-offset: 2px;
}

.game-view { position: relative; min-height: calc(100vh - 68px); }
.game-topbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 12px;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; background: rgba(7, 18, 15, 0.62);
}
.game-title-block { min-width: 0; }
.game-title-block h2 { margin: 0; font-size: clamp(1.45rem, 2.8vw, 2.25rem); line-height: 1.02; }
.game-title-block p { margin: 0 0 3px; }
.hud-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.phase-stack { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.hud-controls .icon-button { min-height: 39px; height: 39px; }
.phase-display, .timer {
  display: inline-flex; min-width: 86px; min-height: 39px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  background: rgba(7, 18, 15, 0.82); color: var(--accent); font-weight: 900; text-align: center;
}
.phase-display { min-width: 68px; color: #ffd29a; font-size: 0.78rem; letter-spacing: 0.04em; }
.timer { font-size: 1.15rem; }
.timer.warning { color: var(--danger); }
.play-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.toolbar { min-width: 0; min-height: 0; }
.glass-panel { border: 1px solid var(--border); background: var(--panel); box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.05); backdrop-filter: blur(16px); }
.picker-panel { display: grid; max-height: calc(100vh - 150px); gap: 12px; overflow: auto; padding: 10px; border-radius: 8px; background: linear-gradient(155deg, rgba(8, 21, 28, 0.96), rgba(3, 12, 17, 0.91)); scrollbar-width: thin; }
.panel-back-button { width: 100%; justify-self: stretch; }
.picker-wrap { display: grid; grid-template-columns: minmax(150px, 1fr) 46px 66px; gap: 9px; align-items: stretch; }
.wheel-shell { position: relative; width: min(100%, 230px); aspect-ratio: 1; justify-self: center; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.055); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.13), 0 8px 20px rgba(0, 0, 0, 0.35); touch-action: none; }
#colorWheel { display: block; width: 100%; height: 100%; border-radius: 50%; cursor: crosshair; touch-action: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13), 0 0 22px rgba(62, 224, 160, 0.12); }
.wheel-cursor { position: absolute; width: 20px; height: 20px; pointer-events: none; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.66), 0 2px 8px rgba(0, 0, 0, 0.65); transform: translate(-50%, -50%); }
.channel-bar-group { display: flex; gap: 7px; align-items: stretch; justify-content: center; padding-top: 3px; }
.channel-bar-wrap { min-width: 17px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.channel-bar-wrap small { color: #dcece6; font-size: 9px; font-weight: 950; line-height: 1; }
.channel-shell { position: relative; width: 14px; flex: 1; min-height: 150px; border: 1px solid rgba(255, 255, 255, 0.33); border-radius: 999px; cursor: ns-resize; touch-action: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.channel-handle { position: absolute; left: 50%; width: 25px; height: 7px; border: 2px solid rgba(255, 255, 255, 0.96); border-radius: 9px; background: rgba(7, 17, 21, 0.72); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.72), 0 2px 5px rgba(0, 0, 0, 0.65); transform: translate(-50%, -50%); pointer-events: none; }
.current-paint { display: grid; align-content: start; gap: 6px; }
.paint-chip { width: 66px; height: 66px; border: 2px solid rgba(255, 255, 255, 0.72); border-radius: 8px; background: var(--brush-color); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.3); }
.hex-display { width: 66px; height: 29px; padding: 0 3px; border-color: rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.24); color: #fff; font-size: 9px; font-weight: 900; letter-spacing: 0; }
.fine-tune { padding-top: 8px; border-top: 1px solid rgba(151, 230, 201, 0.14); }
.fine-tune-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 5px; }
.fine-tune-header strong { color: #e8f4ef; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.precision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slider-group h2 { margin: 0 0 4px; color: #9eb7ad; font-size: 9px; letter-spacing: 0.13em; }
.slider-group label { display: grid; grid-template-columns: 11px minmax(50px, 1fr) 38px; align-items: center; gap: 4px; margin: 4px 0; color: #dbe8e3; font-size: 9px; font-weight: 850; }
input[type=range] { width: 100%; height: 5px; margin: 0; border-radius: 999px; appearance: none; background: rgba(255, 255, 255, 0.15); accent-color: var(--accent); }
input[type=range]::-webkit-slider-thumb { width: 13px; height: 13px; border: 2px solid white; border-radius: 50%; appearance: none; background: #15221f; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
#rSlider { background: linear-gradient(90deg, #170606, #f04b4b); }
#gSlider { background: linear-gradient(90deg, #061708, #44dc70); }
#bSlider { background: linear-gradient(90deg, #060b18, #4a83f1); }
#hSlider { background: linear-gradient(90deg, #f44, #ff0, #4f4, #0ff, #55f, #f4f, #f44); }
#sSlider { background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), var(--brush-color)); }
#vSlider { background: linear-gradient(90deg, #000, var(--brush-color)); }
.number-box, .hex-input { border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: white; }
.number-box { width: 38px; height: 23px; padding: 0 3px; text-align: right; font-size: 9px; }
.hex-input-label { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 7px; margin-top: 6px; color: #9eb7ad; font-size: 9px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.hex-input { width: 100%; height: 27px; margin: 0; padding: 0 7px; font-size: 10px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.hex-input.is-invalid { border-color: var(--danger); }
.tool-mode-row, .figure-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.icon-tool, .icon-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.icon-tool span, .icon-action span { font-size: 1.05rem; line-height: 1; }
.icon-tool small, .icon-action small { font-size: 0.66rem; font-weight: 900; line-height: 1; }
.brush-section, .figure-section { padding-top: 8px; border-top: 1px solid rgba(151, 230, 201, 0.14); }
.mini-heading { margin-bottom: 6px; color: #e8f4ef; font-size: 10px; font-weight: 950; letter-spacing: 0.1em; text-transform: uppercase; }
.brush-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.brush-size-button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(255, 255, 255, 0.11); border-radius: 8px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)); color: #dceae5; font-size: 11px; font-weight: 900; }
.brush-size-button.is-active { border-color: rgba(117, 237, 141, 0.72); background: linear-gradient(180deg, rgba(103, 229, 127, 0.25), rgba(61, 180, 135, 0.14)); color: white; }
.brush-dot { display: inline-block; border: 1px solid white; border-radius: 50%; background: var(--brush-color); }
.brush-dot-small { width: 5px; height: 5px; }
.brush-dot-medium { width: 9px; height: 9px; }
.brush-dot-large { width: 15px; height: 15px; }
.brush-dot-xlarge { width: 22px; height: 22px; }
.tool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.secondary-button { color: #dbe8e3; font-size: 0.78rem; font-weight: 850; }
.picker-panel > .finish-button { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -10px 20px rgba(3, 12, 17, 0.75), 0 12px 28px rgba(47, 201, 106, 0.18); }

.stage-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #020705; }
#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-shell.is-paused #gameCanvas { filter: blur(5px) brightness(0.48) saturate(0.75); }
.brush-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: none;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(222, 255, 236, 0.95);
  border-radius: 50%;
  background: rgba(117, 240, 167, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 14px rgba(117, 240, 167, 0.18);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.start-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(0, 8, 6, 0.28); backdrop-filter: blur(3px); pointer-events: none; }
.start-panel { width: min(520px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 26px; background: rgba(7, 18, 15, 0.84); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34); pointer-events: auto; text-align: center; }
.start-panel h2 { margin-bottom: 14px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 0.98; }
.start-panel p { margin-bottom: 8px; color: #d8f7e5; line-height: 1.45; }
.start-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pause-overlay {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 18px;
  background: rgba(0, 8, 6, 0.58); backdrop-filter: blur(5px); pointer-events: auto;
}
.pause-panel {
  width: min(420px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 24px;
  background: rgba(7, 18, 15, 0.9); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38), 0 0 24px rgba(65, 216, 132, 0.08);
  text-align: center;
}
.pause-panel h2 { margin: 0 0 10px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1; }
.pause-panel p { margin: 0; color: #d8f7e5; line-height: 1.45; }
.pause-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pause-actions .finish-button, .pause-actions .ghost-button { flex: 1 1 160px; }
.mobile-orientation-gate {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  min-height: 100%; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(8, 31, 43, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); pointer-events: auto;
}
.game-view.mobile-orientation-required .play-layout,
.game-view.mobile-orientation-required .game-topbar { pointer-events: none; }
.mobile-orientation-card {
  display: grid; width: min(360px, 100%); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  justify-items: center; gap: 12px; overflow: auto; border: 1px solid rgba(89, 225, 210, 0.34); border-radius: 8px; padding: 24px 20px 20px;
  background: linear-gradient(155deg, rgba(16, 55, 70, 0.96), rgba(13, 49, 64, 0.96)); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.08);
  color: var(--cream); text-align: center;
}
.phone-rotate-icon {
  position: relative; width: 72px; height: 72px; border-radius: 50%; background: rgba(89, 225, 210, 0.12);
  box-shadow: inset 0 0 0 1px rgba(89, 225, 210, 0.26), 0 0 28px rgba(89, 225, 210, 0.14);
}
.phone-rotate-icon::before {
  content: ""; position: absolute; left: 23px; top: 17px; width: 25px; height: 38px; border: 3px solid var(--cream); border-radius: 7px; transform: rotate(90deg);
}
.phone-rotate-icon::after {
  content: ""; position: absolute; left: 12px; top: 13px; width: 47px; height: 47px; border: 2px solid transparent; border-top-color: var(--aqua); border-right-color: var(--coral); border-radius: 50%; transform: rotate(20deg);
}
.mobile-orientation-card h2 { margin: 0; font-size: 1.75rem; line-height: 1.05; }
.mobile-orientation-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.mobile-fullscreen-button {
  width: 100%; min-height: 52px; border: 1px solid rgba(89, 225, 210, 0.56); border-radius: 8px; padding: 12px 16px;
  background: linear-gradient(180deg, var(--aqua), #35c7ba); color: #082938; font-weight: 950; letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(89, 225, 210, 0.18), inset 0 1px rgba(255, 255, 255, 0.32);
}
.mobile-orientation-fallback { max-width: 290px; color: #d8f7e5 !important; font-size: 0.86rem; }

.result-view { display: grid; min-height: calc(100vh - 68px); place-items: center; }
.result-panel { width: min(900px, 100%); border-radius: 8px; padding: 24px; }
.result-panel h2 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.6rem); }
.result-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 8px; background: #020705; touch-action: pan-y; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.result-actions .finish-button { flex: 1 1 210px; }
.result-actions .secondary-button, .result-actions .ghost-button { flex: 0 1 180px; }
.copy-status { min-height: 1.4em; margin: 10px 0 0; color: var(--accent); }
.share-text-button { width: max-content; max-width: 100%; margin-top: 8px; }
.manual-share-modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(1, 8, 6, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.manual-share-card {
  display: grid; width: min(460px, 100%); max-height: min(76vh, 520px); gap: 12px;
  border-radius: 8px; padding: 18px; overflow: hidden;
}
.manual-share-card h2 { margin: 0; color: var(--cream); font-size: 1.35rem; line-height: 1; }
.manual-share-card p { margin: 0; color: var(--muted); line-height: 1.4; }
.manual-share-text {
  width: 100%; min-height: 150px; max-height: 260px; resize: vertical; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  background: rgba(0, 0, 0, 0.32); color: var(--text); line-height: 1.35;
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.manual-share-card .ghost-button { justify-self: end; min-width: 110px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(1, 8, 6, 0.78); backdrop-filter: blur(8px); }
.modal-card {
  display: grid; width: min(860px, 100%); max-height: 82vh; grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px; padding: 22px; overflow: hidden;
}
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(151, 230, 201, 0.16); }
.modal-header .icon-button { flex: 0 0 auto; font-size: 0; }
.modal-header .icon-button::before { content: "\00d7"; font-size: 1.25rem; line-height: 1; }
.modal-card h2 { margin: 0 0 6px; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1; }
.modal-subtitle { margin: 0; color: #d8f7e5; line-height: 1.45; }
.help-content { min-height: 0; display: grid; gap: 14px; overflow-y: auto; padding: 14px 3px 2px 0; scrollbar-width: thin; }
.help-mission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.help-mission-card {
  display: grid; min-width: 0; gap: 10px; align-content: start;
  border: 1px solid rgba(124, 255, 188, 0.22); border-radius: 8px; padding: 15px;
  background: linear-gradient(180deg, rgba(15, 47, 37, 0.84), rgba(5, 18, 16, 0.76));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 0 20px rgba(65, 216, 132, 0.09);
}
.help-step-meta { margin: 2px 0 0; color: #ffd29a; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; }
.help-mission-card h3 { margin: 0; color: #ecfff5; font-size: 1.05rem; line-height: 1.15; }
.help-icon-stack { display: flex; min-height: 38px; flex-wrap: wrap; gap: 7px; align-items: center; }
.help-tool-icon,
.help-mouse-icon,
.help-size-icons span {
  display: grid; width: 36px; height: 34px; place-items: center;
  border: 1px solid rgba(117, 240, 167, 0.5); border-radius: 8px;
  background: rgba(117, 240, 167, 0.12); color: var(--accent); font-size: 1.05rem; font-weight: 900;
  box-shadow: 0 0 14px rgba(117, 240, 167, 0.1);
}
.help-mouse-icon { position: relative; width: 28px; height: 36px; border-radius: 14px; }
.help-mouse-wheel { width: 4px; height: 9px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 8px rgba(117, 240, 167, 0.42); }
.help-size-icons { display: inline-flex; gap: 5px; }
.help-size-icons span { width: 30px; height: 28px; font-size: 0.78rem; }
.help-line-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
.help-line-list li { position: relative; padding-left: 12px; }
.help-line-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(117, 240, 167, 0.4); }
.help-tools {
  border: 1px solid rgba(124, 255, 188, 0.18); border-radius: 8px; padding: 14px;
  background: rgba(7, 18, 15, 0.58);
}
.help-tools h3 { margin: 0 0 10px; color: var(--accent); font-size: 0.82rem; letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; }
.help-tool-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.help-tool-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.help-tool-row p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.help-tool-badge {
  display: inline-flex; min-height: 34px; min-width: 0; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  background: rgba(255, 255, 255, 0.06); color: #dbe8e3; font-weight: 850;
}
.help-tool-badge small { font-size: 0.68rem; font-weight: 900; line-height: 1; }
.help-badge-icon { font-size: 0.95rem; line-height: 1; }
.help-tool-badge.finish-badge { border-color: rgba(117, 240, 167, 0.62); background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #06100d; }
.help-tool-badge.back-badge { background: rgba(255, 255, 255, 0.035); }

@media (min-width: 981px) {
  .play-layout {
    height: clamp(560px, calc(100vh - 150px), 760px);
  }

  .toolbar,
  .picker-panel,
  .stage-shell {
    height: 100%;
    min-height: 0;
  }

  .picker-panel {
    max-height: none;
  }

  .stage-shell {
    aspect-ratio: auto;
  }
}

@media (min-width: 1100px) {
  .app-shell { width: min(100% - 40px, 1480px); }
  .hero { padding-top: 22px; }
  .event-hero { padding-bottom: 10px; }
  .hero-kicker-row { margin-bottom: 8px; }
  .hero h1 { max-width: 1120px; margin-bottom: 10px; font-size: clamp(42px, 5.35vw, 70px); }
  .subtitle { max-width: 1040px; margin-bottom: 5px; }
  .winner-hook { max-width: 920px; }
  .event-status-pills { margin-top: 10px; }
  .mission-flow { margin-top: 8px; }
  .mission-card { padding: 10px 12px; gap: 6px 9px; }
  .mission-card span { font-size: 1.32rem; }
  .mission-card p { font-size: 0.86rem; line-height: 1.26; }
  .week-panel { margin-top: 14px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: clamp(34px, 3.45vw, 50px); }
  .section-subtitle { max-width: 820px; line-height: 1.42; }
  .challenge-grid { gap: 40px; }
  .challenge-card { min-height: 360px; }
  .card-image { aspect-ratio: 1.9 / 1; }
  .card-body { gap: 7px; padding: 13px 14px 14px; }
  .card-body h3 { font-size: 1.32rem; }
  .card-description { font-size: 0.86rem; line-height: 1.28; }
  .card-facts { gap: 6px; }
  .pill { min-height: 24px; padding: 4px 8px; }
  .card-body .play-button { min-height: 39px; }
}

@media (min-width: 1100px) and (max-height: 950px) {
  .app-shell { width: min(100% - 36px, 1480px); }
  .hero { padding-top: 14px; }
  .event-hero { padding-bottom: 7px; }
  .hero-kicker-row { margin-bottom: 6px; }
  .live-chip { min-height: 27px; padding: 5px 10px; }
  .hero h1 { margin-bottom: 7px; font-size: clamp(40px, 5vw, 66px); }
  .subtitle { margin-bottom: 4px; font-size: clamp(0.98rem, 1.45vw, 1.12rem); line-height: 1.28; }
  .winner-hook { font-size: 0.88rem; line-height: 1.28; }
  .event-status-pills { gap: 7px; margin-top: 8px; }
  .event-status-pills span { min-height: 31px; padding: 6px 10px; font-size: 0.68rem; }
  .mission-flow { margin-top: 6px; }
  .mission-grid { gap: 8px; }
  .mission-card { padding: 8px 10px; gap: 5px 8px; }
  .mission-card span { font-size: 1.18rem; }
  .mission-card h3 { margin-top: 1px; font-size: 0.8rem; }
  .mission-card p { font-size: 0.78rem; line-height: 1.18; }
  .week-panel { margin-top: 10px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { margin-bottom: 5px; font-size: clamp(30px, 3.05vw, 44px); }
  .section-subtitle { font-size: 0.92rem; line-height: 1.32; }
  .challenge-grid { max-width: 1260px; gap: 40px; }
  .challenge-card { min-height: 330px; }
  .card-image { aspect-ratio: 2 / 1; }
  .card-body { gap: 6px; padding: 11px 12px 12px; }
  .card-identity { font-size: 0.66rem; }
  .card-body .eyebrow { font-size: 0.64rem; }
  .card-body h3 { font-size: 1.22rem; }
  .card-description { font-size: 0.8rem; line-height: 1.24; }
  .pill { min-height: 22px; padding: 4px 7px; font-size: 0.62rem; }
  .card-body .play-button { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
}

@media (max-width: 980px) {
  .camo-site-header {
    width: min(100% - 28px, 1440px);
    padding-top: 7px;
  }
  .camo-site-header-inner { min-height: 50px; }
  .app-shell { width: min(100% - 28px, 1440px); padding-bottom: 18px; }
  .hero { padding-top: 22px; }
  .event-hero { grid-template-columns: 1fr; min-height: 0; }
  .mission-grid, .challenge-grid, .inspiration-grid, .play-layout { grid-template-columns: 1fr; }
  .challenge-grid { gap: 20px; max-width: none; }
  .challenge-card { min-height: 0; }
  .inspiration-card { min-height: 0; }
  .timeline-list { grid-template-columns: 1fr; }
  .timeline-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; padding: 18px; }
  .timeline-list li + li { border-left: 0; border-top: 1px solid rgba(255, 247, 232, 0.12); }
  .timeline-list span { grid-row: span 2; margin: 5px 0 0; }
  .game-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .picker-panel { max-height: 260px; }
}

@media (max-width: 520px) {
  .camo-site-header {
    width: min(100% - 24px, 1440px);
  }
  .camo-site-header-inner {
    min-height: 48px;
    gap: 10px;
    padding: 6px 8px;
  }
  .camo-site-brand-icon {
    width: 30px;
    height: 30px;
  }
  .camo-site-brand-words {
    gap: 6px;
  }
  .camo-site-brand-words strong {
    font-size: 0.7rem;
  }
  .camo-site-brand-words span {
    min-height: 20px;
    padding: 2px 5px;
    font-size: 0.52rem;
  }
  .camo-site-nav {
    gap: 6px;
  }
  .camo-site-nav a {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.72rem;
  }
  .camo-site-nav a:nth-child(n+2) {
    display: none;
  }
  .app-shell { width: min(100% - 24px, 1440px); }
  .hero { padding-top: 18px; }
  .hero h1 { font-size: clamp(38px, 13vw, 52px); line-height: 0.96; margin-bottom: 9px; }
  .subtitle { margin-bottom: 6px; font-size: 0.98rem; }
  .winner-hook { font-size: 0.9rem; }
  .event-status-pills { gap: 6px; margin-top: 10px; }
  .event-status-pills span { min-height: 32px; justify-content: center; padding: 6px 9px; text-align: center; font-size: 0.66rem; }
  .mission-flow { margin-top: 8px; }
  .mission-grid { gap: 7px; }
  .mission-card { min-height: 0; padding: 9px 10px; gap: 5px 8px; }
  .mission-card span { font-size: 1.1rem; }
  .mission-card h3 { margin-top: 1px; font-size: 0.78rem; }
  .mission-card p { font-size: 0.8rem; line-height: 1.22; }
  .week-panel { margin-top: 14px; }
  .section-heading h2 { font-size: 2.25rem; }
  .mock-size-row span { min-height: 38px; }
  .spot-preview { min-height: 92px; }
  .picker-wrap { grid-template-columns: minmax(120px, 1fr) 46px 66px; }
  .game-topbar { grid-template-columns: 1fr; align-items: start; }
  .hud-controls { justify-content: space-between; width: 100%; }
  .phase-stack { justify-content: flex-start; }
  .phase-display, .timer { min-width: 0; }
  .modal-backdrop { padding: 12px; }
  .modal-card { max-height: 82vh; padding: 18px; }
  .modal-header { gap: 10px; }
  .help-mission-grid, .help-tool-list { grid-template-columns: 1fr; }
  .help-mission-card { gap: 8px; padding: 12px; }
  .help-tool-row { grid-template-columns: 86px minmax(0, 1fr); gap: 9px; }
  .result-actions .finish-button, .result-actions .secondary-button, .result-actions .ghost-button { flex-basis: 100%; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  html:has(body.is-playing), body.is-playing { overflow: hidden; height: 100vh; height: 100dvh; }
  body.is-playing .app-shell {
    width: 100vw; max-width: none; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh;
    padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    overflow: hidden;
  }
  html:has(body.is-result), body.is-result {
    overflow: hidden; height: 100vh; height: 100dvh;
  }
  body.is-result .app-shell {
    width: 100vw; max-width: none; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  body.is-result .result-view {
    position: relative; display: grid; width: 100%; height: 100%; min-height: 0; max-height: none;
    place-items: start center; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  }
  body.is-result .result-panel {
    width: min(900px, 100%); min-height: 0; padding: 16px;
  }
  body.is-result .result-canvas {
    width: 100%; max-width: 100%; height: auto; touch-action: pan-y;
  }
  body.is-result .result-actions {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  body.is-result #gameView,
  body.is-result #gameView #gameCanvas,
  body.is-result #gameView .stage-shell,
  body.is-result #gameView .start-overlay,
  body.is-result #gameView .pause-overlay,
  body.is-result #gameView .mobile-orientation-gate {
    touch-action: pan-y !important;
    pointer-events: none;
  }
  body.is-result #resultView,
  body.is-result #resultView .result-panel,
  body.is-result #resultView .result-canvas,
  body.is-result #resultView canvas {
    touch-action: pan-y !important;
  }
  body.is-playing .game-view:not(.hidden) { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-height: 0; height: 100%; }
  .game-topbar { margin: 0; gap: 8px; padding: 6px 8px; }
  .game-title-block h2 { font-size: clamp(1rem, 3.6vw, 1.45rem); }
  .game-title-block .eyebrow { font-size: 0.64rem; }
  .hud-controls { gap: 6px; }
  .phase-stack { gap: 6px; }
  .phase-display, .timer { min-height: 34px; min-width: 58px; padding: 6px 8px; }
  .timer { font-size: 1rem; }
  .hud-controls .icon-button { width: 34px; min-height: 34px; height: 34px; }
  .play-layout { min-height: 0; height: 100%; grid-template-columns: clamp(220px, 31vw, 285px) minmax(0, 1fr); gap: 6px; }
  .toolbar, .picker-panel, .stage-shell { min-height: 0; height: 100%; }
  .picker-panel { max-height: none; gap: 7px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 7px; border-radius: 8px; }
  .panel-back-button { min-height: 32px; }
  .picker-wrap { grid-template-columns: minmax(96px, 1fr) 38px 54px; gap: 6px; }
  .wheel-shell { width: min(100%, 126px); }
  .channel-shell { min-height: 88px; }
  .paint-chip { width: 54px; height: 54px; }
  .hex-display { width: 54px; height: 26px; font-size: 8px; }
  .fine-tune { padding-top: 6px; }
  .precision-grid { gap: 7px; }
  .slider-group label { grid-template-columns: 10px minmax(42px, 1fr) 34px; gap: 3px; margin: 3px 0; }
  .number-box { width: 34px; height: 21px; }
  .hex-input-label { margin-top: 4px; }
  .tool-mode-row, .figure-sizes { gap: 5px; }
  .tool-button, .ghost-button, .size-button, .secondary-button, .icon-button { min-height: 32px; padding: 6px 8px; }
  .brush-section, .figure-section { padding-top: 6px; }
  .mini-heading { margin-bottom: 5px; font-size: 9px; }
  .brush-size-button { min-height: 30px; gap: 4px; }
  .tool-row { gap: 5px; }
  .picker-panel > .finish-button { min-height: 38px; padding: 8px 10px; }
  .stage-shell { aspect-ratio: auto; border-radius: 8px; }
  .start-overlay, .pause-overlay { padding: 10px; }
  .start-panel, .pause-panel { width: min(430px, 92%); max-height: calc(100dvh - 24px); overflow: auto; padding: 16px; }
  .start-panel h2, .pause-panel h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 5vw, 2.2rem); }
  .start-panel p, .pause-panel p { margin-bottom: 5px; font-size: 0.9rem; }
  .start-actions, .pause-actions { margin-top: 10px; }
  .modal-backdrop { padding: 8px; }
  .modal-card { max-height: calc(100dvh - 16px); padding: 14px; }
  .help-mission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .help-mission-card { padding: 10px; }
}

.challenge-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.challenge-heading > div { min-width: 0; }
.archive-entry-link,
.archive-cta .ghost-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(89, 225, 210, 0.42);
  border-radius: 8px;
  padding: 9px 13px;
  background: rgba(89, 225, 210, 0.1);
  color: var(--mint);
  font-weight: 900;
  text-decoration: none;
}
.archive-entry-link:hover,
.archive-entry-link:focus-visible,
.archive-cta .ghost-button:hover,
.archive-cta .ghost-button:focus-visible {
  border-color: var(--aqua);
  outline: 2px solid rgba(89, 225, 210, 0.25);
  outline-offset: 2px;
}
.archive-cta {
  display: grid;
  gap: 14px;
  margin-top: clamp(34px, 5vw, 60px);
  border: 1px solid rgba(255, 247, 232, 0.14);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, rgba(16, 55, 70, 0.82), rgba(13, 49, 64, 0.92));
  box-shadow: 0 22px 60px rgba(4, 18, 25, 0.2);
}
.archive-cta h2 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1;
}
.archive-cta p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 620px) {
  .challenge-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .archive-entry-link,
  .archive-actions .ghost-button,
  .archive-actions .finish-button {
    width: 100%;
  }
}
