/* La Cartouche — salon années 80 : télé cathodique en noyer + programme TV façon magazine. */
@font-face { font-family: "VT323"; src: url("fonts/VT323-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --wall: #2b1d14; --wall-2: #3a271a;
  --wood-1: #6b3e1f; --wood-2: #4e2b14; --wood-3: #8a5329;
  --alu-1: #d9d6cf; --alu-2: #a9a59b; --alu-3: #7d796f;
  --paper: #f4efe2; --ink: #1d1a16; --ink-2: #5d564b; --red: #c8261d;
  --osd: #7dff8a;
  --crt: "VT323", ui-monospace, Consolas, monospace;
  --news: Georgia, "Times New Roman", serif;
  --head: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--wall); color: var(--paper); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; overflow-x: hidden; }
.wallpaper { position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 190, 120, .16), transparent 60%),
    radial-gradient(circle at 25% 25%, var(--wall-2) 0 9px, transparent 10px) 0 0 / 46px 46px,
    radial-gradient(circle at 75% 75%, var(--wall-2) 0 9px, transparent 10px) 0 0 / 46px 46px,
    linear-gradient(var(--wall), #1c130d); }
button { font: inherit; }

.room { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; align-items: start; max-width: 1360px; margin: 0 auto; padding: 36px 28px 48px; }

/* ------------------------------------------------------------------ téléviseur */
.tv { position: sticky; top: 24px; }
.cabinet { display: flex; gap: 22px; padding: 26px; border-radius: 26px;
  background:
    repeating-linear-gradient(97deg, rgba(0,0,0,.10) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(93deg, rgba(255,255,255,.04) 0 1px, transparent 1px 17px),
    linear-gradient(160deg, var(--wood-3), var(--wood-1) 35%, var(--wood-2));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -6px 14px rgba(0,0,0,.45), 0 30px 60px rgba(0,0,0,.55), 0 4px 0 #2a160a; }
.bezel { flex: 1; min-width: 0; padding: 18px; border-radius: 30px; background: linear-gradient(145deg, #2a2a2a, #0d0d0d);
  box-shadow: inset 0 0 0 3px #3c3c3c, inset 0 6px 18px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.15); }
.screen { position: relative; aspect-ratio: 4 / 3; border-radius: 26px / 22px; overflow: hidden; background: #050805; isolation: isolate;
  box-shadow: inset 0 0 50px rgba(0,0,0,.9); animation: power-on .7s ease-out both; }
@keyframes power-on { 0% { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(4); } 55% { clip-path: inset(49% 0 49% 0); } 100% { clip-path: inset(0 0 0 0); filter: none; } }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; z-index: 1; }
.glass { position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 45% at 28% 12%, rgba(255,255,255,.10), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.20) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.55) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); animation: flicker 4s infinite steps(1); }
.screen.playing .glass { background:
    radial-gradient(ellipse 70% 45% at 28% 12%, rgba(255,255,255,.06), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 65%, rgba(0,0,0,.45) 100%); }
@keyframes flicker { 0%, 100% { opacity: 1; } 48% { opacity: .94; } 50% { opacity: 1; } }
.snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; image-rendering: pixelated; opacity: 0; pointer-events: none; }
.snow.on { opacity: 1; }
.osd { position: absolute; bottom: 5%; right: 6%; z-index: 5; font: 2.1rem/1 var(--crt); color: var(--osd); letter-spacing: .04em;
  text-shadow: 0 0 6px rgba(125,255,138,.8), 2px 2px 0 #062b0a; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: pre; }
.osd.on { opacity: 1; }

/* écran-titre d'un programme */
.card { position: absolute; inset: 0; z-index: 2; display: none; flex-direction: column; justify-content: center; padding: 8% 9%;
  font-family: var(--crt); color: #f2f2e6; background: radial-gradient(ellipse at 50% 40%, #16204a, #070a1c 75%); }
.card.show { display: flex; }
.card .c-top { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; letter-spacing: .08em; }
.card .c-top b { background: var(--c); color: #fff; min-width: 2.2em; text-align: center; padding: 0 6px; box-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.card .c-top em { margin-left: auto; font-style: normal; color: #ffd84a; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.card h2 { margin: 14px 0 0; font: 400 clamp(2.2rem, 6vw, 4.2rem)/.95 var(--crt); color: #fff; text-shadow: 3px 3px 0 var(--c), 0 0 18px rgba(255,255,255,.25); }
.card .c-meta { margin: 6px 0 0; color: #9fb4ff; font-size: 1.35rem; }
.card .c-desc { margin: 12px 0 0; font-size: 1.35rem; line-height: 1.15; max-width: 46ch; color: #e7e7da; }
.card .c-note { margin: 8px 0 0; font-size: 1.2rem; color: #ffd84a; }
.card .c-lic { margin: 6px 0 0; font-size: 1.05rem; line-height: 1.1; color: #8f95b8; max-width: 60ch; }
.card .c-lic a { color: #9fb4ff; }
.card .c-keys { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1.15rem; color: #c9c9bb; }
.card kbd { font: inherit; color: #070a1c; background: #e9e6d8; padding: 0 5px; margin-right: 3px; }
.card .c-go { margin: 16px 0 0; font-size: 1.6rem; color: #7dff8a; animation: blink 1.4s steps(1) infinite; }
/* mire : pas de programme sur la chaîne */
.card.mire { padding: 0; background: #111; }
.card.mire .bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.card.mire .bars i:nth-child(1) { background: #c0c0c0; } .card.mire .bars i:nth-child(2) { background: #c0c000; }
.card.mire .bars i:nth-child(3) { background: #00c0c0; } .card.mire .bars i:nth-child(4) { background: #00c000; }
.card.mire .bars i:nth-child(5) { background: #c000c0; } .card.mire .bars i:nth-child(6) { background: #c00000; }
.card.mire .bars i:nth-child(7) { background: #0000c0; }
.card.mire .mire-box { position: relative; margin: auto; width: 84%; padding: 4% 5%; background: rgba(0,0,0,.86); border: 3px solid #fff; box-shadow: 0 0 0 6px #000; }
.card.mire h2 { font-size: clamp(1.8rem, 4.6vw, 3rem); }

/* panneau de commandes */
.panel { width: 158px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 12px; border-radius: 14px;
  background: linear-gradient(180deg, var(--alu-1), var(--alu-2) 60%, var(--alu-3));
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(0,0,0,.35), 0 2px 0 rgba(0,0,0,.4); color: #2d2a25; }
.badge { width: 100%; text-align: center; font: 700 .95rem/1 var(--head); letter-spacing: .12em; color: #1b1b1b; padding: 8px 4px; border-radius: 4px;
  background: linear-gradient(180deg, #f6f3ea, #c9c4b6); box-shadow: inset 0 0 0 1px #8c877b; }
.badge small { display: block; margin-top: 4px; font: 600 .55rem/1 system-ui, sans-serif; letter-spacing: .14em; color: #6a655a; }
.dial { position: relative; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #e4e0d6 0 54%, #b9b4a7 55% 100%); box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 1px 0 #fff; }
.dial > span { position: absolute; left: 50%; top: 50%; width: 18px; margin: -8px 0 0 -9px; text-align: center; font: 700 .68rem/16px system-ui, sans-serif; color: #3b372f; }
.knob { width: 62px; height: 62px; border-radius: 50%; position: relative; transition: transform .35s cubic-bezier(.3,1.6,.6,1);
  background: repeating-conic-gradient(#2a2a2a 0 6deg, #3a3a3a 6deg 12deg); box-shadow: 0 3px 6px rgba(0,0,0,.5), inset 0 0 0 5px #1d1d1d; }
.knob i { position: absolute; left: 50%; top: 4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: #f0b400; }
.buttons { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tvbtn { cursor: pointer; width: 100%; padding: 10px 6px; border: 0; border-radius: 6px; font: 700 .78rem/1 system-ui, sans-serif; letter-spacing: .08em; color: #2b2822;
  background: linear-gradient(180deg, #faf8f2, #d6d1c4); box-shadow: 0 4px 0 #7d786c, 0 5px 6px rgba(0,0,0,.35), inset 0 1px 0 #fff; transition: transform .06s, box-shadow .06s; }
.tvbtn:hover { background: linear-gradient(180deg, #fff, #e2ddd0); }
.tvbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7d786c, 0 2px 3px rgba(0,0,0,.35), inset 0 1px 0 #fff; }
.tvbtn:focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }
.tvbtn.play { color: #fff; font-size: .9rem; padding: 13px 6px; background: linear-gradient(180deg, #e24a3b, #a8261b); box-shadow: 0 4px 0 #5e140e, 0 5px 6px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.tvbtn.play:hover { background: linear-gradient(180deg, #ee5a4a, #b52e22); }
.tvbtn.play:active { box-shadow: 0 1px 0 #5e140e, inset 0 1px 0 rgba(255,255,255,.4); }
.tvbtn:disabled { opacity: .5; cursor: not-allowed; }
.tvbtn.small { padding: 8px 4px; font-size: .7rem; }
.power { display: flex; align-items: center; gap: 8px; font: 700 .62rem/1 system-ui, sans-serif; letter-spacing: .14em; color: #4a463d; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #3cff5a; box-shadow: 0 0 8px #3cff5a, inset 0 -2px 2px rgba(0,0,0,.3); }
.led.busy { background: #ff4a3a; box-shadow: 0 0 8px #ff4a3a; animation: blink 1s steps(1) infinite; }
.grille { width: 100%; flex: 1; min-height: 60px; border-radius: 8px;
  background: radial-gradient(circle, #3a3833 1.4px, transparent 1.8px) 0 0 / 7px 7px, linear-gradient(#8d897e, #6f6b61); box-shadow: inset 0 2px 5px rgba(0,0,0,.5); }
.feet { display: flex; justify-content: space-between; padding: 0 12%; }
.feet i { width: 70px; height: 22px; background: linear-gradient(#2a1a0f, #120b06); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.hint { margin: 14px 4px 0; color: #e9d8c3; font-size: .9rem; text-align: center; }
.hint b { color: #ffd84a; }

/* ------------------------------------------------------------------ programme TV */
.guide { color: var(--ink); background: var(--paper); border-radius: 3px; padding: 22px 22px 18px; font-family: var(--news);
  box-shadow: 0 20px 40px rgba(0,0,0,.5), inset 0 0 60px rgba(160,130,80,.18); transform: rotate(.6deg); }
.g-head { border-bottom: 4px double var(--ink); padding-bottom: 10px; margin-bottom: 6px; }
.g-kicker { margin: 0; font: 700 .72rem/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .16em; color: var(--red); }
.g-head h1 { margin: 6px 0 0; font: 400 3.4rem/.9 var(--head); letter-spacing: .01em; color: var(--ink); }
.g-head h1 span { display: inline-block; margin-left: 8px; padding: 0 8px; color: var(--paper); background: var(--red); transform: rotate(-3deg); }
.g-week { margin: 8px 0 0; font-style: italic; color: var(--ink-2); }
.channels { list-style: none; margin: 0; padding: 0; }
.chan { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #cfc6b1; scroll-margin-top: 20px; }
.chan.tuned { background: linear-gradient(90deg, rgba(200,38,29,.08), transparent); }
.chan.flash { animation: flash 1.2s; }
@keyframes flash { 30% { background: rgba(255,216,74,.6); } }
.logo { align-self: start; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 4px; color: #fff; background: var(--c); box-shadow: 2px 2px 0 var(--ink); }
.logo b { font: 400 1.9rem/1 var(--head); }
.logo span { font: 700 .56rem/1.1 system-ui, sans-serif; letter-spacing: .06em; text-align: center; margin-top: 3px; }
.progs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.prog { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 8px; width: 100%; text-align: left; cursor: pointer; padding: 5px 6px; border: 0; border-radius: 3px; background: none; color: inherit; font-family: var(--news); }
.prog:hover { background: rgba(0,0,0,.06); }
.prog:focus-visible { outline: 2px solid var(--red); }
.prog.on { background: #fff6c8; box-shadow: inset 3px 0 0 var(--red); }
.prog time { grid-row: span 2; font: 700 1rem/1.3 system-ui, sans-serif; color: var(--red); }
.prog .t { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.prog .m { font-size: .82rem; color: var(--ink-2); line-height: 1.3; }
.prog.free time { color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.prog.free .t { font-weight: 400; font-style: italic; }
.g-foot { margin-top: 14px; font-size: .78rem; line-height: 1.45; color: var(--ink-2); }

/* ------------------------------------------------------------------ petits écrans */
@media (max-width: 980px) {
  .room { grid-template-columns: 1fr; gap: 28px; padding: 16px 16px 40px; }
  .tv { position: static; }
  .guide { transform: none; }
}
@media (max-width: 640px) {
  .cabinet { flex-direction: column; padding: 14px; gap: 14px; border-radius: 18px; }
  .bezel { padding: 10px; border-radius: 20px; }
  .screen { border-radius: 16px / 14px; }
  .panel { width: 100%; display: grid; grid-template-columns: 96px 1fr; grid-template-areas: "badge badge" "dial buttons" "power buttons"; gap: 10px 14px; align-items: center; }
  .badge { grid-area: badge; }
  .dial { grid-area: dial; width: 96px; height: 96px; }
  .dial > span { font-size: .56rem; }
  .knob { width: 48px; height: 48px; }
  .buttons { grid-area: buttons; }
  .power { grid-area: power; justify-content: center; }
  .grille { display: none; }
  .osd { font-size: 1.5rem; }
  .card { padding: 5% 7%; }
  .card .c-top { font-size: 1.1rem; }
  .card h2 { margin-top: 6px; font-size: 2rem; }
  .card .c-meta { font-size: 1rem; margin-top: 2px; }
  .card .c-desc { font-size: 1rem; line-height: 1.15; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.3em; }
  .card .c-lic { font-size: .95rem; }
  .card .c-keys, .card .c-note { display: none; }        /* rappelées sous la télé */
  .card .c-go { font-size: 1.15rem; margin-top: 8px; }
  .card.mire h2 { font-size: 1.5rem; }
  .card.mire .mire-box { width: 90%; padding: 3% 4%; }
  .card.mire .c-desc { -webkit-line-clamp: 4; }
  .g-head h1 { font-size: 2.6rem; }
  .guide { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .glass, .card .c-top em, .card .c-go, .led.busy { animation: none; }
}
