/* TV layout only. Everything scales with clamp(min, Nvmin, max) so it reads from a
   laptop to a 75" panel with no media queries. */
body.is-tv {
  background: radial-gradient(ellipse at 50% 30%, var(--stage-1), var(--stage-2) 75%);
  color: #f5f1e6;
  overflow: hidden;
}
body.is-tv #app { height: 100vh; }

.tv-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2.4vmin, 2rem);
  padding: clamp(1rem, 3vmin, 3rem);
  text-align: center;
}

/* Brand */
.tv-brand {
  display: flex;
  align-items: baseline;
  gap: clamp(0.5rem, 1.2vmin, 1rem);
}
.tv-brand-logo { font-size: clamp(1.6rem, 4.5vmin, 3.6rem); }
.tv-brand-name {
  font-family: var(--font-doodle);
  font-size: clamp(2rem, 6vmin, 4.8rem);
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0.18rem 0.22rem 0 rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
}
.tv-brand-tag {
  font-size: clamp(0.8rem, 2vmin, 1.5rem);
  color: #b9c0dc;
  font-style: italic;
}

.tv-big-emoji { font-size: clamp(3rem, 10vmin, 8rem); }
.tv-connecting h2 { font-size: clamp(1.2rem, 3vmin, 2.4rem); color: #b9c0dc; font-weight: 600; }

/* ---- Lobby ---- */
.tv-lobby-main {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vmin, 5rem);
}
.tv-qr-panel {
  padding: clamp(1rem, 2.6vmin, 2.2rem);
  color: var(--ink);
  transform: rotate(-1.5deg);
}
.tv-qr-title {
  font-family: var(--font-doodle);
  font-size: clamp(1.1rem, 2.8vmin, 2.2rem);
  font-weight: 700;
  margin-bottom: 0.4em;
}
.tv-qr-img {
  width: clamp(12rem, 34vmin, 26rem);
  height: auto;
  image-rendering: pixelated;
  margin: 0 auto;
}
.tv-qr-url {
  margin-top: 0.5em;
  font-size: clamp(0.75rem, 1.7vmin, 1.3rem);
  font-weight: 700;
  color: var(--ink-soft);
  word-break: break-all;
}
.tv-lobby-side {
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2vmin, 1.6rem);
  max-width: 46vw;
}
.tv-lobby-count { font-size: clamp(1.4rem, 3.6vmin, 3rem); font-family: var(--font-doodle); }
.tv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.4rem, 1.2vmin, 1rem);
  justify-content: center;
}
.tv-chip {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(0.9rem, 2.4vmin, 2rem);
  padding: 0.35em 0.9em;
  border: 3px solid var(--ink);
  border-radius: 2rem 1.6rem 2rem 1.6rem / 1.6rem 2rem 1.6rem 2rem;
  box-shadow: 0.18rem 0.22rem 0 rgba(0, 0, 0, 0.35);
}
.tv-chip { display: inline-flex; align-items: center; gap: 0.35em; }
.tv-face {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  object-fit: cover;
  flex-shrink: 0;
}
.tv-chip:nth-child(odd) { transform: rotate(1.6deg); }
.tv-chip:nth-child(even) { transform: rotate(-1.4deg); }
.tv-chip-crown { color: #c78a00; }
.tv-chip-ghost { opacity: 0.55; font-style: italic; }
.tv-chip-away { opacity: 0.4; filter: grayscale(0.7); }
.tv-lobby-hint {
  font-size: clamp(1rem, 2.6vmin, 2.1rem);
  color: var(--yellow);
  font-weight: 700;
}
.tv-howto {
  font-size: clamp(0.8rem, 1.9vmin, 1.4rem);
  color: #8d96b8;
  max-width: 70vw;
}

/* ---- Playing ---- */
.tv-round {
  font-size: clamp(1rem, 2.4vmin, 1.9rem);
  color: #b9c0dc;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tv-phase {
  font-family: var(--font-doodle);
  font-size: clamp(1.8rem, 5.4vmin, 4.4rem);
  text-shadow: 0.15rem 0.2rem 0 rgba(0, 0, 0, 0.45);
}
.tv-ringwrap {
  position: relative;
  width: clamp(9rem, 24vmin, 18rem);
  height: clamp(9rem, 24vmin, 18rem);
}
.tv-ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tv-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 14; }
.tv-ring-fill {
  fill: none;
  stroke: var(--teal);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
}
.tv-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-doodle);
  font-size: clamp(2.4rem, 7vmin, 5.6rem);
  font-weight: 700;
}
.tv-count-low { color: var(--coral); animation: pulse 1s ease-in-out infinite; }
.tv-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.5rem, 1.4vmin, 1.2rem);
  max-width: 85vw;
}
.tv-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  padding: clamp(0.4rem, 1.2vmin, 1rem) clamp(0.7rem, 1.8vmin, 1.4rem);
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: clamp(0.85rem, 2.2vmin, 1.8rem);
  font-weight: 700;
}
.tv-tile-done { background: rgba(46, 196, 182, 0.22); border-color: var(--teal); }
.tv-tile-away { opacity: 0.45; }
.tv-tile-status { font-size: 1.1em; }
.tv-quip {
  font-style: italic;
  color: #8d96b8;
  font-size: clamp(0.85rem, 2vmin, 1.5rem);
}

/* ---- Review ---- */
.tv-review { justify-content: center; }
.tv-review-head {
  display: flex;
  align-items: baseline;
  gap: clamp(0.8rem, 2vmin, 1.6rem);
}
.tv-review-book {
  font-family: var(--font-doodle);
  font-size: clamp(1.6rem, 4.4vmin, 3.6rem);
  color: var(--yellow);
  text-shadow: 0.12rem 0.16rem 0 rgba(0, 0, 0, 0.45);
}
.tv-review-count {
  font-size: clamp(0.85rem, 2vmin, 1.5rem);
  color: #8d96b8;
  font-weight: 700;
}
.tv-card {
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.4vmin, 1.2rem);
  padding: clamp(1rem, 2.6vmin, 2.4rem);
  max-width: 82vw;
}
.tv-card-img { padding: clamp(0.6rem, 1.6vmin, 1.4rem); }
.tv-drawing {
  max-height: 56vh;
  max-width: 76vw;
  border-radius: 0.6rem;
}
.tv-card-text { min-width: min(60vw, 50rem); min-height: 30vh; }
.tv-card-label {
  font-size: clamp(0.9rem, 2.2vmin, 1.7rem);
  color: var(--ink-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tv-card-big {
  font-family: var(--font-doodle);
  font-size: clamp(1.8rem, 5.2vmin, 4.4rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.tv-card-timeout { font-size: clamp(2.5rem, 8vmin, 6rem); }
.tv-card-timeout-note { color: var(--ink-soft); font-style: italic; font-size: clamp(0.8rem, 1.8vmin, 1.3rem); }
.tv-attrib {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  font-size: clamp(1rem, 2.6vmin, 2rem);
  font-weight: 700;
  color: var(--teal);
}
.tv-attrib .tv-face { width: 1.7em; height: 1.7em; border-color: var(--teal); }
.tv-dots { display: flex; gap: clamp(0.3rem, 0.8vmin, 0.7rem); }
.tv-dot {
  width: clamp(0.55rem, 1.4vmin, 1.1rem);
  height: clamp(0.55rem, 1.4vmin, 1.1rem);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.tv-dot-past { background: rgba(46, 196, 182, 0.5); }
.tv-dot-on { background: var(--yellow); transform: scale(1.25); }
.tv-progress {
  width: min(50vw, 34rem);
  height: clamp(0.4rem, 1vmin, 0.8rem);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  overflow: hidden;
}
.tv-progress-fill {
  height: 100%;
  background: var(--coral);
  transform-origin: left;
  animation: bar-drain linear both;
}
.tv-paused {
  font-weight: 700;
  color: var(--yellow);
  font-size: clamp(0.9rem, 2.2vmin, 1.6rem);
}
.tv-review-hint {
  color: #8d96b8;
  font-size: clamp(0.8rem, 1.9vmin, 1.4rem);
}

/* ---- Finale ---- */
.tv-finale-title {
  font-family: var(--font-doodle);
  font-size: clamp(2rem, 6vmin, 5rem);
  text-shadow: 0.15rem 0.2rem 0 rgba(0, 0, 0, 0.45);
}
.tv-finale-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.8rem, 2vmin, 1.6rem);
  max-width: 88vw;
  overflow-y: auto;
}
.tv-finale-card {
  color: var(--ink);
  padding: clamp(0.8rem, 2vmin, 1.6rem);
  max-width: clamp(14rem, 30vmin, 24rem);
}
.tv-finale-card:nth-child(odd) { transform: rotate(1.2deg); }
.tv-finale-card:nth-child(even) { transform: rotate(-1.2deg); }
.tv-finale-owner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: clamp(0.8rem, 1.8vmin, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4em;
}
.tv-finale-line {
  font-family: var(--font-doodle);
  font-size: clamp(1rem, 2.4vmin, 1.9rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tv-finale-arrow { color: var(--coral); font-weight: 700; font-size: clamp(0.75rem, 1.7vmin, 1.2rem); margin: 0.3em 0; }
.tv-finale-result { color: var(--coral-deep); }
