:root {
  --bg: #f4faf9;
  --surface: #ffffff;
  --text: #113036;
  --muted: #4d6d72;
  --primary: #0f8a83;
  --primary-strong: #0a6d68;
  --ring: #84d5ca;
  --shadow: 0 12px 28px rgba(19, 61, 72, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% -10%, #f9fefd 0%, var(--bg) 42%, #e8f4f1 100%);
}

.lab-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 86% 15%, rgba(15, 138, 131, 0.12), transparent 22%),
    radial-gradient(circle at 20% 86%, rgba(37, 121, 191, 0.1), transparent 18%);
}

.app-shell {
  position: relative;
  width: min(720px, 100%);
  margin-inline: auto;
  padding: 1rem;
}

.brand-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  min-height: 52px;
}

.brand-logo {
  grid-column: 2;
  justify-self: center;
  width: 150px;
  max-width: 48vw;
  height: auto;
  display: block;
}

.language-picker {
  grid-column: 3;
  justify-self: end;
}

.language-picker select {
  border: 1px solid rgba(17, 48, 54, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font: inherit;
  padding: 0.55rem 0.85rem;
}

body.game-active {
  overflow-x: hidden;
}

body.game-active .app-shell {
  min-height: 100dvh;
  padding: 0.45rem 0.45rem 0.6rem;
}

body.game-active .brand-bar {
  min-height: 42px;
  margin-bottom: 0.45rem;
}

body.game-active .brand-logo {
  width: 118px;
  max-width: 34vw;
}

body.game-active .language-picker select {
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.screen {
  display: none;
  animation: fade-up 220ms ease-out;
}

.screen.active {
  display: block;
}

#game-screen {
  position: relative;
}

.combo-pop {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: min(44vh, 340px);
  transform: translate(-50%, 0);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  color: #ffffff;
  background: linear-gradient(135deg, #0f8a83, #2f8db6);
  box-shadow: 0 14px 28px rgba(17, 48, 54, 0.18);
  font-size: 0.9rem;
  font-weight: 800;
  pointer-events: none;
  animation: combo-rise 760ms ease-out forwards;
}

.combo-pop-error {
  background: linear-gradient(135deg, #c95d5d, #e09544);
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--primary-strong);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 40ch;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(17, 48, 54, 0.08);
}

.callout {
  margin-bottom: 1rem;
}

.setup-card {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mode-section {
  margin-bottom: 1rem;
}

.mode-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.mode-option {
  border: 2px solid rgba(17, 48, 54, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 250, 247, 0.92));
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  min-height: 188px;
  padding: 0.75rem 0.65rem 0.85rem;
  text-align: center;
  box-shadow: 0 10px 22px rgba(17, 48, 54, 0.08);
}

.mode-icon {
  width: min(108px, 32vw);
  aspect-ratio: 1;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(17, 48, 54, 0.14);
}

.mode-option span {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}

.mode-option small {
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.25;
}

.mode-option.active {
  border-color: rgba(15, 138, 131, 0.72);
  box-shadow:
    0 12px 24px rgba(15, 138, 131, 0.14),
    inset 0 0 0 1px rgba(15, 138, 131, 0.12);
}

.toggle-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  padding: 0.82rem 1.2rem;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.btn:focus-visible,
.mode-option:focus-visible,
.answer-card:focus-visible,
input:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.btn:active,
.mode-option:active,
.answer-card:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: rgba(15, 138, 131, 0.08);
  color: var(--primary-strong);
}

.mission-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.mission-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 12px 22px rgba(17, 48, 54, 0.08);
}

.mission-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  background:
    radial-gradient(circle at 86% 14%, rgba(15, 138, 131, 0.1), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 58%, #f4fbf9 100%);
  border: 1px solid rgba(17, 48, 54, 0.06);
}

.mission-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  transform: translate(-35%, -35%);
  pointer-events: none;
}

.mission-card h3 {
  position: relative;
  margin-bottom: 0.85rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.mission-layout {
  position: relative;
  display: grid;
  gap: 1rem;
}

.mission-copy {
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 255, 253, 0.9));
  box-shadow:
    0 10px 22px rgba(17, 48, 54, 0.05),
    inset 0 0 0 1px rgba(17, 48, 54, 0.06);
  backdrop-filter: blur(6px);
}

.mission-copy p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(17, 48, 54, 0.9);
}

.mission-media {
  border-radius: 26px;
  overflow: hidden;
  min-height: 280px;
  background: linear-gradient(180deg, #f4faf8, #e6f2ef);
  box-shadow:
    0 18px 34px rgba(17, 48, 54, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(17, 48, 54, 0.06);
}

.mission-media img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.hud-item {
  background: #f7fffd;
  border: 1px solid rgba(15, 138, 131, 0.2);
  border-radius: 14px;
  padding: 0.65rem;
  text-align: center;
}

.hud-item strong {
  font-size: 1.2rem;
}

.hud-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

body.game-active .hud {
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

body.game-active .hud-item {
  border-radius: 13px;
  padding: 0.42rem 0.35rem;
}

body.game-active .hud-item strong {
  display: inline-block;
  font-size: 1rem;
  line-height: 1.05;
}

body.game-active .hud-label {
  font-size: 0.68rem;
  line-height: 1;
}

body.game-active .dev-skip-btn {
  margin-top: 0.18rem;
  padding: 0.22rem 0.48rem;
  font-size: 0.62rem;
}

.dev-skip-btn {
  margin-top: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.34rem 0.65rem;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--primary-strong);
  background: rgba(15, 138, 131, 0.12);
  cursor: pointer;
}

.dev-skip-btn:hover {
  background: rgba(15, 138, 131, 0.18);
}

.section-title {
  margin-bottom: 0.75rem;
}

body.game-active .section-title {
  margin-bottom: 0.45rem;
  font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  line-height: 1.1;
}

.round-pressure {
  height: 8px;
  background: rgba(17, 48, 54, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

body.game-active .round-pressure {
  height: 6px;
  margin-bottom: 0.45rem;
}

.round-bar {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8db6, #0f8a83 55%, #e6a94f);
  transform-origin: left center;
  transition: transform 80ms linear, background 150ms ease;
}

.run-status {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin: -0.25rem 0 0.75rem;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.game-active .run-status {
  margin: -0.1rem 0 0.45rem;
  font-size: 0.66rem;
}

body.game-active .run-status span {
  padding: 0.2rem 0.44rem;
}

.run-status span {
  border: 1px solid rgba(15, 138, 131, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 0.28rem 0.55rem;
  box-shadow: 0 8px 18px rgba(17, 48, 54, 0.06);
}

.target-panel {
  margin-bottom: 0.8rem;
  display: grid;
  gap: 0.5rem;
}

body.game-active .target-panel {
  margin-bottom: 0.55rem;
  padding: 0.7rem;
  gap: 0.35rem;
}

.target-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

body.game-active .target-label {
  font-size: 0.72rem;
}

.pattern-tile {
  min-height: 176px;
  height: auto;
  border-radius: 14px;
  border: 2px solid rgba(17, 48, 54, 0.16);
  background:
    radial-gradient(circle at 18% 22%, rgba(219, 108, 129, 0.12), transparent 18%),
    radial-gradient(circle at 82% 74%, rgba(62, 167, 161, 0.14), transparent 20%),
    linear-gradient(180deg, #fcfffe, #eff8f5);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.game-active .pattern-tile {
  min-height: 142px;
}

.pattern-tile.target-pop .sample-card-target {
  animation: target-pop 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

body.game-active .answer-grid {
  gap: 0.45rem;
}

.answer-card {
  border: 2px solid rgba(17, 48, 54, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 20%, rgba(219, 108, 129, 0.1), transparent 18%),
    radial-gradient(circle at 84% 78%, rgba(62, 167, 161, 0.12), transparent 20%),
    linear-gradient(180deg, #ffffff, #f2faf7);
  min-height: 104px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px rgba(17, 48, 54, 0.08);
}

body.game-active .answer-card {
  border-width: 1px;
  border-radius: 13px;
  min-height: clamp(94px, 15.5dvh, 118px);
  box-shadow: 0 6px 14px rgba(17, 48, 54, 0.07);
}

.round-enter .answer-card {
  animation: card-deal 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--card-index, 0) * 28ms);
}

.answer-card:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 48, 54, 0.28);
}

.answer-card.correct-flash {
  animation: pop-green 320ms ease-out;
  z-index: 2;
}

.answer-card.correct-reveal {
  border-color: rgba(15, 138, 131, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 138, 131, 0.12), 0 10px 24px rgba(17, 48, 54, 0.12);
}

.answer-card.correct-reveal::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  border: 2px solid rgba(15, 138, 131, 0.34);
  pointer-events: none;
}

.answer-card.wrong-flash {
  animation: shake-red 250ms ease-out;
}

.feedback {
  min-height: 1.2rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  transition: transform 160ms ease, color 160ms ease;
}

.sample-card {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
}

.sample-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  height: 84px;
  margin: 0.55rem 0.55rem 0;
  border-radius: 16px;
  background:
      radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.3) 62%, transparent 100%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(233, 244, 240, 0.85));
  border: 1px solid rgba(17, 48, 54, 0.08);
  overflow: hidden;
}

body.game-active .sample-frame {
  height: clamp(62px, 10.5dvh, 78px);
  min-height: 62px;
  margin: 0.38rem 0.38rem 0;
  border-radius: 13px;
}

.sample-image {
  max-width: 100%;
  max-height: 78px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 5px 8px rgba(17, 48, 54, 0.12));
}

body.game-active .sample-image {
  max-height: clamp(56px, 9.5dvh, 72px);
}

.sample-card-target {
  grid-template-rows: 1fr auto;
  min-height: 172px;
}

body.game-active .sample-card-target {
  min-height: 138px;
}

.sample-card-target .sample-footer {
  text-align: center;
}

.sample-card-tshirt .sample-frame {
  background:
      radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.34) 62%, transparent 100%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(232, 241, 244, 0.88));
}

.sample-card-tshirt .sample-image {
  max-height: 74px;
}

.sample-card-tshirt.sample-card-target .sample-image {
  max-height: 120px;
}

body.game-active .sample-card-tshirt.sample-card-target .sample-image {
  max-height: 98px;
}

.sample-frame-target {
  min-height: 138px;
  height: 138px;
  margin: 0.45rem 0.45rem 0;
  padding: 0.4rem;
}

body.game-active .sample-frame-target {
  height: 108px;
  min-height: 108px;
  margin: 0.32rem 0.32rem 0;
}

.sample-image-target {
  max-height: 124px;
  filter: drop-shadow(0 8px 12px rgba(17, 48, 54, 0.16));
}

body.game-active .sample-image-target {
  max-height: 98px;
}

.sample-footer {
  padding: 0.28rem 0.7rem 0.65rem;
  font-size: 0.78rem;
  color: rgba(17, 48, 54, 0.75);
  font-weight: 600;
}

body.game-active .sample-footer {
  padding: 0.18rem 0.45rem 0.38rem;
  font-size: 0.72rem;
  line-height: 1.05;
}

.score-card,
.mission-card,
.form-card,
.events-card {
  margin-bottom: 0.8rem;
}

.score-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  background:
    radial-gradient(circle at 92% 0%, rgba(15, 138, 131, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fbfffe 54%, #f2faf8 100%);
}

.score-card::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 0 34%, transparent 35%),
    conic-gradient(from 40deg, rgba(15, 138, 131, 0.22), rgba(47, 141, 182, 0.08), rgba(15, 138, 131, 0.22));
  opacity: 0.7;
  pointer-events: none;
}

.events-card {
  min-height: 700px;
  padding: 1rem 1rem 1.35rem;
  background:
    radial-gradient(circle at 14% 16%, rgba(47, 141, 182, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f7fffd 56%, #eff8f5 100%);
  overflow: hidden;
}

.score-label {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.final-score {
  margin: -0.08rem 0 0;
  color: var(--ink);
  font-size: clamp(2.5rem, 12vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.rank-title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0.55rem 0 0;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  background: rgba(15, 138, 131, 0.1);
  color: var(--primary-strong);
  font-weight: 700;
}

.run-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.run-summary div {
  border: 1px solid rgba(17, 48, 54, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 248, 245, 0.92));
  padding: 0.78rem 0.72rem;
  box-shadow:
    0 8px 18px rgba(17, 48, 54, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.run-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.run-summary strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.2;
}

.collection-reveal {
  margin-top: 1rem;
  border-radius: 18px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(15, 138, 131, 0.2);
}

.collection-reveal p {
  margin: 0 0 0.45rem;
  color: var(--primary-strong);
  font-weight: 800;
}

.collection-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-color: rgba(15, 138, 131, 0.42) transparent;
}

.collection-chip {
  flex: 0 0 72px;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 48, 54, 0.08);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.42rem;
  box-shadow: 0 8px 18px rgba(17, 48, 54, 0.06);
}

.collection-chip img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(17, 48, 54, 0.12));
}

.collection-chip span {
  max-width: 100%;
  color: rgba(17, 48, 54, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-empty {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.score-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-start;
  margin-top: 1.05rem;
}

.score-card-actions .btn {
  min-width: min(100%, 180px);
}

.form-card form {
  display: grid;
  gap: 0.5rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
}

input {
  border: 1px solid rgba(17, 48, 54, 0.25);
  border-radius: 10px;
  padding: 0.65rem;
  font: inherit;
}

.form-status {
  min-height: 1rem;
  color: var(--primary-strong);
  margin: 0;
  font-size: 0.9rem;
}

.events-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.events-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  color: var(--primary-strong);
  background: rgba(15, 138, 131, 0.08);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.events-link:hover {
  background: rgba(15, 138, 131, 0.14);
  text-decoration: none;
}

.events-carousel {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  margin-inline: -0.15rem;
  min-height: 570px;
  padding: 0.2rem 0 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(15, 138, 131, 0.45) rgba(15, 138, 131, 0.08);
}

.events-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  min-height: 550px;
  padding: 0 0.05rem 0.5rem;
}

.event-item {
  flex: 0 0 min(82vw, 340px);
  width: min(82vw, 340px);
  display: flex;
  flex-direction: column;
  min-height: 535px;
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #eff8f5);
  border: 1px solid rgba(17, 48, 54, 0.1);
  box-shadow: 0 18px 34px rgba(17, 48, 54, 0.12);
  cursor: pointer;
  position: relative;
  z-index: 1;
  scroll-snap-align: start;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.event-item:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 138, 131, 0.28);
  box-shadow: 0 22px 38px rgba(17, 48, 54, 0.16);
}

.event-thumb {
  aspect-ratio: auto;
  height: 420px;
  min-height: 420px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(135deg, rgba(15, 138, 131, 0.16), rgba(47, 141, 182, 0.11)),
    linear-gradient(180deg, #fbfffe, #eaf6f3);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0.45rem;
}

.event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(17, 48, 54, 0.14));
}

.event-copy {
  flex: 0 0 auto;
  min-height: 100px;
  padding: 0.7rem 0.95rem 0.8rem;
  background: rgba(248, 255, 253, 0.92);
  border-top: 1px solid rgba(17, 48, 54, 0.08);
}

.event-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.event-cta {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  margin-top: 0.65rem;
  padding: 0.28rem 0.6rem;
  background: rgba(15, 138, 131, 0.1);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.fine-print {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.replay-btn {
  min-width: 180px;
}

.choose-game-btn {
  min-width: 150px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes target-pop {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  70% {
    opacity: 1;
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes combo-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.94);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -34px) scale(0.98);
  }
}

@keyframes pop-green {
  0% {
    transform: scale(1);
    background: #ffffff;
  }
  40% {
    transform: scale(1.045);
    background: #dcf8f0;
    box-shadow: 0 16px 30px rgba(15, 138, 131, 0.2);
  }
  100% {
    transform: scale(1);
    background: #ffffff;
  }
}

@keyframes shake-red {
  0%,
  100% {
    transform: translateX(0);
    background: #ffffff;
  }
  30% {
    transform: translateX(-4px);
    background: #ffe3e3;
  }
  60% {
    transform: translateX(4px);
    background: #ffe3e3;
  }
}

@media (max-width: 520px) {
  .run-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .score-card-actions .btn,
  .mission-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .mission-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 700px) {
  .app-shell {
    padding: 1.35rem;
  }

  .brand-logo {
    width: 190px;
  }

  .mode-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-icon {
    width: 126px;
  }

  .mission-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
    align-items: stretch;
    gap: 1.2rem;
  }

  .mission-card {
    padding: 1.35rem;
  }

  .mission-copy {
    padding: 1.15rem 1.2rem;
  }

  .mission-media {
    min-height: 270px;
  }

  .mission-media img {
    min-height: 270px;
  }

  .event-item {
    flex-basis: 360px;
    width: 360px;
    min-height: 575px;
  }

  .events-carousel {
    min-height: 610px;
  }

  .events-track {
    min-height: 590px;
  }

  .events-card {
    min-height: 760px;
  }

  .event-thumb {
    height: 455px;
    min-height: 455px;
  }
}
