:root {
  --bg: #0d0f12;
  --bezel: #1a1e24;
  --bezel-highlight: #2a3038;
  --screen-glow: rgba(120, 200, 255, 0.06);
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #c9a227;
  --accent-dark: #8a6f1a;
  --deck: #252a32;
  --danger-tape: #8b3a3a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "banner"
    "tv"
    "meta";
  gap: 0.65rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.45rem 0.65rem 0.75rem;
  flex: 1;
  align-content: start;
  min-height: 0;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
    grid-template-areas:
      "banner banner"
      "tv meta";
    column-gap: 1rem;
    row-gap: 0.65rem;
    padding: 0.65rem 1rem 1rem;
    align-items: start;
  }

  .site-banner-wrap {
    height: clamp(40px, min(6vw, 8vh), 64px);
  }
}

.tv-column {
  grid-area: tv;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.meta-column {
  grid-area: meta;
  min-width: 0;
}

/* Banner spans full grid width: narrow = same column as TV; wide = TV + gap + meta */
.site-banner-wrap {
  grid-area: banner;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  height: clamp(30px, min(10vw, 9vh), 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
}

.site-banner {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 2px;
  box-shadow: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.tv-casing {
  position: relative;
  background: linear-gradient(145deg, var(--bezel-highlight), var(--bezel));
  border-radius: 12px;
  padding: clamp(10px, 2vw, 18px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 48px rgba(0, 0, 0, 0.55);
}

.tv-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #0a0a0a inset,
    0 0 60px var(--screen-glow);
}

.tv-screen #player,
.tv-screen iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.tv-scanlines {
  pointer-events: none;
  position: absolute;
  inset: clamp(10px, 2vw, 18px);
  border-radius: 6px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.35;
}

.deck {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #16191f;
  border-radius: 0;
  border: 3px solid #2c313a;
  box-shadow: none;
}

.deck-btn {
  min-width: 6.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  color: #e8eaed;
  background: #3d4554;
  border: 3px solid #0d0f12;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
  transition:
    background-color 0.08s ease,
    color 0.08s ease,
    border-color 0.08s ease;
}

.deck-btn:hover {
  background: #4d5668;
  filter: none;
  border-color: #0d0f12;
  box-shadow: none;
}

.deck-btn:active {
  background: #323845;
  transform: none;
  filter: none;
  box-shadow: none;
}

.deck-btn:focus-visible {
  outline: 3px solid #c9a227;
  outline-offset: 2px;
}

#btn-next {
  color: #ffe8e8;
  background: #8f3840;
  border-color: #2a1014;
}

#btn-next:hover {
  background: #a8434c;
  border-color: #2a1014;
  filter: none;
  box-shadow: none;
}

#btn-next:active {
  background: #6e2c33;
  filter: none;
}

.meta-column {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.meta-heading {
  margin: 0 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(212, 188, 118, 0.82);
}

.meta-list {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.meta-list .meta-row dt {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(154, 160, 166, 0.45);
}

.meta-list .meta-row dd {
  margin: 0.12rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
  color: rgba(232, 234, 237, 0.72);
}

.meta-list a {
  color: rgba(154, 160, 166, 0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(154, 160, 166, 0.25);
}

.meta-list a:hover {
  color: rgba(201, 162, 39, 0.85);
  border-bottom-color: rgba(201, 162, 39, 0.35);
}

.meta-dash {
  color: rgba(154, 160, 166, 0.35);
}

.status-line {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.25rem;
  margin: 0 1rem 0.35rem;
}

.site-footer {
  margin-top: auto;
  padding: 0.35rem 1rem 1.1rem;
  text-align: center;
}

.site-footer-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.site-footer-nav a {
  color: rgba(154, 160, 166, 0.72);
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-sep {
  color: rgba(154, 160, 166, 0.45);
  user-select: none;
}

.site-footer-year {
  color: rgba(154, 160, 166, 0.55);
  user-select: none;
}

@media (max-width: 480px) {
  .tv-casing {
    padding: 8px;
    border-radius: 10px;
  }

  .deck {
    padding: 0.55rem 0.65rem;
    gap: 0.5rem;
  }

  .deck-btn {
    min-width: 5.5rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }

  .meta-column {
    padding: 0.75rem 0.85rem;
  }
}
