* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --green-dark: #0d3d1d;
  --green-main: #3f8f2d;
  --green-light: #79b957;

  --cream: #fff5d8;
  --cream-light: #fffbea;
  --cream-border: #e7c985;

  --gold: #ffd75a;
  --gold-deep: #dba727;
  --gold-glow: rgba(255, 215, 90, 0.95);

  --blue-board: #1f57b2;
  --blue-board-dark: #103f91;

  --text-dark: #10351d;
  --text-soft: #29462f;

  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.22);
  --shadow-strong: 0 15px 36px rgba(0, 0, 0, 0.28);
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Arial, sans-serif;
  min-height: 100dvh;

  color: var(--text-dark);

  background-color: #85c9f4;
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.05) 45%,
      rgba(0, 45, 12, 0.48) 100%
    ),
    url("assets/bgstartseitehandy.png?v=27");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background:
    radial-gradient(circle at 84% 8%, rgba(255, 255, 210, 0.55), transparent 18%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.25), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 45, 12, 0.18));
}

body.game-active {
  overflow: hidden;
}

.app {
  position: relative;
  z-index: 1;

  width: 100%;
  max-width: 760px;
  min-height: 100dvh;

  padding: clamp(12px, 2.8dvh, 24px) clamp(12px, 3vw, 22px) 14px;
  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.screen {
  display: none;
  width: 100%;
}

.screen.active {
  display: block;
}

#startScreen.screen.active {
  min-height: calc(100dvh - 62px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding-bottom: clamp(6px, 2dvh, 18px);
}

#tokenScreen.screen.active {
  min-height: calc(100dvh - 62px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  padding-top: clamp(4px, 2dvh, 18px);
  padding-bottom: clamp(8px, 2dvh, 18px);

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#gameScreen.screen.active {
  min-height: calc(100dvh - 62px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding-bottom: clamp(4px, 1.5dvh, 14px);
}

#winnerScreen.screen.active {
  min-height: calc(100dvh - 62px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding-bottom: clamp(8px, 2dvh, 18px);
}

.brand-logo {
  display: block;
  width: clamp(150px, 46vw, 290px);
  max-height: clamp(72px, 15dvh, 125px);
  object-fit: contain;

  margin: 0 auto clamp(5px, 1.2dvh, 10px);

  filter:
    drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.35));
}

.brand-logo-small {
  width: clamp(135px, 40vw, 240px);
  max-height: clamp(62px, 13dvh, 110px);
  margin-bottom: clamp(4px, 1dvh, 8px);
}

.brand-logo-game {
  width: clamp(125px, 34vw, 220px);
  max-height: clamp(58px, 11dvh, 98px);
  margin-bottom: clamp(3px, 0.8dvh, 6px);
}

.season-divider {
  width: min(68%, 380px);
  height: clamp(14px, 2.5dvh, 22px);
  margin: 0 auto clamp(4px, 1dvh, 8px);

  display: flex;
  justify-content: center;
  align-items: center;
}

.season-divider::before,
.season-divider::after {
  content: "";
  display: block;
  height: 2px;
  flex: 1;
  max-width: 150px;

  background: rgba(16, 53, 29, 0.62);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.season-divider span {
  width: 36px;
  height: 22px;
  margin: 0 12px;

  background:
    radial-gradient(ellipse at 35% 45%, #69b23d 0 28%, transparent 30%),
    radial-gradient(ellipse at 65% 45%, #3e8a2f 0 28%, transparent 30%),
    radial-gradient(ellipse at 50% 72%, #5da035 0 26%, transparent 28%);
}

h1 {
  margin: 0 0 clamp(8px, 1.8dvh, 14px);

  font-size: clamp(2.05rem, 8.2vw, 4.05rem);
  line-height: 1;
  letter-spacing: -0.035em;

  color: var(--green-dark);

  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 20px rgba(255, 255, 255, 0.62),
    0 6px 16px rgba(0, 0, 0, 0.22);
}

h2 {
  font-size: clamp(1.25rem, 4.8vw, 2rem);
  line-height: 1.2;
  margin: 0 0 clamp(8px, 1.8dvh, 14px);

  color: var(--green-dark);

  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.92),
    0 0 14px rgba(255, 255, 255, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.16);
}

p {
  line-height: 1.4;
}

.intro-text {
  max-width: 520px;
  margin: 0 auto clamp(12px, 2.2dvh, 18px);

  color: #3b2418;
  font-size: clamp(1.05rem, 4.2vw, 1.45rem);
  font-weight: 900;

  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.88),
    0 0 14px rgba(255, 255, 255, 0.52),
    0 4px 11px rgba(0, 0, 0, 0.12);
}

.rules {
  width: min(100%, 560px);

  margin: clamp(8px, 1.8dvh, 16px) auto clamp(12px, 2.2dvh, 20px);
  padding: clamp(11px, 2dvh, 16px) clamp(13px, 3vw, 18px);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  background:
    linear-gradient(180deg, rgba(255, 253, 238, 0.98), rgba(255, 240, 196, 0.98));

  border: 2px solid rgba(231, 201, 133, 0.95);
  border-radius: 28px;

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(181, 124, 34, 0.12),
    0 9px 22px rgba(0, 0, 0, 0.18);

  color: #3b2418;
  font-size: clamp(0.95rem, 3.7vw, 1.15rem);
  font-weight: 800;

  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.82),
    0 0 12px rgba(255, 255, 255, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.rules-icon {
  flex: 0 0 auto;
  font-size: clamp(1.55rem, 6vw, 2.1rem);
  line-height: 1;
}

button {
  position: relative;

  border: none;
  width: min(100%, 430px);

  min-height: 60px;
  padding: 13px 22px;
  margin: 8px auto;

  border-radius: 999px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;

  color: white;

  font-size: clamp(1rem, 4.1vw, 1.22rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.075em;

  cursor: pointer;

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.35),
    inset 0 -5px 10px rgba(0, 0, 0, 0.2),
    0 10px 22px rgba(0, 0, 0, 0.24);

  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button::before {
  content: attr(data-icon);
  flex: 0 0 auto;

  font-size: 1.55rem;
  line-height: 1;

  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.18));
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px) scale(0.995);

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.22),
    inset 0 -3px 7px rgba(0, 0, 0, 0.25),
    0 5px 13px rgba(0, 0, 0, 0.24);
}

.player-buttons {
  width: min(100%, 430px);

  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.4dvh, 10px);

  margin: 0 auto;
}

.player-buttons button {
  width: 100%;
  margin: 0;
}

.player-buttons button,
.restart-button {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(180deg, var(--green-light), var(--green-main) 48%, #286e22);

  border: 2px solid rgba(232, 213, 141, 0.9);

  color: white;

  text-shadow:
    0 1px 0 rgba(0, 65, 18, 0.55),
    0 4px 8px rgba(0, 0, 0, 0.22);
}

.scan-next-button {
  background:
    linear-gradient(180deg, var(--cream-light), var(--cream) 52%, #f0dca8);

  border: 2px solid rgba(231, 201, 133, 0.95);

  color: var(--green-dark);

  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.78),
    0 0 10px rgba(255, 255, 255, 0.42),
    0 1px 6px rgba(255, 255, 255, 0.22);

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.95),
    inset 0 -5px 9px rgba(159, 105, 30, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

.scan-next-button.secondary {
  width: auto;
  min-width: 0;
  max-width: none;

  min-height: 38px;
  padding: 7px 14px;
  margin-top: clamp(10px, 2dvh, 16px);

  gap: 8px;

  font-size: clamp(0.68rem, 2.65vw, 0.82rem);
  letter-spacing: 0.035em;

  border-width: 1.5px;

  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    inset 0 -3px 6px rgba(159, 105, 30, 0.12),
    0 5px 12px rgba(0, 0, 0, 0.14);

  opacity: 0.94;
}

.scan-next-button.secondary::before {
  font-size: 1rem;
}

#winnerScreen .restart-button {
  width: min(100%, 340px);

  min-height: 50px;
  padding: 10px 18px;
  margin: 7px auto;

  font-size: clamp(0.88rem, 3.4vw, 1rem);
  letter-spacing: 0.045em;
}

#winnerScreen .restart-button::before {
  font-size: 1.2rem;
}

#winnerScreen .scan-next-button {
  width: auto;
  min-width: 210px;
  max-width: 300px;

  min-height: 38px;
  padding: 7px 14px;
  margin: 5px auto 0;

  gap: 8px;

  font-size: clamp(0.68rem, 2.6vw, 0.82rem);
  letter-spacing: 0.03em;
  white-space: nowrap;

  border-width: 1.5px;

  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    inset 0 -3px 6px rgba(159, 105, 30, 0.12),
    0 5px 12px rgba(0, 0, 0, 0.14);

  opacity: 0.94;
}

#winnerScreen .scan-next-button::before {
  font-size: 1rem;
}

.token-title {
  max-width: 640px;
  margin: 0 auto clamp(10px, 2dvh, 16px);

  color: var(--green-dark);
}

.token-grid {
  width: min(100%, 640px);

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.2vw, 14px);

  margin: 0 auto;
}

.token-option {
  position: relative;

  min-height: clamp(145px, 22dvh, 185px);

  background:
    linear-gradient(180deg, rgba(255, 253, 238, 0.98), rgba(255, 246, 218, 0.98));

  border-radius: 24px;
  padding: clamp(11px, 2dvh, 16px) 10px;

  border: 2px solid rgba(231, 201, 133, 0.86);
  cursor: pointer;

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.96),
    inset 0 -4px 8px rgba(159, 105, 30, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.2);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;

  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;

  touch-action: pan-y;
}

.token-option:hover {
  transform: translateY(-1px);
  border-color: rgba(86, 143, 45, 0.9);

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.96),
    inset 0 -4px 8px rgba(159, 105, 30, 0.08),
    0 14px 30px rgba(0, 0, 0, 0.24);
}

.token-option:active {
  transform: translateY(1px) scale(0.995);
}

.token-option.selected {
  pointer-events: none;

  border-color: rgba(255, 215, 90, 1);

  background:
    linear-gradient(180deg, rgba(255, 255, 245, 1), rgba(255, 232, 151, 0.98));

  animation: tokenSelectPop 0.48s cubic-bezier(0.18, 0.95, 0.25, 1.15) both;

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.96),
    inset 0 -4px 8px rgba(159, 105, 30, 0.08),
    0 0 0 4px rgba(255, 255, 255, 0.74),
    0 0 24px rgba(255, 215, 90, 0.9),
    0 14px 30px rgba(0, 0, 0, 0.24);
}

.token-option.selected .token-preview {
  animation: tokenLogoGlow 0.48s ease-out both;
}

.token-option.disabled {
  opacity: 0.34;
  pointer-events: none;
}

.token-option strong {
  display: block;
  margin-top: 10px;

  font-size: clamp(0.98rem, 3.8vw, 1.28rem);
  line-height: 1.15;
  font-weight: 900;

  color: var(--green-dark);

  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.88),
    0 0 12px rgba(255, 255, 255, 0.52),
    0 2px 8px rgba(255, 255, 255, 0.18);
}

.token-preview {
  width: clamp(72px, 14dvh, 88px);
  height: clamp(72px, 14dvh, 88px);
  margin: 0 auto 8px;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  font-weight: bold;
  color: white;
  overflow: hidden;

  border: clamp(5px, 1.2vw, 7px) solid currentColor;

  background:
    radial-gradient(circle at 50% 36%, #ffffff, #fff4cf 82%);

  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 6px 14px rgba(0, 0, 0, 0.18);

  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.token-preview-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  background:
    radial-gradient(circle at 50% 35%, #ffffff, #fff8df 84%);

  overflow: hidden;
}

.token-preview img {
  width: 78%;
  height: 78%;
  object-fit: contain;

  -webkit-user-drag: none;
  pointer-events: none;
}

.token-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;

  justify-content: center;
  align-items: center;

  font-size: 1.4rem;
  font-weight: bold;
  color: white;
}

.token-actions {
  width: min(100%, 440px);

  margin: clamp(10px, 2dvh, 16px) auto 0;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.token-actions button {
  width: auto;
  min-width: 0;
  max-width: 185px;
  flex: 1 1 0;

  min-height: 36px;
  padding: 6px 10px;
  margin: 0;

  font-size: clamp(0.62rem, 2.5vw, 0.76rem);
  letter-spacing: 0.025em;
}

.token-actions button::before {
  font-size: 0.92rem;
}

.token-restart-button {
  border-width: 1.5px;
}

.token-scan-button {
  border-width: 1.5px;
}

.game-header {
  width: min(100%, 620px);
  margin: 0 auto clamp(7px, 1.5dvh, 10px);
}

.game-header h2 {
  margin-bottom: 0;

  color: var(--green-dark);

  font-size: clamp(1.05rem, 4.1vw, 1.65rem);
  font-weight: 900;
}

.turn-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.turn-token {
  width: clamp(42px, 8dvh, 52px);
  height: clamp(42px, 8dvh, 52px);
  flex: 0 0 clamp(42px, 8dvh, 52px);

  border-radius: 50%;
  border: 5px solid currentColor;
  background: white;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.turn-token-inner {
  width: 100%;
  height: 100%;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at 50% 35%, #ffffff, #fff8df 84%);
  overflow: hidden;
}

.turn-token img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.turn-token-fallback {
  display: none;
  width: 100%;
  height: 100%;

  border-radius: 50%;

  align-items: center;
  justify-content: center;

  font-size: 0.9rem;
  color: white;
  font-weight: 900;
}

.turn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.turn-label {
  font-size: 0.78em;
  color: #3b2418;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.82),
    0 0 10px rgba(255, 255, 255, 0.42);
}

.turn-name {
  color: var(--green-dark);
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.88),
    0 0 12px rgba(255, 255, 255, 0.48);
}

.game-actions {
  width: min(100%, 620px);
  margin: clamp(8px, 1.8dvh, 12px) auto 0;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.game-actions button {
  width: auto;
  min-width: 0;
  max-width: 205px;
  flex: 1 1 0;

  min-height: 46px;
  padding: 8px 13px;
  margin: 0;

  font-size: clamp(0.7rem, 2.75vw, 0.9rem);
  letter-spacing: 0.04em;
}

.game-actions button::before {
  font-size: 1.1rem;
}

.board {
  --cols: 7;
  --rows: 6;
  --board-width: min(94vw, 660px);

  position: relative;

  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));

  gap: clamp(5px, 1.15vw, 9px);

  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(180deg, #2c6fd3 0%, var(--blue-board) 48%, var(--blue-board-dark) 100%);

  padding: clamp(9px, 2.2vw, 14px);
  border-radius: clamp(18px, 4vw, 24px);

  width: var(--board-width);
  aspect-ratio: var(--cols) / var(--rows);

  margin: 0 auto;
  overflow: hidden;

  border: 2px solid rgba(255, 255, 255, 0.58);

  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.18),
    0 16px 34px rgba(0, 0, 0, 0.28);
}

.board.has-winner {
  box-shadow:
    0 0 0 3px rgba(255, 215, 90, 0.85),
    0 0 30px rgba(255, 215, 90, 0.6),
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.18),
    0 18px 42px rgba(0, 0, 0, 0.32);
}

.board.has-winner .disc:not(.winning-disc) {
  opacity: 0.38;
  filter: saturate(0.65) brightness(0.86);
}

.win-line {
  position: absolute;
  height: clamp(8px, 2vw, 15px);

  transform-origin: left center;
  z-index: 3;

  border-radius: 999px;
  pointer-events: none;

  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), var(--gold), var(--gold-deep), var(--gold), rgba(255, 255, 255, 0.92));

  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.58),
    0 0 18px rgba(255, 215, 90, 0.86),
    0 0 34px rgba(255, 215, 90, 0.66);

  animation: winLineGlow 1.25s ease-in-out infinite alternate;
}

.cell {
  position: relative;
  z-index: 1;

  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;

  background:
    radial-gradient(circle at 50% 35%, #fffdf0 0 52%, #ead89f 100%);

  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;

  box-shadow:
    inset 0 4px 8px rgba(66, 44, 14, 0.22),
    inset 0 -2px 4px rgba(255, 255, 255, 0.75);

  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.cell::after {
  content: "";
  position: absolute;
  inset: -5px;

  border-radius: 50%;
  pointer-events: none;

  opacity: 0;
}

.cell.active-column::after {
  animation: none;
}

.cell:hover {
  background:
    radial-gradient(circle at 50% 35%, #fff5bf 0 52%, #eac15c 100%);
}

.cell:active {
  background:
    radial-gradient(circle at 50% 35%, #ffe986 0 52%, #dca63d 100%);
}

.cell.winning-cell {
  z-index: 4;

  background:
    radial-gradient(circle at 50% 35%, #fffbe0 0 46%, #ffd75a 72%, #dba727 100%);

  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.9),
    inset 0 -4px 8px rgba(124, 83, 0, 0.22),
    0 0 16px rgba(255, 215, 90, 0.76);
}

.disc {
  width: 92%;
  height: 92%;
  min-width: 0;
  min-height: 0;

  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;

  background: white;
  border: 6px solid currentColor;

  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 3px 7px rgba(0, 0, 0, 0.24);

  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.disc.last-placed {
  animation: discFallOnly 0.9s ease-out both;
}

.disc.winning-disc {
  position: relative;
  z-index: 5;

  animation:
    winPulseCalm 1.05s ease-in-out infinite alternate,
    winGlowCalm 1.35s ease-in-out infinite;
}

.disc-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  background:
    radial-gradient(circle at 50% 36%, #ffffff, #fff7e6 82%);

  overflow: hidden;
}

.disc img {
  width: 76%;
  height: 76%;
  object-fit: contain;

  -webkit-user-drag: none;
  pointer-events: none;
}

.disc-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;

  justify-content: center;
  align-items: center;

  font-size: clamp(0.8rem, 3vw, 1.4rem);
  font-weight: bold;
  color: white;
}

@keyframes tokenSelectPop {
  0% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1.015);
  }
}

@keyframes tokenLogoGlow {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.12);
    box-shadow:
      inset 0 -4px 8px rgba(0, 0, 0, 0.12),
      inset 0 2px 4px rgba(255, 255, 255, 0.9),
      0 0 0 5px rgba(255, 255, 255, 0.8),
      0 0 24px rgba(255, 215, 90, 0.9);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes discFallOnly {
  0% {
    transform: translateY(-260%);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes winPulseCalm {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}

@keyframes winGlowCalm {
  0% {
    box-shadow:
      0 0 0 2px rgba(255, 215, 90, 0.62),
      0 0 15px rgba(255, 215, 90, 0.55),
      0 0 28px rgba(255, 215, 90, 0.3),
      inset 0 -4px 8px rgba(0, 0, 0, 0.18),
      inset 0 2px 4px rgba(255, 255, 255, 0.9);
  }

  50% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.75),
      0 0 23px rgba(255, 215, 90, 0.92),
      0 0 44px rgba(255, 215, 90, 0.62),
      inset 0 -4px 8px rgba(0, 0, 0, 0.18),
      inset 0 2px 4px rgba(255, 255, 255, 0.9);
  }

  100% {
    box-shadow:
      0 0 0 2px rgba(255, 215, 90, 0.62),
      0 0 15px rgba(255, 215, 90, 0.55),
      0 0 28px rgba(255, 215, 90, 0.3),
      inset 0 -4px 8px rgba(0, 0, 0, 0.18),
      inset 0 2px 4px rgba(255, 255, 255, 0.9);
  }
}

@keyframes winLineGlow {
  from {
    opacity: 0.82;
    filter: brightness(1);
  }

  to {
    opacity: 1;
    filter: brightness(1.16);
  }
}

#winnerText {
  width: min(100%, 560px);

  line-height: 1.4;

  margin: clamp(10px, 2dvh, 18px) auto;
  padding: clamp(16px, 3dvh, 22px) clamp(14px, 3vw, 18px);

  background:
    linear-gradient(180deg, rgba(255, 253, 238, 0.98), rgba(255, 246, 218, 0.98));

  border-radius: 26px;
  border: 2px solid rgba(231, 201, 133, 0.88);

  color: var(--green-dark);

  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.96),
    inset 0 -4px 8px rgba(159, 105, 30, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.22);
}

.winner-trophy {
  position: relative;

  width: fit-content;
  margin: 0 auto 12px;

  font-size: clamp(3.2rem, 14dvh, 5.4rem);
  line-height: 1;

  filter:
    drop-shadow(0 8px 10px rgba(99, 60, 0, 0.28))
    drop-shadow(0 0 18px rgba(255, 215, 90, 0.5));

  animation: trophyPop 1.25s cubic-bezier(0.18, 0.95, 0.25, 1.15) both;
}

.winner-trophy::before,
.winner-trophy::after {
  content: "✦";
  position: absolute;

  color: #ffd75a;
  font-size: 0.38em;

  opacity: 0;

  text-shadow:
    0 0 8px rgba(255, 215, 90, 0.95),
    0 0 18px rgba(255, 215, 90, 0.72);

  animation: trophySparkle 1.55s ease-out 0.18s both;
}

.winner-trophy::before {
  top: 0.05em;
  left: -0.5em;
}

.winner-trophy::after {
  top: 0.18em;
  right: -0.48em;
  animation-delay: 0.36s;
}

.winner-main {
  display: block;

  margin-top: 6px;

  font-size: clamp(1.08rem, 4.5vw, 1.65rem);
  font-weight: 900;
  line-height: 1.22;

  color: var(--green-dark);

  opacity: 0;
  animation: winnerTextReveal 0.7s ease-out 0.52s both;

  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.9),
    0 0 15px rgba(255, 255, 255, 0.56),
    0 3px 10px rgba(0, 0, 0, 0.12);
}

.winner-partner {
  display: inline-block;

  margin-top: 4px;
  padding: 3px 10px;

  border-radius: 999px;

  background:
    linear-gradient(180deg, #fff7d3, #f3d98d);

  color: #754800;

  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 9px rgba(0, 0, 0, 0.12);

  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.42);
}

.winner-thanks {
  display: block;

  margin-top: 13px;

  font-size: clamp(0.95rem, 3.5vw, 1.12rem);
  font-weight: 800;
  color: var(--text-soft);

  opacity: 0;
  animation: winnerTextReveal 0.7s ease-out 0.95s both;

  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.82),
    0 0 12px rgba(255, 255, 255, 0.44),
    0 2px 8px rgba(255, 255, 255, 0.18);
}

#winnerText small {
  display: block;
  margin-top: 12px;
  font-size: 1rem;
  font-weight: normal;
  color: var(--text-soft);

  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.78),
    0 0 10px rgba(255, 255, 255, 0.38);
}

@keyframes trophyPop {
  0% {
    transform: translateY(16px) scale(0.55) rotate(-7deg);
    opacity: 0;
  }

  48% {
    transform: translateY(-4px) scale(1.12) rotate(3deg);
    opacity: 1;
  }

  72% {
    transform: translateY(2px) scale(0.98) rotate(-1deg);
  }

  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes trophySparkle {
  0% {
    transform: scale(0.4) rotate(0deg);
    opacity: 0;
  }

  35% {
    transform: scale(1.25) rotate(16deg);
    opacity: 1;
  }

  100% {
    transform: scale(0.85) rotate(28deg);
    opacity: 0;
  }
}

@keyframes winnerTextReveal {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.footer {
  margin-top: auto;
  padding-top: 10px;

  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.96);

  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.76),
    0 0 12px rgba(255, 255, 255, 0.32),
    0 2px 4px rgba(0, 0, 0, 0.55);
}

.footer a {
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  font-weight: 700;
}

.footer span {
  margin: 0 4px;
}

img,
button,
.cell,
.disc,
.token-option,
.token-preview {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

img {
  pointer-events: none;
}

@media (min-width: 680px) and (orientation: portrait) {
  .token-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .token-option {
    min-height: clamp(150px, 18dvh, 180px);
  }
}

@media (max-width: 480px) {
  .app {
    padding: clamp(10px, 2.2dvh, 18px) 12px 12px;
  }

  .brand-logo {
    width: clamp(138px, 54vw, 250px);
    max-height: clamp(64px, 13dvh, 105px);
  }

  .brand-logo-small {
    width: clamp(128px, 48vw, 220px);
  }

  .brand-logo-game {
    width: clamp(118px, 44vw, 195px);
  }

  .season-divider {
    margin-bottom: 5px;
  }

  h1 {
    margin-bottom: 9px;
  }

  .intro-text {
    margin-bottom: 12px;
  }

  .rules {
    padding: 12px 13px;
    margin: 12px auto 16px;
    border-radius: 24px;
  }

  .rules-icon {
    font-size: 1.72rem;
  }

  button {
    width: min(100%, 390px);
    min-height: 56px;
    padding: 11px 18px;
    margin: 7px auto;

    font-size: 0.98rem;
    letter-spacing: 0.052em;
  }

  button::before {
    font-size: 1.34rem;
  }

  .player-buttons {
    width: min(100%, 390px);
    gap: 8px;
  }

  .scan-next-button.secondary {
    min-height: 34px;
    padding: 6px 12px;

    font-size: 0.66rem;
    letter-spacing: 0.025em;
  }

  .scan-next-button.secondary::before {
    font-size: 0.9rem;
  }

  #winnerScreen .restart-button {
    width: min(100%, 310px);

    min-height: 46px;
    padding: 9px 15px;

    font-size: clamp(0.78rem, 3vw, 0.92rem);
  }

  #winnerScreen .restart-button::before {
    font-size: 1.05rem;
  }

  #winnerScreen .scan-next-button {
    min-width: 188px;
    max-width: 265px;

    min-height: 34px;
    padding: 6px 12px;

    font-size: clamp(0.62rem, 2.45vw, 0.74rem);
    letter-spacing: 0.02em;
  }

  #winnerScreen .scan-next-button::before {
    font-size: 0.88rem;
  }

  .token-title {
    font-size: clamp(1.08rem, 4.2vw, 1.5rem);
    margin-bottom: 10px;
  }

  .token-grid {
    gap: 10px;
  }

  .token-option {
    min-height: clamp(128px, 19dvh, 158px);
    padding: 10px 7px;
    border-radius: 22px;
  }

  .token-preview {
    width: clamp(62px, 12dvh, 76px);
    height: clamp(62px, 12dvh, 76px);
    border-width: 5px;
  }

  .token-option strong {
    font-size: clamp(0.88rem, 3.5vw, 1.08rem);
    margin-top: 7px;
  }

  .token-actions {
    width: min(100%, 360px);
    gap: 7px;
    margin-top: 10px;
  }

  .token-actions button {
    max-width: 170px;
    min-height: 33px;
    padding: 5px 8px;

    font-size: clamp(0.56rem, 2.3vw, 0.68rem);
  }

  .token-actions button::before {
    font-size: 0.82rem;
  }

  .turn-status {
    gap: 9px;
  }

  .turn-token {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    border-width: 4px;
  }

  .game-header {
    margin-bottom: 7px;
  }

  .board {
    border-radius: 20px;
  }

  .game-actions {
    width: min(100%, 440px);
    gap: 8px;
    margin-top: 9px;
  }

  .game-actions button {
    max-width: none;
    min-height: 41px;
    padding: 7px 8px;

    font-size: clamp(0.62rem, 2.6vw, 0.78rem);
    letter-spacing: 0.02em;
  }

  .game-actions button::before {
    font-size: 0.98rem;
  }

  .disc {
    border-width: 4px;
  }

  .winner-trophy {
    font-size: clamp(3rem, 13dvh, 4.5rem);
    margin-bottom: 9px;
  }

  .footer {
    font-size: 0.72rem;
    padding-top: 8px;
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  .brand-logo {
    width: clamp(128px, 45vw, 220px);
    max-height: 86px;
  }

  .brand-logo-small {
    width: clamp(118px, 40vw, 190px);
    max-height: 78px;
  }

  h1 {
    font-size: clamp(1.85rem, 7.6vw, 3.2rem);
  }

  .intro-text {
    font-size: clamp(0.98rem, 3.9vw, 1.2rem);
    margin-bottom: 10px;
  }

  .rules {
    font-size: clamp(0.88rem, 3.4vw, 1rem);
    padding: 10px 12px;
    margin: 9px auto 12px;
  }

  .player-buttons {
    gap: 7px;
  }

  .player-buttons button {
    min-height: 50px;
  }

  .token-option {
    min-height: clamp(118px, 18dvh, 145px);
  }

  .token-preview {
    width: clamp(58px, 11dvh, 70px);
    height: clamp(58px, 11dvh, 70px);
  }

  .scan-next-button.secondary {
    margin-top: 9px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body {
    align-items: stretch;
  }

  .app {
    max-width: none;
    min-height: 100dvh;
    width: 100%;
    padding: 8px;

    display: flex;
    justify-content: center;
  }

  #startScreen.screen.active {
    max-width: 780px;
    margin: 0 auto;
    min-height: calc(100dvh - 16px);
    height: calc(100dvh - 16px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 10px 12px;

    justify-content: center;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #startScreen .brand-logo {
    width: min(23vw, 170px);
    max-height: 70px;
    margin-bottom: 2px;
  }

  #startScreen .season-divider {
    height: 12px;
    margin-bottom: 1px;
  }

  #startScreen h1 {
    font-size: clamp(1.65rem, 4.8vw, 2.45rem);
    margin-bottom: 5px;
  }

  #startScreen .intro-text {
    margin-bottom: 5px;
    font-size: clamp(0.82rem, 2.45vw, 1rem);
  }

  #startScreen .rules {
    max-width: 560px;
    margin: 6px auto 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  #startScreen .player-buttons {
    max-width: 460px;
    gap: 5px;
  }

  #startScreen .player-buttons button {
    min-height: 39px;
    padding: 7px 12px;
    font-size: 0.76rem;
  }

  #startScreen .scan-next-button.secondary {
    min-height: 31px;
    padding: 5px 11px;
    margin-top: 7px;
    font-size: 0.62rem;
  }

  #tokenScreen.screen.active {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    min-height: calc(100dvh - 16px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 10px 14px;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #tokenScreen .brand-logo {
    width: min(22vw, 160px);
    max-height: 62px;
    margin-bottom: 1px;
  }

  #tokenScreen .season-divider {
    display: none;
  }

  #tokenScreen .token-title {
    font-size: clamp(0.95rem, 3vw, 1.24rem);
    margin: 0 0 7px;
  }

  #tokenScreen .token-grid {
    width: min(100%, 720px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
    padding-bottom: 6px;
  }

  #tokenScreen .token-option {
    min-height: clamp(90px, 25dvh, 118px);
    padding: 7px 6px;
    border-radius: 18px;
  }

  #tokenScreen .token-preview {
    width: clamp(48px, 12dvh, 68px);
    height: clamp(48px, 12dvh, 68px);
    border-width: 4px;
    margin: 0 auto 4px;
  }

  #tokenScreen .token-option strong {
    font-size: clamp(0.78rem, 2.25vw, 1rem);
    margin-top: 4px;
  }

  #tokenScreen .token-actions {
    width: min(100%, 360px);
    margin: 5px auto 0;
    gap: 7px;
  }

  #tokenScreen .token-actions button {
    max-width: 165px;
    min-height: 30px;
    padding: 5px 9px;

    font-size: 0.56rem;
  }

  #tokenScreen .token-actions button::before {
    font-size: 0.76rem;
  }

  #gameScreen.screen.active {
    width: 100%;
    min-height: calc(100dvh - 16px);
    height: calc(100dvh - 16px);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }

  #gameScreen .brand-logo,
  #gameScreen .game-divider {
    display: none;
  }

  .game-header {
    width: min(96vw, 760px);
    margin: 0 auto 1px;

    display: flex;
    justify-content: center;
    align-items: center;
  }

  .game-header h2 {
    font-size: clamp(0.82rem, 2.15vw, 1.08rem);
    margin: 0;
  }

  .turn-status {
    justify-content: center;
    gap: 7px;
  }

  .turn-token {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
    border-width: 3px;
  }

  .board {
    margin: 0 auto;
    border-radius: 18px;
  }

  .game-actions {
    width: min(96vw, 500px);
    margin: 3px auto 0;
    gap: 7px;
  }

  .game-actions button {
    min-height: 35px;
    max-width: 170px;
    padding: 6px 9px;

    font-size: clamp(0.56rem, 1.65vw, 0.7rem);
    letter-spacing: 0.02em;
  }

  .game-actions button::before {
    font-size: 0.9rem;
  }

  #winnerScreen.screen.active {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 10px 14px;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #winnerScreen .brand-logo {
    width: min(20vw, 140px);
    max-height: 58px;
    margin-bottom: 1px;
  }

  #winnerScreen .season-divider {
    display: none;
  }

  #winnerText {
    max-width: 560px;
    margin: 7px auto 9px;
    padding: 13px 16px;
  }

  .winner-trophy {
    font-size: clamp(2.5rem, 10vw, 3.8rem);
    margin-bottom: 5px;
  }

  .winner-main {
    font-size: clamp(0.92rem, 2.65vw, 1.25rem);
  }

  .winner-thanks {
    font-size: clamp(0.78rem, 2.1vw, 0.95rem);
    margin-top: 7px;
  }

  #winnerScreen .restart-button {
    width: min(100%, 290px);

    margin: 5px auto;
    min-height: 37px;
    padding: 7px 12px;

    font-size: 0.72rem;
  }

  #winnerScreen .restart-button::before {
    font-size: 0.95rem;
  }

  #winnerScreen .scan-next-button {
    min-width: 165px;
    max-width: 235px;

    margin: 4px auto 0;
    min-height: 30px;
    padding: 5px 10px;

    font-size: 0.58rem;
    letter-spacing: 0.015em;
  }

  #winnerScreen .scan-next-button::before {
    font-size: 0.78rem;
  }

  .footer {
    display: none;
  }

  body.game-active .app {
    padding: 8px;
  }
}

@media (orientation: landscape) and (max-height: 420px) {
  #startScreen.screen.active {
    padding: 3px 8px 9px;
  }

  #startScreen .brand-logo {
    width: min(20vw, 125px);
    max-height: 48px;
  }

  #startScreen h1 {
    font-size: clamp(1.35rem, 4.1vw, 1.85rem);
    margin-bottom: 4px;
  }

  #startScreen .intro-text {
    margin-bottom: 4px;
    font-size: 0.74rem;
  }

  #startScreen .rules {
    padding: 6px 10px;
    margin: 5px auto 6px;
    font-size: 0.7rem;
  }

  #startScreen .rules-icon {
    font-size: 1.16rem;
  }

  #startScreen .player-buttons {
    gap: 4px;
    max-width: 420px;
  }

  #startScreen .player-buttons button {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 0.68rem;
  }

  #startScreen .scan-next-button.secondary {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.56rem;
  }

  #tokenScreen.screen.active {
    padding: 4px 8px 10px;
  }

  #tokenScreen .brand-logo {
    width: min(18vw, 115px);
    max-height: 44px;
  }

  #tokenScreen .token-title {
    font-size: clamp(0.78rem, 2.55vw, 1rem);
    margin-bottom: 6px;
  }

  #tokenScreen .token-grid {
    gap: 7px;
  }

  #tokenScreen .token-option {
    min-height: clamp(75px, 23dvh, 92px);
    padding: 6px 5px;
    border-radius: 15px;
  }

  #tokenScreen .token-preview {
    width: clamp(40px, 12dvh, 55px);
    height: clamp(40px, 12dvh, 55px);
    border-width: 3px;
    margin: 0 auto 3px;
  }

  #tokenScreen .token-option strong {
    font-size: clamp(0.7rem, 2vw, 0.86rem);
  }

  #tokenScreen .token-actions {
    width: min(100%, 320px);
    gap: 6px;
    margin-top: 4px;
  }

  #tokenScreen .token-actions button {
    max-width: 150px;
    min-height: 27px;
    padding: 4px 8px;

    font-size: 0.5rem;
  }

  #tokenScreen .token-actions button::before {
    font-size: 0.68rem;
  }

  #gameScreen.screen.active {
    gap: 4px;
  }

  .game-header h2 {
    font-size: clamp(0.72rem, 1.95vw, 0.92rem);
  }

  .turn-token {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-width: 3px;
  }

  .game-actions {
    width: min(96vw, 420px);
    margin-top: 2px;
    gap: 6px;
  }

  .game-actions button {
    min-height: 31px;
    padding: 5px 7px;

    font-size: clamp(0.5rem, 1.45vw, 0.64rem);
  }

  .game-actions button::before {
    font-size: 0.78rem;
  }

  .disc {
    border-width: 3px;
  }

  .win-line {
    height: clamp(6px, 1.8vw, 11px);
  }

  #winnerScreen .brand-logo {
    width: min(17vw, 100px);
    max-height: 40px;
  }

  #winnerText {
    margin: 5px auto 7px;
    padding: 10px 13px;
  }

  .winner-trophy {
    font-size: clamp(2rem, 8vw, 2.9rem);
    margin-bottom: 3px;
  }

  .winner-main {
    font-size: clamp(0.78rem, 2.2vw, 1rem);
  }

  .winner-thanks {
    font-size: clamp(0.66rem, 1.8vw, 0.82rem);
    margin-top: 5px;
  }

  #winnerScreen .restart-button {
    width: min(100%, 250px);

    min-height: 31px;
    padding: 5px 9px;

    font-size: 0.62rem;
  }

  #winnerScreen .restart-button::before {
    font-size: 0.78rem;
  }

  #winnerScreen .scan-next-button {
    min-width: 145px;
    max-width: 205px;

    min-height: 26px;
    padding: 4px 8px;

    font-size: 0.52rem;
  }

  #winnerScreen .scan-next-button::before {
    font-size: 0.68rem;
  }
}