/* One look per decade. era.js puts the current decade on <body data-era="1950s">, and tv3d.js builds the
   matching 3D set and room. This file does the same for the flat set (narrow windows, ?flat, or if 3D
   cannot start) and tints the page and the 3D stage around it. The look of the controls and the channel
   readout is shared by the flat chin and the little control bar that floats under the 3D set. */

:root { --era-ease: .35s ease; }
body, .scene { transition: background-color var(--era-ease); }
.tv, .tv-chin, .knob, .led { transition: background var(--era-ease), color var(--era-ease), border-color var(--era-ease), box-shadow var(--era-ease); }

/* ---------- 1950s: mint wallpaper, blond wood, porthole screen, ivory bakelite ---------- */
body[data-era="1950s"] {
  --wall: #2c4a45; --bezel: #e8dcc0;
  background:
    radial-gradient(120% 80% at 38% 30%, #5d8c82 0%, transparent 62%),
    radial-gradient(circle at 20px 20px, rgba(240,121,95,.22) 0 5px, transparent 6px) 0 0 / 90px 90px,
    radial-gradient(circle at 65px 62px, rgba(243,192,74,.18) 0 4px, transparent 5px) 0 0 / 90px 90px,
    var(--wall);
}
body[data-era="1950s"] .scene { background: #223b37; }
body[data-era="1950s"]:not(.mode-3d) .tv {
  border-radius: 26px 26px 14px 14px;
  background:
    repeating-linear-gradient(91deg, rgba(120,80,30,.12) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #ecd0a0, #d4aa6c 55%, #b98c4f);
  box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(90,55,20,.5);
}
body[data-era="1950s"]:not(.mode-3d) .screen {
  border-radius: 13% / 17%;
  box-shadow: 0 0 0 9px var(--bezel), 0 0 0 12px #b5923f, 0 0 0 14px rgba(0,0,0,.35), inset 0 0 60px rgba(0,0,0,.9);
}
body[data-era="1950s"] .tv-chin { color: #5a3f1c; }
body[data-era="1950s"] .grille { background: repeating-linear-gradient(90deg, rgba(120,90,30,.55) 0 2px, rgba(235,210,150,.5) 2px 5px); opacity: 1; border: 2px solid #b5923f; }
body[data-era="1950s"] .knob {
  background: radial-gradient(circle at 35% 30%, #f6ecd2, #cdbd97); color: #3a2a18; border: 2px solid #8a6a2c; border-radius: 999px;
  font: 700 12px/1 Georgia, "Times New Roman", serif; padding: 7px 12px; box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 1px 0 #fff;
}
body[data-era="1950s"] .led { background: #1b150d; color: #ffc766; font: 700 28px/1 Georgia, serif; text-shadow: 0 0 8px rgba(255,179,71,.8); border: 2px solid #b5923f; border-radius: 3px; }
body.mode-3d[data-era="1950s"] .tv { border-color: rgba(232,220,192,.35); }

/* ---------- 1960s: teak console, black bezel with a brass rim, chrome dials, atomic wallpaper ---------- */
body[data-era="1960s"] {
  --wall: #4a3624; --bezel: #131110;
  background:
    radial-gradient(120% 80% at 38% 30%, #8a6a40 0%, transparent 62%),
    radial-gradient(circle at 45px 45px, transparent 0 14px, rgba(224,116,44,.26) 15px 22px, transparent 23px) 0 0 / 90px 90px,
    radial-gradient(circle at 0 0, rgba(42,139,140,.2) 0 18px, transparent 19px) 0 0 / 90px 90px,
    var(--wall);
}
body[data-era="1960s"] .scene { background: #2a1c12; }
body[data-era="1960s"]:not(.mode-3d) .tv {
  border-radius: 8px 8px 6px 6px;
  background:
    repeating-linear-gradient(90deg, rgba(60,25,8,.16) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #d98b52, #b8693a 45%, #8c4a25);
  box-shadow: 0 30px 60px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,220,180,.35), inset 0 -3px 0 rgba(0,0,0,.45);
}
body[data-era="1960s"]:not(.mode-3d) .screen {
  border-radius: 7% / 9%;
  box-shadow: 0 0 0 12px var(--bezel), 0 0 0 15px #d6ab52, 0 0 0 17px rgba(0,0,0,.4), inset 0 0 60px rgba(0,0,0,.9);
}
body[data-era="1960s"] .tv-chin { color: #f3e7c4; }
body[data-era="1960s"] .grille { background: repeating-linear-gradient(90deg, rgba(60,45,10,.6) 0 2px, rgba(217,195,106,.7) 2px 4px); opacity: 1; border: 2px solid #d6ab52; }
body[data-era="1960s"] .knob {
  background: linear-gradient(180deg, #f1f3f5, #aab0b6); color: #17140f; border: 1px solid #2a2724; border-radius: 999px;
  font: 800 11.5px/1 var(--ui); box-shadow: 0 2px 0 rgba(0,0,0,.45), inset 0 1px 0 #fff;
}
body[data-era="1960s"] .led { background: #0a0908; color: #f7efd2; text-shadow: 0 0 8px rgba(255,242,196,.8); border: 1px solid #8f8467; }
body.mode-3d[data-era="1960s"] .tv { border-color: rgba(214,171,82,.4); }

/* ---------- 1970s: dark woodgrain floor console, harvest gold, panelling ---------- */
body[data-era="1970s"] {
  --wall: #3a2314; --bezel: #0d0b0a;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 3px, transparent 3px 56px),
    linear-gradient(90deg, rgba(0,0,0,.18) 0 28px, transparent 28px 56px) 0 0 / 56px 100%,
    radial-gradient(110% 80% at 40% 30%, #7a4a28 0%, transparent 62%),
    var(--wall);
}
body[data-era="1970s"] .scene { background: #1f120a; }
body[data-era="1970s"]:not(.mode-3d) .tv {
  border-radius: 10px 10px 4px 4px;
  background:
    repeating-linear-gradient(94deg, rgba(0,0,0,.3) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(86deg, rgba(190,120,70,.1) 0 2px, transparent 2px 23px),
    linear-gradient(180deg, #5a3820, #3b2213 50%, #2a1709);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 0 0 3px rgba(207,160,67,.55), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.5);
}
body[data-era="1970s"]:not(.mode-3d) .screen {
  border-radius: 6% / 8%;
  box-shadow: 0 0 0 14px var(--bezel), 0 0 0 17px #cfa043, 0 0 0 19px rgba(0,0,0,.45), inset 0 0 60px rgba(0,0,0,.9);
}
body[data-era="1970s"] .tv-chin { color: #e9c46a; }
body[data-era="1970s"] .grille { background: repeating-linear-gradient(90deg, rgba(20,8,2,.85) 0 3px, rgba(197,138,58,.75) 3px 6px); opacity: 1; border: 2px solid #cfa043; }
body[data-era="1970s"] .knob {
  background: radial-gradient(circle at 40% 30%, #2b2420, #0c0b0a); color: #e9c46a; border: 2px solid #cfa043; border-radius: 999px;
  font: 800 12px/1 var(--ui); padding: 7px 12px; box-shadow: 0 2px 0 rgba(0,0,0,.6);
}
body[data-era="1970s"] .led { background: #190c05; color: #ffa83a; text-shadow: 0 0 8px rgba(255,155,46,.85); border: 2px solid #cfa043; border-radius: 3px; }
body.mode-3d[data-era="1970s"] .tv { border-color: rgba(207,160,67,.45); }

/* ---------- 1980s: woodgrain and silver, push buttons, purple wallpaper ---------- */
body[data-era="1980s"] {
  --wall: #2b1f2e; --bezel: #1c1917;
  background:
    radial-gradient(120% 80% at 38% 30%, #4a3550 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 46px),
    var(--wall);
}
body[data-era="1980s"] .scene { background: #241a27; }
body[data-era="1980s"]:not(.mode-3d) .screen { box-shadow: 0 0 0 10px var(--bezel), 0 0 0 14px #b9bdc2, 0 0 0 16px rgba(0,0,0,.4), inset 0 0 60px rgba(0,0,0,.9); }
body[data-era="1980s"]:not(.mode-3d) .tv-chin {
  margin: 0 -22px; padding: 0 26px; border-radius: 0 0 12px 12px; color: #2b2825;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.18) 0 1px, rgba(0,0,0,.06) 1px 2px), linear-gradient(180deg, #d2d5d9, #a9adb2);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0,0,0,.35);
}
/* on a phone the set's padding is 12px and the buttons wrap: the silver panel follows suit and clears the bezel */
@media (max-width: 980px) { body[data-era="1980s"]:not(.mode-3d):not(.is-full) .tv-chin { margin: 0 -12px; padding: 22px 14px 10px; } }
body[data-era="1980s"] .knob { background: linear-gradient(180deg, #4a4643, #1f1d1b); color: #e4e1dc; border: 1px solid #0b0a0a; border-radius: 3px; box-shadow: 0 2px 0 rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2); }
body[data-era="1980s"] .grille { background: repeating-linear-gradient(90deg, rgba(0,0,0,.7) 0 2px, transparent 2px 6px), #1a1816; opacity: 1; border-radius: 3px; }

/* ---------- 1990s: black plastic, small rubber buttons, green readout, dim blue-green room ---------- */
body[data-era="1990s"] {
  --wall: #1c3f48; --bezel: #0d0d0e;
  background:
    radial-gradient(120% 80% at 38% 30%, #2f6674 0%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 24px, transparent 24px 48px),
    radial-gradient(circle at 12% 18%, rgba(217,255,122,.5) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 12%, rgba(217,255,122,.4) 0 2px, transparent 3px),
    var(--wall);
}
body[data-era="1990s"] .scene { background: #14292f; }
body[data-era="1990s"]:not(.mode-3d) .tv {
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, #232427, #131314 60%, #0c0c0d);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.6);
}
body[data-era="1990s"]:not(.mode-3d) .screen { border-radius: 3% / 4%; box-shadow: 0 0 0 9px #1a1b1d, 0 0 0 11px #585b60, 0 0 0 12px #050505, inset 0 0 60px rgba(0,0,0,.9); }
body[data-era="1990s"] .tv-chin { color: #aeb2b8; }
body[data-era="1990s"] .grille { background: repeating-linear-gradient(0deg, rgba(0,0,0,.6) 0 2px, rgba(60,62,66,.5) 2px 4px); opacity: 1; height: 24px; }
body[data-era="1990s"] .knob { background: linear-gradient(180deg, #3a3d42, #25272a); color: #c8ccd1; border: 1px solid #08080a; border-radius: 4px; font: 650 11.5px/1 var(--ui); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
body[data-era="1990s"] .led { background: #031008; color: #7dff8a; text-shadow: 0 0 8px rgba(82,255,106,.85); border: 1px solid #1f2a22; }
body.mode-3d[data-era="1990s"] .tv { border-color: rgba(125,255,138,.22); }

/* ---------- 2000s: silver and glossy black, blue lights, a cool modern room ---------- */
body[data-era="2000s"] {
  --wall: #26384f; --bezel: #07080a;
  background:
    radial-gradient(120% 80% at 38% 30%, #6d8bb2 0%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 16px),
    linear-gradient(180deg, transparent 72%, rgba(120,192,255,.18) 100%),
    var(--wall);
}
body[data-era="2000s"] .scene { background: #1a2a44; }
body[data-era="2000s"]:not(.mode-3d) .tv {
  border-radius: 12px 12px 8px 8px;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.14) 0 1px, rgba(0,0,0,.05) 1px 2px), linear-gradient(180deg, #e3e6e9, #b3b8be 60%, #8f949a);
  box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 2px 0 #fff, inset 0 -3px 0 rgba(0,0,0,.3);
}
body[data-era="2000s"]:not(.mode-3d) .screen { border-radius: 1.4% / 1.9%; box-shadow: 0 0 0 11px #06070a, 0 0 0 13px #d9dce0, 0 0 0 14px rgba(0,0,0,.4), inset 0 0 60px rgba(0,0,0,.9); }
body[data-era="2000s"] .tv-chin { color: #4f555c; }
body[data-era="2000s"] .grille { background: radial-gradient(circle, rgba(0,0,0,.55) 1.2px, transparent 1.6px) 0 0 / 6px 6px, #8a8f95; opacity: 1; border-radius: 12px; }
body[data-era="2000s"] .knob { background: linear-gradient(180deg, #f2f4f6, #b4b9bf); color: #3a4047; border: 1px solid #7a8087; border-radius: 999px; font: 700 11.5px/1 var(--ui); box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(0,0,0,.25); }
body[data-era="2000s"] .led { background: #02060c; color: #9fdcff; text-shadow: 0 0 9px rgba(70,180,255,.9); border: 1px solid #1b2a3d; border-radius: 3px; }
body.mode-3d[data-era="2000s"] .tv { border-color: rgba(120,192,255,.3); }

/* the floating control bar under the 3D set keeps its dark glass in every era, so the text stays readable */
body.mode-3d .tv-chin { color: #e8e2d4; }
body.mode-3d[data-era="1980s"] .tv-chin, body.mode-3d[data-era="2000s"] .tv-chin { margin: 0; padding: 8px 10px; background: none; box-shadow: none; border-radius: 0; color: #e8e2d4; }

/* the channel readout holds up to three characters */
.led { white-space: nowrap; min-width: 3.4ch; }
body:not(.mode-3d) .led { min-width: 76px; }

/* Fullscreen and TV devices show only the picture, whatever the era: no wall, no cabinet, no bezel. */
body.is-full[data-era] { background: #000; }
body.is-full[data-era]:not(.mode-3d) .tv { background: none; box-shadow: none; border: 0; border-radius: 0; padding: 0; }
body.is-full[data-era] .screen:not(.in-3d) { box-shadow: none; border-radius: 0; }

/* The set's own on-screen numbers and volume look like its decade's: soft cream for the tube sets of the 1950s and 60s
   (the station's slide, really), amber for the 1970s, the green readout of the 1980s and 90s, and the smooth blue-white
   type of a 2000s digital set. The banner's accents follow. */
body:is([data-era="1950s"], [data-era="1960s"]) .osd-num, body:is([data-era="1950s"], [data-era="1960s"]) .osd-vol {
  color: #f4ead2; text-shadow: .35cqw .35cqw 0 rgba(0,0,0,.85), 0 0 1.6cqw rgba(255,240,200,.45); }
body[data-era="1970s"] .osd-num, body[data-era="1970s"] .osd-vol { color: #ffb64a; text-shadow: .35cqw .35cqw 0 #000, 0 0 2cqw rgba(255,170,60,.6); }
body[data-era="2000s"] .osd-num { font: 800 10cqw/0.9 var(--ui); color: #eef6ff; letter-spacing: -.02em; text-shadow: 0 .3cqw 1.2cqw rgba(0,0,0,.7), 0 0 2.2cqw rgba(90,170,255,.8); }
body[data-era="2000s"] .osd-vol { font: 700 3.6cqw/1 var(--ui); color: #eef6ff; text-shadow: 0 .2cqw .8cqw rgba(0,0,0,.8); letter-spacing: 0; }
body[data-era="2000s"] .osd-banner { font-family: var(--ui); font-weight: 650; font-size: 3.4cqw; border: 0; border-radius: 1.4cqw;
  background: linear-gradient(180deg, rgba(40,58,92,.88), rgba(10,18,36,.92)); box-shadow: inset 0 .3cqh 0 rgba(255,255,255,.18), 0 1cqh 3cqh rgba(0,0,0,.5); }
body[data-era="2000s"] .osd-banner .ob-title { font-size: 4.8cqw; font-weight: 800; }
body[data-era="2000s"] .osd-banner .ob-top { color: #9fd0ff; }
body[data-era="2000s"] .osd-banner .ob-bar { border-radius: 1cqh; overflow: hidden; }
body[data-era="2000s"] .osd-banner .ob-bar i { background: linear-gradient(90deg, #5fb0ff, #b8e0ff); }
body:is([data-era="1950s"], [data-era="1960s"]) .osd-banner { background: rgba(14,12,10,.88); border-color: #e9dcc0; }
body:is([data-era="1950s"], [data-era="1960s"]) .osd-banner .ob-top { color: #f4ead2; }
body:is([data-era="1950s"], [data-era="1960s"]) .osd-banner .ob-bar i { background: #e9dcc0; }
body[data-era="1970s"] .osd-banner { background: linear-gradient(180deg, rgba(60,30,8,.92), rgba(30,14,4,.94)); border-color: #ffb64a; }
body[data-era="1970s"] .osd-banner .ob-top { color: #ffb64a; }
body[data-era="1970s"] .osd-banner .ob-bar i { background: #ffb64a; }
body:is([data-era="1950s"], [data-era="1960s"]) .osd-banner .ob-next { color: #d8ccb0; }
/* the round tubes of the 1950s and 60s cut the corners off: the number sits further in */
body:is([data-era="1950s"], [data-era="1960s"]) .osd-num { right: 9cqw; top: 8cqh; }
body:is([data-era="1950s"], [data-era="1960s"]) .osd-vol { left: 9cqw; top: 9cqh; }
