:root {
  --orange: #ff5c35;
  --orange-dark: #c2410c;
  --dark: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 92, 53, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff, var(--bg));
  color: var(--dark);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px;
}

.hidden {
  display: none !important;
}

.hero {
  display: grid;
  gap: 22px;
  margin-bottom: 18px;
}

.brand-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 66px;
}

.logo-slot {
  border-radius: 22px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  place-items: center;
  color: #64748b;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 10px;
}

.logo-slot img {
  max-width: 70px;
  max-height: 55px;
}

.logo-slot.hubspot {
  color: var(--orange);
}

.eyebrow {
  color: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(38px, 7vw, 76px);
  line-height: .95;
  margin: 0;
}

h2,
h3 {
  margin-top: 0;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .08);
  padding: 28px;
}

.lead-panel {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 28px;
}

.muted {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0 10px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 92, 53, .12);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 14px;
}

button {
  font: inherit;
}

button.primary,
button.secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 14px 20px;
  font-weight: 900;
  border-radius: 999px;
  cursor: pointer;
}

button.primary {
  background: var(--orange);
  color: white;
  box-shadow: 0 12px 24px rgba(255, 92, 53, .24);
}

button.secondary {
  background: #f1f5f9;
  color: var(--dark);
}

button:hover {
  transform: translateY(-1px);
}

.error {
  color: var(--danger);
  font-weight: 700;
  min-height: 22px;
}

.rules {
  background: #fff7ed;
  border-radius: 22px;
  padding: 20px;
}

.rule {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 92, 53, .18);
}

.rule strong {
  color: var(--orange);
  font-size: 22px;
}

.game-panel {
  display: grid;
  gap: 14px;
}

.game-topbar,
.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.game-topbar span,
.game-controls span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}

.game-topbar .power {
  background: #fff7ed;
  color: var(--orange-dark);
}

.game-topbar .shield {
  background: #ecfdf5;
  color: #047857;
}

.canvas-container {
  position: relative;
  width: 100%;
}

canvas {
  width: 100%;
  min-height: 320px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: white;
  touch-action: manipulation;
}

.preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  color: white;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

.preview-overlay h2 {
  color: white;
  font-size: clamp(24px, 5vw, 42px);
  margin-bottom: 12px;
}

.preview-overlay p {
  margin-bottom: 24px;
  font-size: 18px;
  color: #e2e8f0;
}

.result-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 24px;
}

.result-card,
.ranking {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
}

.score-big {
  font-size: 56px;
  font-weight: 950;
  color: var(--orange);
  margin: 8px 0;
}

.ranking-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 76px;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rank-row .place {
  color: var(--orange);
  font-weight: 950;
}

.rank-row small {
  color: var(--muted);
}

.rank-row b {
  text-align: right;
}

.footer {
  color: var(--muted);
  margin-top: 18px;
  font-size: 14px;
}

@media (max-width: 800px) {
  .page {
    padding: 16px;
  }

  .lead-panel,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .brand-strip {
    justify-content: center;
  }

  .rank-row {
    grid-template-columns: 42px 1fr 70px;
  }

  .rank-row small {
    display: none;
  }

  canvas {
    min-height: 260px;
  }
}

/* Start screen content */
.start-panel {
  grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.35fr);
  align-items: start;
}

.start-main h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  margin-bottom: 12px;
}

.start-info {
  display: grid;
  gap: 14px;
}

.info-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.info-card h3 {
  margin-bottom: 12px;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.instruction-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.instruction-grid strong {
  display: block;
  color: var(--orange);
  margin-bottom: 4px;
}

.instruction-grid span {
  color: var(--muted);
  font-size: 14px;
}

.prize-list {
  display: grid;
  gap: 10px;
}

.prize {
  display: grid;
  grid-template-columns: 70px 1fr 54px;
  gap: 10px;
  align-items: center;
  background: #fff7ed;
  border: 1px solid rgba(255, 92, 53, .18);
  border-radius: 16px;
  padding: 10px 12px;
}

.prize strong,
.prize b {
  color: var(--orange);
  font-weight: 950;
}

.prize b {
  text-align: right;
  font-size: 22px;
}

.asset-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-legend div {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
  min-height: 58px;
}

.asset-legend img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.asset-legend span {
  color: #334155;
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 980px) {
  .start-panel {
    grid-template-columns: 1fr;
  }

  .asset-legend,
  .instruction-grid {
    grid-template-columns: 1fr;
  }
}


/* UX/UI refinement v3: form-first start screen */
.start-panel-v2 {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 22px;
}

.signup-card {
  position: sticky;
  top: 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 92, 53, .18), transparent 32%),
    #ffffff;
  border: 1px solid rgba(255, 92, 53, .18);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
}

.signup-card h2 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: .98;
  margin: 0 0 12px;
  letter-spacing: -.04em;
}

.signup-copy {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.signup-form {
  display: grid;
  gap: 10px;
}

.field-label {
  font-weight: 850;
  color: #334155;
  font-size: 14px;
  margin-top: 6px;
}

.signup-form input[type="text"],
.signup-form input[type="email"] {
  min-height: 54px;
  background: #f8fafc;
  border: 1px solid #dbe4ee;
}

.terms-row {
  margin: 8px 0 4px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.start-button {
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  font-size: 17px;
}

.quick-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-controls span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid rgba(255, 92, 53, .20);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.event-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.event-info-grid .wide-card {
  grid-column: span 2;
}

.mini-eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 4px;
}

.prize-card-featured {
  background:
    linear-gradient(135deg, rgba(255, 247, 237, .95), rgba(255,255,255,.95));
}

.prize-list.compact {
  gap: 8px;
}

.prize-list.compact .prize {
  grid-template-columns: 62px 1fr 48px;
  padding: 9px 10px;
}

.how-card {
  background: #f8fafc;
}

.steps-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps-list li {
  counter-increment: steps;
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px;
}

.steps-list li::before {
  content: counter(steps);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #ffffff;
  border-radius: 999px;
  font-weight: 950;
}

.steps-list strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.steps-list span {
  color: var(--muted);
  font-size: 13px;
}

.asset-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.hint-pill {
  white-space: nowrap;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
}

.hint-pill.positive {
  background: #dcfce7;
  color: #166534;
}

.compact-legend {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-legend div {
  grid-template-columns: 42px 1fr;
  min-height: 56px;
  padding: 7px 9px;
}

.compact-legend img {
  width: 40px;
  height: 40px;
}

.compact-legend span {
  font-size: 12px;
  line-height: 1.15;
}

.compact-legend.powers {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .start-panel-v2 {
    grid-template-columns: 1fr;
  }

  .signup-card {
    position: static;
  }

  .event-info-grid {
    grid-template-columns: 1fr;
  }

  .event-info-grid .wide-card {
    grid-column: auto;
  }

  .compact-legend,
  .compact-legend.powers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .start-panel-v2 {
    padding: 16px;
  }

  .signup-card,
  .info-card {
    padding: 18px;
    border-radius: 22px;
  }

  .compact-legend,
  .compact-legend.powers {
    grid-template-columns: 1fr;
  }

  .asset-card-header {
    display: grid;
  }

  .hint-pill {
    width: fit-content;
  }
}


/* Fullscreen game mode */
.fullscreen-target {
  display: grid;
  gap: 14px;
  background: rgba(255,255,255,0.92);
  border-radius: 24px;
}

.fullscreen-button {
  margin-left: auto;
  border: 0;
  background: #0f172a;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.fullscreen-button:hover {
  transform: translateY(-1px);
}

.fullscreen-target:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 18px;
  border-radius: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 92, 53, .14), transparent 28%),
    #f8fafc;
  grid-template-rows: auto 1fr auto;
}

.fullscreen-target:fullscreen .game-topbar {
  position: relative;
  z-index: 5;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(15,23,42,.10);
}

.fullscreen-target:fullscreen .canvas-container {
  min-height: 0;
  height: 100%;
}

.fullscreen-target:fullscreen canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.fullscreen-target:fullscreen .game-controls {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
}

@media (max-width: 760px) {
  .fullscreen-button {
    width: 100%;
    margin-left: 0;
  }
}


/* Sound button */
.sound-button {
  border: 0;
  background: #ff5c35;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.sound-button.muted {
  background: #94a3b8;
}

.sound-button:hover {
  transform: translateY(-1px);
}

.fullscreen-target:fullscreen .sound-button,
.fullscreen-target:fullscreen .fullscreen-button {
  min-height: 40px;
}

@media (max-width: 760px) {
  .sound-button {
    width: 100%;
  }
}
