/* TNTgames styles */

:root {
  --bg: #0f1016;
  --surface: #171923;
  --surface-2: #1f2230;
  --surface-3: #2a2e3e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink: #f4f5f8;
  --muted: #9ba1b3;
  --accent: #e8322b;
  --accent-hover: #f4463f;
  --gold: #ffc53d;
  --focus: #6cb8ff;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img, svg { display: block; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(1240px, 100% - 40px);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 16, 22, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 8px;
}
.brand .crate { width: 34px; height: 34px; overflow: visible; }
.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.wordmark b { color: var(--accent); font-weight: 700; }

/* The lit fuse on the logo, the site's one bit of idle motion. */
.crate .spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: spark 1.1s ease-in-out infinite alternate;
}
@keyframes spark {
  from { transform: scale(0.75); opacity: 0.7; }
  to { transform: scale(1.15); opacity: 1; }
}

.search {
  position: relative;
  margin-left: auto;
  flex: 0 1 360px;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:hover { border-color: var(--line-strong); }
.search input:focus { outline: none; border-color: var(--focus); background: var(--surface-2); }
.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font: 500 12px/18px var(--font);
  text-align: center;
  pointer-events: none;
}

.header-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.header-link svg { width: 16px; height: 16px; }
.header-link:hover { border-color: var(--line-strong); background: var(--surface); }

@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; padding-block: 12px; gap: 12px; }
  .search { flex: 1 0 100%; margin-left: 0; }
  .search kbd { display: none; }
}

main { flex: 1 0 auto; padding-bottom: 48px; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }

.btn-ghost {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}
.btn-ghost:hover { background: var(--surface-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 197, 61, 0.12);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Featured banner */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 420px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 64%;
  z-index: -1;
}
.hero-art > svg, .hero-art > img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.hero-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(23, 25, 35, 0.6) 28%, rgba(23, 25, 35, 0) 60%);
}
.hero:hover .hero-art > svg, .hero:hover .hero-art > img { transform: scale(1.03); }

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 460px;
  padding: 48px;
}
.hero-title {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}
.hero-text {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 17px;
}

@media (max-width: 800px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-art { position: relative; width: 100%; aspect-ratio: 16 / 9; z-index: 0; }
  .hero-art::after { background: linear-gradient(0deg, var(--surface) 0%, rgba(23, 25, 35, 0) 40%); }
  .hero-body { max-width: none; padding: 4px 22px 24px; }
}

/* Game list */

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 52px 0 20px;
}
.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.chips:empty { display: none; }
.chip {
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px 20px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
}
.tile-art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tile-art > svg, .tile-art > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.tile-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(15, 16, 22, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}
.tile-info { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.tile-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.tile-meta { color: var(--muted); font-size: 14px; line-height: 1.4; }
.tile:hover .tile-art, .tile:focus-visible .tile-art {
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.tile:hover .tile-art > svg, .tile:hover .tile-art > img { transform: scale(1.04); }

.tile-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 16 / 10;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.tile-soon svg { width: 28px; height: 28px; margin-bottom: 4px; }
.tile-soon strong { color: var(--ink); font-size: 15px; font-weight: 600; }

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .tile { gap: 8px; }
  .tile-title { font-size: 15px; }
  .tile-meta { font-size: 13px; }
  .tile-badge { display: none; }
  .tile-soon span { display: none; }
}

.empty {
  padding: 48px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty p { margin: 0 0 16px; color: var(--muted); }

/* Play page */

.player {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 170px);
  width: 100%;
  background: #07080b;
}
.stage iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}
.stage:fullscreen { max-height: none; aspect-ratio: auto; }
.stage:-webkit-full-screen { max-height: none; }

.cover {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
}
.cover-art, .cover-art > svg, .cover-art > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover-art::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(7, 8, 11, 0.45) 0%, rgba(7, 8, 11, 0.82) 100%);
}
.cover-body {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
}
.cover .btn { height: 56px; padding: 0 34px; font-size: 18px; border-radius: 14px; }
.cover .btn svg { width: 18px; height: 18px; }
.cover-note { margin: 0; color: rgba(244, 245, 248, 0.8); font-size: 14px; }

.player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.player-bar h1 {
  margin: 0 auto 0 0;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.info {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel p { margin: 0 0 12px; max-width: 65ch; color: #d4d7e0; }
.panel p:last-child { margin-bottom: 0; }
.panel .devices { color: var(--muted); font-size: 14px; }
.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 0;
  font-size: 14px;
}
.controls dt, .controls dd {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.controls dt { padding-right: 20px; color: var(--muted); }
.controls dd { margin: 0; font-weight: 500; text-align: right; }
#controls .devices { margin-top: 16px; }

@media (max-width: 800px) {
  .info { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 4 / 3; }
  .player-bar { padding: 14px 16px; }
}

.missing {
  margin: 80px auto 0;
  max-width: 520px;
  text-align: center;
}
.missing svg { width: 64px; height: 64px; margin: 0 auto 22px; overflow: visible; }
.missing h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.missing p { margin: 0 auto 26px; color: var(--muted); }

/* Footer */

.site-footer {
  padding: 0 0 36px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
