:root {
  --sky: #c5e3fb;
  --sky-deep: #8ec5f0;
  --page: #d9ecfc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(255, 255, 255, 0.95);
  --text: #1a2d3d;
  --muted: #5a6f82;
  --title-yellow: #ffc53d;
  --title-orange: #ff8c1a;
  --accent: #1e88e5;
  --accent-dark: #1565c0;
  --success: #00a86b;
  --font: "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 360px) {
  html {
    font-size: 14px;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: #b9daf5;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 130% 90% at 50% -30%, rgba(255, 255, 255, 0.85), transparent 52%),
    radial-gradient(ellipse 100% 70% at 100% 15%, rgba(255, 220, 160, 0.35), transparent 48%),
    radial-gradient(ellipse 90% 80% at 0% 90%, rgba(100, 200, 255, 0.28), transparent 55%),
    linear-gradient(
      168deg,
      #8ec8f8 0%,
      #c2e4ff 22%,
      #e8f4ff 48%,
      #b8daf8 78%,
      #9ec8ef 100%
    );
}

.bg-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background:
    radial-gradient(at 12% 18%, rgba(255, 200, 120, 0.22) 0%, transparent 42%),
    radial-gradient(at 88% 12%, rgba(255, 150, 180, 0.14) 0%, transparent 38%),
    radial-gradient(at 92% 78%, rgba(80, 180, 255, 0.2) 0%, transparent 45%),
    radial-gradient(at 8% 85%, rgba(160, 255, 220, 0.12) 0%, transparent 40%),
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.045) 0 1px,
      transparent 1px 14px
    ),
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 11px,
      rgba(255, 255, 255, 0.07) 11px 12px
    );
  animation: mesh-pulse 14s ease-in-out infinite alternate;
}

@keyframes mesh-pulse {
  0% {
    opacity: 0.48;
    filter: saturate(1);
  }
  100% {
    opacity: 0.62;
    filter: saturate(1.12);
  }
}

.bg-stars {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 15%, transparent 72%);
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: soft-light;
  will-change: transform;
}

.bg-blob--sun {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  top: -12%;
  right: -18%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 240, 200, 0.95) 0%,
    rgba(255, 190, 120, 0.35) 42%,
    transparent 68%
  );
  animation: blob-a 24s ease-in-out infinite;
}

.bg-blob--sea {
  width: min(95vw, 360px);
  height: min(95vw, 360px);
  bottom: -28%;
  left: -22%;
  background: radial-gradient(
    circle at 60% 40%,
    rgba(120, 210, 255, 0.55) 0%,
    rgba(80, 160, 240, 0.2) 45%,
    transparent 70%
  );
  animation: blob-b 28s ease-in-out infinite;
}

.bg-blob--coral {
  width: min(55vw, 200px);
  height: min(55vw, 200px);
  top: 42%;
  right: -8%;
  background: radial-gradient(
    circle,
    rgba(255, 160, 190, 0.4) 0%,
    rgba(255, 120, 160, 0.12) 50%,
    transparent 68%
  );
  animation: blob-c 20s ease-in-out infinite;
}

.bg-blob--mint {
  width: min(50vw, 180px);
  height: min(50vw, 180px);
  top: 18%;
  left: -12%;
  background: radial-gradient(
    circle,
    rgba(180, 255, 230, 0.35) 0%,
    rgba(100, 220, 200, 0.12) 52%,
    transparent 70%
  );
  animation: blob-d 22s ease-in-out infinite;
}

@keyframes blob-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-14px, 18px) scale(1.06);
  }
}

@keyframes blob-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(18px, -12px) scale(1.05);
  }
}

@keyframes blob-c {
  0%,
  100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-10px, 8px);
  }
  66% {
    transform: translate(6px, -14px);
  }
}

@keyframes blob-d {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(12px, 10px) rotate(8deg);
  }
}

.bg-ribbon {
  position: absolute;
  left: -20%;
  top: 55%;
  width: 140%;
  height: 38%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 35%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.12) 65%,
    transparent 100%
  );
  transform: rotate(-8deg);
  animation: ribbon-sweep 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ribbon-sweep {
  0% {
    opacity: 0.35;
    transform: rotate(-8deg) translateX(-4%);
  }
  100% {
    opacity: 0.55;
    transform: rotate(-8deg) translateX(4%);
  }
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  .bg-mesh,
  .bg-blob--sun,
  .bg-blob--sea,
  .bg-blob--coral,
  .bg-blob--mint,
  .bg-ribbon {
    animation: none;
  }

  .bg-mesh {
    opacity: 0.55;
  }
}

.top-bar {
  position: relative;
  z-index: 2;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(30, 136, 229, 0.12);
}

.ticker-wrap {
  overflow: hidden;
  padding: 4px 0;
}

.ticker {
  display: inline-flex;
  gap: 2rem;
  white-space: nowrap;
  animation: ticker 32s linear infinite;
}

.ticker-item {
  font-size: 0.65rem;
  color: var(--muted);
}

.ticker-item::before {
  content: "● ";
  color: var(--accent);
  font-size: 0.45rem;
  vertical-align: middle;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 0.35rem 0.6rem 0.5rem;
}

.promo-banner {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.4rem;
}

.promo-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.55rem;
  margin: 0;
  padding: 0.42rem 1rem 0.48rem;
  max-width: 100%;
  font-size: clamp(1.12rem, 4.2vw, 1.42rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.45) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 18px rgba(25, 90, 150, 0.12);
}

.promo-title-main,
.promo-title-sub {
  color: #ffb300;
  text-shadow:
    0 0 0 #fff,
    0 -1px 0 #fff,
    0 1px 0 #fff,
    -1px 0 0 #fff,
    1px 0 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 3px 6px rgba(21, 101, 192, 0.22);
}

.promo-title-main {
  white-space: nowrap;
}

.promo-title-sub {
  white-space: nowrap;
  letter-spacing: 0.12em;
}

.promo-title-divider {
  width: 3px;
  align-self: stretch;
  min-height: 1.05em;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(30, 136, 229, 0.55) 45%,
    rgba(255, 200, 120, 0.65) 100%
  );
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

@media (max-width: 340px) {
  .promo-title {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    letter-spacing: 0.06em;
  }

  .promo-title-divider {
    width: min(52%, 9rem);
    height: 3px;
    min-height: 0;
    align-self: center;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(30, 136, 229, 0.55) 50%,
      rgba(255, 200, 120, 0.65) 100%
    );
  }
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(30, 136, 229, 0.15);
  border-radius: 12px;
  padding: 0.45rem 0.5rem 0.55rem;
  margin-bottom: 0.4rem;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.65) inset,
    0 8px 24px rgba(25, 80, 130, 0.12);
}

.panel--games {
  padding-bottom: 0.4rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  padding: 0 0.1rem;
}

.panel-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.picked-game {
  font-size: 0.62rem;
  color: var(--muted);
  max-width: 58%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.game-tile {
  display: block;
  cursor: pointer;
  margin: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.game-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-tile-ui {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  aspect-ratio: 1;
  padding: 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid rgba(30, 136, 229, 0.12);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.game-tile input:focus-visible + .game-tile-ui {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.game-tile input:checked + .game-tile-ui {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
  background: rgba(227, 242, 253, 0.95);
}

.game-tile:hover .game-tile-ui {
  border-color: rgba(30, 136, 229, 0.35);
}

.game-tile-logo {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-tile-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.game-tile-name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field {
  display: block;
  margin-bottom: 0.4rem;
}

.field:last-of-type {
  margin-bottom: 0.35rem;
}

.field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.field input,
.select-wrap select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(30, 136, 229, 0.22);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: #94a8b8;
}

.field input:focus,
.select-wrap select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.15);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  pointer-events: none;
}

.select-wrap select {
  appearance: none;
  padding-right: 1.75rem;
  cursor: pointer;
}

.field-help {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.58rem;
  color: var(--muted);
}

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #42a5f5 0%, var(--accent) 45%, var(--accent-dark) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 0 #0d47a1, 0 6px 12px rgba(13, 71, 161, 0.25);
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-primary:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #0d47a1, 0 3px 8px rgba(13, 71, 161, 0.2);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.fine-print {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin: 0.35rem 0 0;
  font-size: 0.55rem;
  line-height: 1.35;
  color: var(--muted);
}

.icon-lock {
  flex-shrink: 0;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.05rem;
  opacity: 0.75;
}

.foot {
  text-align: center;
  margin-top: 0.25rem;
  font-size: 0.55rem;
  color: var(--muted);
  opacity: 0.9;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 40, 60, 0.45);
  backdrop-filter: blur(4px);
}

.loading-box {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  border: 1px solid rgba(30, 136, 229, 0.2);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  border: 3px solid rgba(30, 136, 229, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.loading-sub {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 40, 60, 0.45);
  backdrop-filter: blur(6px);
}

.modal {
  width: 100%;
  max-width: 340px;
  padding: 1.25rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(30, 136, 229, 0.2);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(20, 60, 100, 0.2);
  text-align: center;
}

.modal-icon-ok {
  color: var(--success);
  margin-bottom: 0.5rem;
}

.modal-icon-ok svg {
  width: 48px;
  height: 48px;
}

.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  margin: 0.65rem 0 1rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: left;
}

.modal-game-line {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(227, 242, 253, 0.9);
  border: 1px solid rgba(30, 136, 229, 0.2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
}

.modal-body strong {
  color: var(--accent-dark);
  font-weight: 600;
}

.btn-modal {
  width: 100%;
  padding: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #26c6da, #00acc1);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-modal:hover {
  opacity: 0.92;
}

.ip-limit-hint {
  margin: 0 0 0.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.62rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(30, 136, 229, 0.15);
  border-radius: 8px;
}

.modal--limit {
  border-color: rgba(229, 57, 53, 0.22);
}

.modal--limit .modal-title {
  color: #c62828;
}

.btn-modal--muted {
  background: linear-gradient(180deg, #78909c, #546e7a);
}

[hidden] {
  display: none !important;
}
