:root {
  /* Brand palette */
  --color-bg-top: #f44963;
  --color-bg-mid: #ef4059;
  --color-bg-bottom: #d73545;
  --color-brand-yellow: #faed77;
  --color-brand-yellow-shadow: #dbc842;
  --color-panel: #d32f47;
  --color-panel-shadow: #b62237;
  --color-white: #ffffff;
  --color-copy: #ffffff;
  --color-copy-muted: #656565;
  --color-separator: #912c20;

  /* Effects */
  --shadow-soft: 0 18px 30px rgba(115, 23, 39, 0.26);
  --shadow-panel: inset 0 18px 28px rgba(103, 19, 34, 0.30), inset 0 -10px 22px rgba(255, 104, 124, 0.12);

  /* Typography */
  --font-display: "all-round-gothic", "All Round Gothic", "Arial Rounded MT Bold", Arial, sans-serif;

  /* Frame and spacing */
  --frame-max-width: 460px;
  --frame-min-height: clamp(860px, calc(297px + 152.5cqw), 1000px);
  --header-height: clamp(66px, 18cqw, 84px);
  --space-screen-x: clamp(24px, 7cqw, 46px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #1f1f24;
}

body {
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-display);
  background: #1f1f24;
  color: var(--color-copy);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #1f1f24;
}

.app-screen {
  position: relative;
  container-type: inline-size;
  width: min(100%, var(--frame-max-width));
  min-height: max(100dvh, var(--frame-min-height));
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 113, 129, 0.18), transparent 34%),
    linear-gradient(180deg, var(--color-bg-top) 0%, var(--color-bg-mid) 52%, var(--color-bg-bottom) 100%);
}

@media (min-width: 560px) {
  .app-screen {
    min-height: var(--frame-min-height);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  }
}

.app-header {
  height: calc(var(--header-height) + var(--safe-top));
  padding: calc(12px + var(--safe-top)) clamp(12px, 3.8cqw, 22px) 10px;
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: clamp(138px, 38cqw, 174px);
  justify-self: center;
}

.icon-button {
  width: clamp(50px, 13.5cqw, 66px);
  aspect-ratio: 1;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 6px 4px rgba(86, 19, 28, 0.24));
  transition: transform 140ms ease, filter 140ms ease;
}

.icon-button:hover {
  transform: translateY(-1px) scale(1.02);
}

.icon-button:active {
  transform: translateY(2px) scale(0.98);
  filter: drop-shadow(0 3px 2px rgba(86, 19, 28, 0.28));
}

.menu-separator {
  width: 100%;
  height: 2px;
  background: var(--color-separator);
  opacity: 0.58;
}

.btn {
  position: relative;
  min-height: clamp(50px, 14cqw, 68px);
  border-radius: 999px;
  padding: 0 clamp(24px, 8cqw, 42px);
  color: #565656;
  font-size: clamp(22px, 6.4cqw, 33px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-primary {
  background: var(--color-brand-yellow);
  box-shadow: 0 9px 0 var(--color-brand-yellow-shadow), 0 12px 18px rgba(83, 27, 34, 0.22);
}

.btn-secondary {
  min-height: clamp(40px, 10.8cqw, 56px);
  background: var(--color-white);
  box-shadow: 0 8px 0 #b3b3b3, 0 10px 14px rgba(83, 27, 34, 0.18);
  font-size: clamp(18px, 5.1cqw, 27px);
}

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

.btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--color-brand-yellow-shadow), 0 6px 10px rgba(83, 27, 34, 0.18);
}

.btn-secondary:active {
  box-shadow: 0 2px 0 #b3b3b3, 0 6px 10px rgba(83, 27, 34, 0.18);
}

.life-badge {
  position: absolute;
  right: clamp(-30px, -5.6cqw, -20px);
  top: 50%;
  width: clamp(58px, 15.2cqw, 82px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
}

.life-badge img,
.life-badge strong {
  grid-area: 1 / 1;
}

.life-badge img {
  width: 100%;
}

.life-badge strong {
  color: var(--color-white);
  font-size: clamp(26px, 6.9cqw, 37px);
  line-height: 1;
  text-shadow:
    -2px -2px 0 #783142,
    2px -2px 0 #783142,
    -2px 2px 0 #783142,
    2px 2px 0 #783142,
    0 4px 2px rgba(91, 21, 36, 0.36);
  transform: translate(7%, 1%);
}

/* Wintapp theme primitives.
   Use these classes as the starting point for every new module screen. */

/* Screen layout */
.screen-content,
.dashboard-content {
  flex: 1;
  padding: clamp(30px, 8cqw, 48px) var(--space-screen-x) clamp(82px, 19cqw, 112px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-title {
  margin: 0 0 clamp(28px, 8cqw, 54px);
  color: var(--color-white);
  font-size: clamp(44px, 12.2cqw, 58px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

/* Raised red content block converted from the inner block SVG. */
.theme-panel,
.game-panel {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  padding: clamp(18px, 4.4cqw, 28px) clamp(12px, 3.4cqw, 18px) clamp(20px, 4.6cqw, 30px);
  border-radius: clamp(22px, 7cqw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 35%),
    var(--color-panel);
  box-shadow: var(--shadow-panel);
  text-align: center;
}

/* Media frame for images that need to align with the panel edges. */
.theme-media,
.game-preview {
  width: calc(100% + clamp(12px, 3.6cqw, 20px));
  margin-left: calc(clamp(6px, 1.8cqw, 10px) * -1);
  border-radius: clamp(18px, 6cqw, 30px);
  overflow: hidden;
}

.theme-media img,
.game-preview img {
  width: 100%;
}

/* Compact text block used inside red panels. */
.theme-copy,
.game-copy {
  margin-top: clamp(14px, 3.4cqw, 22px);
  color: var(--color-white);
}

.theme-copy h3,
.game-copy h3 {
  margin: 0 0 10px;
  font-size: clamp(18px, 4.5cqw, 24px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.theme-copy p,
.game-copy p {
  max-width: 39ch;
  margin: 0 auto;
  font-size: clamp(12px, 3.05cqw, 15px);
  font-weight: 500;
  line-height: 1.03;
}

/* Shared CTA zone. Keep primary/ranking buttons locked between screens. */
.screen-actions {
  position: absolute;
  left: var(--space-screen-x);
  right: var(--space-screen-x);
  bottom: clamp(156px, 36cqw, 178px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 6cqw, 38px);
}

.screen-actions .btn-play {
  width: min(340px, 68cqw);
}

.screen-actions .btn-secondary {
  width: min(210px, 48cqw);
}

/* Form fields converted from form_field.svg. */
.form-field,
.code-field {
  border: 0;
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-copy-muted);
  box-shadow:
    inset 0 3px 12px rgba(107, 107, 107, 0.30),
    0 2px 0 rgba(107, 107, 107, 0.16);
  outline: 0;
  text-align: center;
}

.form-field::placeholder {
  color: rgba(107, 107, 107, 0.34);
}

.form-field:focus,
.code-field:focus {
  box-shadow:
    inset 0 3px 12px rgba(107, 107, 107, 0.30),
    0 2px 0 rgba(107, 107, 107, 0.16),
    0 0 0 3px rgba(250, 237, 119, 0.72);
}

/* White countdown footer shared by campaign screens. */
.prize-countdown {
  position: relative;
  flex: 0 0 auto;
  padding: clamp(12px, 3cqw, 20px) var(--space-screen-x) calc(16px + var(--safe-bottom));
  background: var(--color-white);
  color: var(--color-bg-top);
  text-align: center;
}

.prize-countdown p {
  position: absolute;
  left: var(--space-screen-x);
  right: var(--space-screen-x);
  bottom: calc(100% + clamp(10px, 2.6cqw, 16px));
  margin: 0;
  color: var(--color-white);
  font-size: clamp(20px, 5.6cqw, 29px);
  font-weight: 700;
  line-height: 1.05;
}

.prize-countdown time {
  display: block;
  margin-top: 0;
  color: var(--color-bg-top);
  font-size: clamp(44px, 12.8cqw, 58px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

@media (max-width: 374px) {
  .screen-title {
    font-size: 48px;
  }

  .theme-panel,
  .game-panel {
    max-width: 320px;
  }
}

@media (max-height: 760px) {
  .screen-content,
  .dashboard-content {
    padding-top: 28px;
  }

  .screen-title {
    margin-bottom: 30px;
    font-size: clamp(44px, 12cqw, 56px);
  }

  .theme-panel,
  .game-panel {
    max-width: 318px;
    padding-bottom: 22px;
  }

  .theme-copy p,
  .game-copy p {
    font-size: 12px;
  }

  .screen-actions {
    bottom: 153px;
    gap: 24px;
  }
}

.loading-screen {
  display: grid;
  place-items: center;
}

.loading-content {
  width: 100%;
  padding: 0 var(--space-screen-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(clamp(-18px, -4cqw, -6px));
}

.loading-logo {
  width: clamp(200px, 55cqw, 268px);
}

.loading-tagline {
  margin: clamp(20px, 5cqw, 28px) 0 0;
  color: var(--color-white);
  font-size: clamp(20px, 5.4cqw, 26px);
  font-style: oblique;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
}

.loading-status {
  width: min(178px, 39cqw);
  margin-top: clamp(78px, 19.5cqw, 98px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-bar {
  width: 100%;
  height: clamp(23px, 6cqw, 29px);
  padding: 3px;
  border: 2px solid var(--color-white);
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: var(--loading-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--color-brand-yellow);
  transition: width 1100ms cubic-bezier(0.42, 0, 0.18, 1);
}

.loading-label {
  margin: clamp(30px, 7.6cqw, 38px) 0 0;
  color: var(--color-white);
  font-size: clamp(14px, 3.7cqw, 18px);
  font-style: oblique;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

@media (max-height: 760px) {
  .loading-content {
    transform: translateY(-4px);
  }

  .loading-logo {
    width: clamp(184px, 50cqw, 230px);
  }

  .loading-status {
    margin-top: 68px;
  }
}
