/* ── FONT ── */
@font-face {
  font-family: 'FuturaLT';
  src: url('fonts/FuturaLT-CondensedBoldOblique.ttf') format('truetype');
  font-weight: bold;
  font-style: oblique;
  font-display: swap;
}

@font-face {
  font-family: 'FuturaExtraBold';
  src: url('fonts/FuturaExtraBoldItalic.woff2') format('woff2'),
       url('fonts/FuturaExtraBoldItalic.ttf')   format('truetype');
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
}

body {
  min-height: 100%;
}

body {
  font-family: Verdana, Tahoma, 'MS Sans Serif', Arial, sans-serif;
  font-size: 12px;
  background: url('sfondo.gif') center center / cover no-repeat fixed;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── HEADER ──────────────────────────────────────────────────────
   Misurato da header.png (1669×124px):
   - Giallo #ffce48, strisce graduate y=0–83 (da gradiente.png)
   - Striscia bianca y=108–116 (8px)
   - Banda blu #27477e  y=116–123 (7px), full width
   - Stroke testo: #27477e
   ────────────────────────────────────────────────────────────── */
header {
  height: 124px;
  flex-shrink: 0;
  background-color: transparent;
  background-image:
    /* Striscia gialla graduata (stops esatti da misura px) */
    linear-gradient(
      180deg,
      #ffce48  0px, #ffce48  7px,
      transparent  7px, transparent 11px,
      #ffce48 11px, #ffce48 19px,
      transparent 19px, transparent 25px,
      #ffce48 25px, #ffce48 32px,
      transparent 32px, transparent 39px,
      #ffce48 39px, #ffce48 45px,
      transparent 45px, transparent 53px,
      #ffce48 53px, #ffce48 58px,
      transparent 58px, transparent 67px,
      #ffce48 67px, #ffce48 70px,
      transparent 70px, transparent 82px,
      #ffce48 82px, #ffce48 83px,
      transparent 83px
    ),
    /* Striscia bianca y=108–116 */
    linear-gradient(
      180deg,
      transparent 108px,
      #ffffff     108px,
      #ffffff     116px,
      transparent 116px
    ),
    /* Banda blu y=116–124 */
    linear-gradient(
      180deg,
      transparent 116px,
      #27477e     116px
    );
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px 0 14px;
}

/* Logo: testo RETE-A — misurato da logo.png (387×91px):
   Cap height 63px → font-size 88px ≈ 5.5rem; stroke 6px; fill #fff stroke #27477e */
.logo-wrap {
  flex-shrink: 0;
  line-height: 1;
}

.logo-text {
  font-family: 'FuturaExtraBold', Futura, 'Century Gothic', sans-serif;
  font-weight: bold;
  font-style: italic;
  font-size: 4.2rem;
  color: #ffffff;
  text-shadow:
    -3px -3px 0 #27477e, -1px -3px 0 #27477e,  1px -3px 0 #27477e,  3px -3px 0 #27477e,
     3px -1px 0 #27477e,  3px  1px 0 #27477e,  3px  3px 0 #27477e,
     1px  3px 0 #27477e, -1px  3px 0 #27477e, -3px  3px 0 #27477e,
    -3px  1px 0 #27477e, -3px -1px 0 #27477e;
  letter-spacing: 1px;
  line-height: 1;
  display: block;
}

/* Data/ora: misurata da data.png
   - Fill #ffffff, stroke #27477e (identici al logo)
   - Altezza testo 42px in 124px header → font-size ~36px
   - Posizione: 21px sotto centro → align-self flex-end + padding-bottom 20px */
.header-clock {
  font-family: 'FuturaExtraBold', Futura, 'Century Gothic', sans-serif;
  font-weight: bold;
  font-style: italic;
  font-size: 1.7rem;
  color: #ffffff;
  text-shadow:
    -2px -2px 0 #27477e,  0   -2px 0 #27477e,  2px -2px 0 #27477e,
     2px  0   0 #27477e,  2px  2px 0 #27477e,
     0    2px 0 #27477e, -2px  2px 0 #27477e, -2px  0   0 #27477e;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  align-self: flex-end;
  padding-bottom: 20px;
}

/* ── DESKTOP ── */
.desktop {
  flex: 1;
  background: transparent;
  display: flex;
  gap: 10px;
  padding: 12px 10px 10px;
  align-items: flex-start;
}

.left-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.right-col {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* ── OVERRIDE 98.CSS PER LAYOUT ── */

/* Le finestre si comportano come block nel nostro layout */
.window {
  display: flex;
  flex-direction: column;
}

/* Barra sotto la titlebar (sottotitolo stream) */
.win-menubar {
  background: #c0c0c0;
  font-size: 11px;
  font-family: Tahoma, sans-serif;
  padding: 1px 6px 2px;
  border-bottom: 1px solid #808080;
  color: #000;
  flex-shrink: 0;
}

/* ── FINESTRA DIRETTA ── */
#win-diretta .window-body {
  padding: 0;
  margin: 2px;
  display: flex;
  flex-direction: column;
  background: #000;
}

.video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background: #000;
  flex-shrink: 0;
}

#videoWrapper {
  position: absolute;
  inset: 0;
}

#playerIframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

#videoLogo {
  position: absolute;
  bottom: 48px;
  right: 12px;
  width: 80px;
  max-width: 18%;
  opacity: 0.92;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.85));
}

#startOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
}

#startOverlay:hover { background: rgba(0,0,0,0.55); }

.play-circle {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
}

/* ── FINESTRA DESCRIZIONE ── */
#win-desc .window-body {
  margin: 2px;
  padding: 0;
}

#win-desc .sunken-panel {
  max-height: 150px;
  overflow-y: auto;
  padding: 10px 12px;
  width: 100%;
}

.desc-text {
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.75;
  color: #000;
}

.desc-text p + p { margin-top: 6px; }
.desc-text a { color: #0000cc; text-decoration: underline; }
.desc-text a:hover { color: #cc0000; }

/* ── MENU BAR STILE mIRC ── */
.mirc-menubar {
  background: #c0c0c0;
  display: flex;
  gap: 0;
  padding: 1px 2px;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.mirc-menubar span {
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 11px;
  color: #000;
  padding: 2px 6px;
  cursor: default;
  user-select: none;
}

.mirc-menubar span:hover {
  background: #000080;
  color: #fff;
}

/* ── FINESTRA CHAT ── */
#win-chat {
  flex: 1;
}

#win-chat .window-body {
  flex: 1;
  padding: 0;
  margin: 2px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #000;
}

#chatIframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  min-height: 480px;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  header {
    height: 70px;
    background-image:
      linear-gradient(180deg,
        #ffce48  0px, #ffce48  4px,
        transparent  4px, transparent  7px,
        #ffce48  7px, #ffce48 13px,
        transparent 13px, transparent 18px,
        #ffce48 18px, #ffce48 23px,
        transparent 23px, transparent 29px,
        #ffce48 29px, #ffce48 33px,
        transparent 33px
      ),
      linear-gradient(180deg, transparent 56px, #ffffff 56px, #ffffff 63px, transparent 63px),
      linear-gradient(180deg, transparent 63px, #27477e 63px);
  }
  .header-inner { padding: 0 10px; align-items: center; }
  .header-clock { font-size: 1.0rem; padding-bottom: 0; align-self: center; }
  .logo-text { font-size: 1.7rem; }
  .desktop {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
    align-items: stretch;
    overflow: auto;
  }
  .right-col { width: 100%; }
  #chatIframe { min-height: 380px; }
  #videoLogo { width: 45px; max-width: 10%; bottom: 28px; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 1.3rem; }
  .header-clock { font-size: 0.78rem; }
}

/* ── LANDSCAPE MOBILE: header minimo ── */
@media (orientation: landscape) and (max-height: 500px) {
  header {
    height: 40px;
    background-image:
      linear-gradient(180deg, #ffce48 0px, #ffce48 31px, transparent 31px, transparent 34px, #ffffff 34px, #ffffff 38px, #27477e 38px);
  }
  .header-inner { padding: 0 8px; align-items: center; }
  .logo-text { font-size: 1.1rem; }
  .header-clock { display: none; }
}
