:root {
  --bg-deep: #070b14;
  --bg-card: rgba(15, 23, 42, 0.65);
  --ice: #7dd3fc;
  --ice-dim: #38bdf8;
  --frost: #e0f2fe;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --radius: 16px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--frost);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--bg-deep) 55%);
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Snow layer */
.snow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent);
  background-size: 200% 200%, 180% 180%, 100px 100px, 150px 150px;
  animation: drift 25s linear infinite;
  opacity: 0.7;
}

@keyframes drift {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 100% 100%, -50% 50%, 50px 80px, -30px 40px;
  }
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(to bottom, rgba(7, 11, 20, 0.95), rgba(7, 11, 20, 0.75));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--frost);
}

.brand__logo {
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(125, 211, 252, 0.25);
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--ice);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--frost);
  border-radius: 1px;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0 4rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 4rem 0 5rem;
  }
}

.hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice-dim);
}

.hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero__accent {
  background: linear-gradient(120deg, var(--ice), var(--frost));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0 0 2rem;
  max-width: 32ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--ice-dim), #0ea5e9);
  color: #0f172a;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.45);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--frost);
  background: rgba(15, 23, 42, 0.4);
}

.btn--ghost:hover {
  border-color: var(--ice);
  color: var(--ice);
}

.hero__visual {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__orb {
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(125, 211, 252, 0.35), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(56, 189, 248, 0.2), transparent 45%),
    linear-gradient(160deg, #1e293b, #0f172a);
  border: 1px solid var(--border);
  box-shadow:
    0 0 80px rgba(125, 211, 252, 0.15),
    inset 0 0 60px rgba(255, 255, 255, 0.05);
}

.section {
  padding: 3rem 0;
}

.section--alt {
  margin: 0 -1.5rem;
  padding: 3rem 1.5rem;
  background: rgba(15, 23, 42, 0.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head {
  margin-bottom: 2rem;
}

.section__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.section__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.cards {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(125, 211, 252, 0.35);
  transform: translateY(-4px);
}

.card__tag {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.card__tag--live {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.card__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.card__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.about {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .about {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.about__content p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 52ch;
}

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stats strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ice);
}

.stats span {
  font-size: 0.85rem;
  color: var(--muted);
}

.contact {
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(15, 23, 42, 0.35);
}

.contact__link {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ice);
  text-decoration: none;
}

.contact__link:hover {
  text-decoration: underline;
}

.contact__note {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 2rem;
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer__brand {
  color: var(--frost);
}

.nav__admin {
  color: var(--ice-dim) !important;
}

.nav--static {
  position: static;
  display: flex !important;
  padding: 0;
  background: transparent;
  border: none;
}

/* Game cards with media */
.cards--games {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .cards--games {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.card--game {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card--game:focus {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

.card__thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border-bottom: 1px solid var(--border);
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__thumb--empty {
  background:
    radial-gradient(circle at 50% 40%, rgba(125, 211, 252, 0.12), transparent 55%),
    linear-gradient(145deg, #1e293b, #0f172a);
}

.card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.card__play {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
  background: linear-gradient(180deg, #a8e063 0%, #56ab2f 100%);
  box-shadow: 0 2px 8px rgba(86, 171, 47, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.card__play:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(86, 171, 47, 0.45);
}

.card__hint {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ice-dim);
}

.games-empty {
  text-align: center;
  color: var(--muted);
  margin: 2rem 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0f172a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--frost);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  background: rgba(30, 41, 59, 0.95);
}

.modal__media {
  display: flex;
  flex-direction: column;
  background: #020617;
  border-bottom: 1px solid var(--border);
}

.modal__media:empty {
  display: none;
}

.modal__iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border: 0;
  display: block;
}

.modal__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border: 0;
  display: block;
  object-fit: contain;
}

.modal__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border: 0;
  display: block;
  object-fit: cover;
}

.modal__yt {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal__yt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal__yt-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #e62117 0%, #b31217 100%);
  box-shadow: 0 4px 16px rgba(230, 33, 23, 0.35);
}

.modal__yt-open:hover {
  filter: brightness(1.08);
}

.modal__yt-poster-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #020617;
}

.modal__yt-poster {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.modal__yt-embed-btn {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: var(--ice);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.modal__yt-embed-btn:hover {
  border-color: var(--ice-dim);
  color: var(--frost);
}

.modal__yt-embed-slot {
  width: 100%;
}

.modal__yt-embed-slot .modal__iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border: 0;
  display: block;
  border-radius: 8px;
}

.modal__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal__tag {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ice-dim);
}

.modal__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.modal__desc {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.modal__store {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn--play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #0f172a;
  background: linear-gradient(180deg, #a8e063 0%, #56ab2f 100%);
  box-shadow: 0 4px 16px rgba(86, 171, 47, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn--play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(86, 171, 47, 0.4);
}

/* Admin */
.admin-main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.admin-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
}

.admin-lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 52ch;
}

.admin-lead code {
  font-size: 0.9em;
  color: var(--ice);
}

.admin-form {
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--frost);
}

.admin-input {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--frost);
  font-family: var(--font-body);
  font-size: 1rem;
}

.admin-textarea {
  min-height: 80px;
  resize: vertical;
}

.admin-input:focus {
  outline: none;
  border-color: var(--ice-dim);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.admin-error {
  margin: 0;
  color: #fca5a5;
  font-size: 0.95rem;
}

.admin-panel {
  padding-top: 0.5rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-publish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.35);
}

.admin-publish-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 36rem;
  margin: 0;
  cursor: pointer;
}

.admin-publish-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.admin-publish-label code {
  font-size: 0.82em;
  color: var(--ice);
}

.admin-file {
  cursor: pointer;
  margin: 0;
}

.admin-file input {
  display: none;
}

.admin-status {
  min-height: 1.5rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--ice-dim);
}

.admin-status--error {
  color: #fca5a5;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.admin-empty {
  color: var(--muted);
  margin: 0;
}

.admin-row-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-row-item__main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
}

.admin-row-item__img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #0f172a;
}

.admin-row-item__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-row-item__actions {
  display: flex;
  gap: 0.5rem;
}

.btn--sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
}

.admin-btn-danger:hover {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.admin-editor-wrap {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.admin-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 640px;
}

.admin-editor__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.admin-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .admin-row {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-hint {
  margin: -0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-editor__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.admin-settings {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.35);
}

.admin-hint--block {
  margin-bottom: 1rem;
}

.admin-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.admin-logo-preview {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.12);
}

.admin-logo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.admin-game-image {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-game-image > .admin-label:first-child {
  margin-bottom: 0;
}

.admin-game-image__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.admin-game-thumb {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
}

.admin-game-image__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-label--tight {
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1rem 1.5rem 1.25rem;
    background: rgba(7, 11, 20, 0.98);
    border-bottom: 1px solid var(--border);
    gap: 0;
    display: none;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .header {
    position: relative;
    flex-wrap: wrap;
  }
}
