/* Teletexto Geek — authentic teletext styling.
   Classic palette only: black, red, green, yellow, blue, magenta, cyan, white.
   The screen is a 40-column monospaced grid. */

:root {
  --tt-black: #000000;
  --tt-red: #ff0000;
  --tt-green: #00ff00;
  --tt-yellow: #ffff00;
  --tt-blue: #0000ff;
  --tt-magenta: #ff00ff;
  --tt-cyan: #00ffff;
  --tt-white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #101010;
  font-family: "Courier New", Courier, monospace;
  color: var(--tt-white);
}

.tv-room {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tv {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Screen ---------- */

.screen {
  background: var(--tt-black);
  width: min(96vw, 680px);
  padding: 14px 16px 10px;
  border: 4px solid #2b2b2b;
  font-size: clamp(11px, 2.4vw, 17px);
  line-height: 1.35;
  font-weight: bold;
}

.tt-header {
  display: flex;
  gap: 1ch;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 2px solid var(--tt-white);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.tt-page { color: var(--tt-white); }
.tt-brand { color: var(--tt-yellow); }
.tt-date { color: var(--tt-cyan); margin-left: auto; }
.tt-clock { color: var(--tt-green); }

.tt-body { min-height: 24em; white-space: pre-wrap; word-break: break-word; }
.tt-body a { color: var(--tt-cyan); }
.tt-body .banner {
  display: block;
  text-align: center;
  padding: 2px 0;
  margin: 4px 0;
}
.bg-blue { background: var(--tt-blue); color: var(--tt-white); }
.bg-red { background: var(--tt-red); color: var(--tt-white); }
.bg-magenta { background: var(--tt-magenta); color: var(--tt-black); }
.bg-yellow { background: var(--tt-yellow); color: var(--tt-black); }
.bg-green { background: var(--tt-green); color: var(--tt-black); }
.bg-cyan { background: var(--tt-cyan); color: var(--tt-black); }
.bg-white { background: var(--tt-white); color: var(--tt-black); }

.c-red { color: var(--tt-red); }
.c-green { color: var(--tt-green); }
.c-yellow { color: var(--tt-yellow); }
.c-blue { color: var(--tt-cyan); }
.c-magenta { color: var(--tt-magenta); }
.c-cyan { color: var(--tt-cyan); }
.c-white { color: var(--tt-white); }

.headline { cursor: pointer; }
.headline:hover, .headline:focus { background: var(--tt-blue); color: var(--tt-white); }
.headline .num { color: var(--tt-yellow); }

.blink { animation: tt-blink 1s steps(1) infinite; }
@keyframes tt-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}

/* ---------- Fastext bar ---------- */

.tt-fastext {
  display: flex;
  gap: 2ch;
  border-top: 2px solid var(--tt-white);
  padding-top: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.tt-fastext button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.fx-red { color: var(--tt-red); }
.fx-green { color: var(--tt-green); }
.fx-yellow { color: var(--tt-yellow); }
.fx-blue { color: var(--tt-cyan); }

/* ---------- Remote control ---------- */

.remote {
  background: #1c1c1e;
  border: 3px solid #333;
  border-radius: 18px;
  padding: 14px;
  width: 168px;
  text-align: center;
}
.remote-brand { color: var(--tt-yellow); font-size: 12px; letter-spacing: 1px; }
.remote-display {
  background: var(--tt-black);
  color: var(--tt-green);
  font-size: 22px;
  margin: 10px 0;
  padding: 4px 0;
  min-height: 34px;
}
.remote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.remote button {
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}
.remote-grid button, .remote-nav button {
  background: #2c2c2e;
  color: var(--tt-white);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 15px;
}
.remote-grid button:active, .remote-nav button:active { background: var(--tt-blue); }
.remote-nav { display: flex; gap: 6px; margin-top: 8px; }
.remote-nav button { flex: 1; }
.remote-fastext { display: flex; gap: 6px; margin-top: 10px; }
.remote-fastext .fx {
  flex: 1;
  height: 16px;
  border: 1px solid #444;
  border-radius: 6px;
}
.remote-fastext .fx-red { background: var(--tt-red); }
.remote-fastext .fx-green { background: var(--tt-green); }
.remote-fastext .fx-yellow { background: var(--tt-yellow); }
.remote-fastext .fx-blue { background: var(--tt-blue); }
.remote-lang { display: flex; gap: 6px; margin-top: 10px; }
.lang-btn {
  flex: 1;
  background: #2c2c2e;
  color: var(--tt-white);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 6px 0;
}
.lang-btn.active { background: var(--tt-yellow); color: var(--tt-black); }
.remote-hint { font-size: 10px; color: #9a9a9a; margin: 10px 0 0; line-height: 1.4; }
