@font-face {
  font-family: "Firefly";
  src: url("./fonts/AgencyFB-Bold.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #170821;
  --night-blue: #0c2844;
  --ocean: #0798c0;
  --panel: rgba(4, 49, 62, 0.92);
  --panel-soft: rgba(7, 69, 84, 0.84);
  --cyan: #12e5d2;
  --green: #12d86f;
  --yellow: #ffd51a;
  --white: #f9ffff;
  --muted: #a9c9d1;
  --danger: #ff766e;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 213, 26, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 14%, rgba(255, 213, 26, 0.18) 0 2px, transparent 3px),
    linear-gradient(180deg, var(--night) 0%, var(--night-blue) 42%, var(--ocean) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(100%, 760px); margin: 0 auto; }

.topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font: 2rem/1 "Firefly", Impact, sans-serif;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(18, 229, 210, 0.55);
  border-radius: 13px;
  color: var(--white);
  background: linear-gradient(180deg, #15d798, #08a89c);
  box-shadow: 0 5px 0 #046878, 0 0 18px rgba(18, 229, 210, 0.26);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
}

.brand { text-align: center; padding: 10px 0 18px; }
.brand img { width: min(88%, 420px); height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.42)); }
.brand p { margin: -8px 0 0; color: var(--muted); font: 1.2rem "Firefly", sans-serif; letter-spacing: 0.08em; }

.card {
  border: 1px solid rgba(18, 229, 210, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.30), inset 0 1px rgba(255, 255, 255, 0.06);
  padding: 20px;
}

.stack { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.nav-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  color: var(--white);
  text-decoration: none;
  align-content: center;
}
.nav-card strong, .section-title { font: 1.65rem/1 "Firefly", Impact, sans-serif; letter-spacing: 0.05em; text-transform: uppercase; }
.nav-card span, .muted { color: var(--muted); line-height: 1.5; }
.nav-icon { color: var(--yellow); font-size: 2rem; }

.intro { text-align: center; }
.intro h2 { margin: 0 0 8px; font: 2.2rem/1 "Firefly", Impact, sans-serif; letter-spacing: 0.05em; }
.intro p { margin: 0; color: var(--muted); line-height: 1.55; }

.rule {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}
.rule-number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--cyan), #08a795);
  color: #043642;
  font: 1.55rem "Firefly", sans-serif;
  box-shadow: 0 4px 0 #056b78;
}
.rule h3, .policy-section h2 { margin: 0 0 5px; font: 1.45rem "Firefly", sans-serif; letter-spacing: 0.03em; }
.rule p, .policy-section p { margin: 0; color: var(--muted); line-height: 1.6; }

.tile-demo { display: flex; justify-content: center; align-items: flex-end; min-height: 150px; padding: 14px 0; }
.tile { position: relative; width: 84px; height: 114px; margin: 0 -6px; filter: drop-shadow(6px 9px 8px rgba(0, 0, 0, 0.45)); }
.tile.base img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tile .face { position: absolute; left: 11%; top: 9%; width: 70%; height: 70%; object-fit: contain; }
.tile.is-free { transform: translateY(-18px); z-index: 2; }
.tile.is-free::after { content: "FREE"; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); color: var(--yellow); font: 1.05rem "Firefly", sans-serif; }
.tile.is-dim { filter: brightness(0.56) drop-shadow(6px 9px 8px rgba(0, 0, 0, 0.45)); }

.bonus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bonus { display: flex; align-items: center; gap: 12px; }
.bonus img { width: 52px; height: 62px; object-fit: contain; }
.bonus strong { display: block; font: 1.35rem "Firefly", sans-serif; }
.bonus span { color: var(--muted); font-size: 0.95rem; }

.field { display: grid; gap: 8px; }
.field label { color: var(--muted); font: 1.1rem "Firefly", sans-serif; letter-spacing: 0.04em; }
.field select, .field textarea {
  width: 100%;
  color: var(--white);
  border: 1px solid rgba(18, 229, 210, 0.38);
  border-radius: 13px;
  background: rgba(0, 21, 31, 0.52);
  padding: 14px;
  outline: none;
}
.field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(18, 229, 210, 0.13); }
.field textarea { min-height: 210px; resize: vertical; line-height: 1.55; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.9rem; }

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(18, 229, 210, 0.8);
  border-radius: 15px;
  color: var(--white);
  background: linear-gradient(180deg, #35df93, #08ad7b);
  box-shadow: 0 6px 0 #087082, 0 0 22px rgba(18, 229, 210, 0.22);
  font: 1.55rem "Firefly", Impact, sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.primary-button:disabled { opacity: 0.58; cursor: wait; }

.form-status { min-height: 24px; margin: 0; text-align: center; color: var(--muted); }
.form-status[data-state="success"] { color: #75f0a8; }
.form-status[data-state="error"] { color: var(--danger); }
.notice { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.policy-section + .policy-section { border-top: 1px solid rgba(18, 229, 210, 0.18); padding-top: 18px; }
.updated { text-align: center; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .nav-card { min-height: 108px; }
  .topbar h1 { font-size: 1.65rem; }
  .card { padding: 17px; }
}

@media (prefers-reduced-motion: no-preference) {
  .nav-card, .primary-button, .icon-button { transition: transform 150ms ease, filter 150ms ease; }
  .nav-card:active, .primary-button:active, .icon-button:active { transform: translateY(2px) scale(0.99); filter: brightness(0.92); }
}
