/* TV: leesbaar van een paar meter afstand. Maten in vh, zodat het op elke tv schaalt. */
body.tv { font-size: 2.4vh; }
.tv .screen { position: absolute; inset: 0; z-index: 1; }

/* ------------------------------------------------------------ start-overlay */
#start-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh;
  background: radial-gradient(ellipse at center, rgba(92, 7, 16, .9), rgba(30, 2, 5, .97));
}
#start-overlay .btn { font-size: 5vh; padding: 3vh 6vh; border-radius: 3vh; animation: float 3s ease-in-out infinite; }
#start-overlay p { font-size: 2.4vh; opacity: .8; margin: 0; }

/* ------------------------------------------------------------ lobby */
#lobby { display: flex; flex-direction: column; align-items: center; padding: 5vh 5vw 3vh; }
.tv-title { font-size: 10vh; line-height: .95; text-align: center; }
.tv-title small { display: block; font-size: 4.6vh; color: var(--cream); text-shadow: 0 3px 0 var(--red-1); margin-top: 1vh; }
.lobby-grid { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 5vw; width: 100%; max-width: 92vw; margin-top: 4vh; min-height: 0; }
.join-card {
  background: var(--cream); color: var(--ink);
  border-radius: 3vh; padding: 3vh; text-align: center;
  box-shadow: 0 1vh 0 var(--gold-deep), 0 2vh 5vh rgba(0, 0, 0, .45);
  border: .6vh solid var(--gold);
  align-self: start;
}
.qr svg { display: block; width: 100%; height: 100%; }
.qr.big { width: 42vh; height: 42vh; }
.join-card .step { font-size: 3vh; font-weight: 800; margin-top: 2vh; }
.join-card .url { font-size: 2.4vh; opacity: .75; margin-top: .6vh; word-break: break-all; }
.room-code { font-family: var(--display); font-size: 7vh; letter-spacing: 1.2vh; color: var(--red-3); line-height: 1; margin-top: 1.4vh; }
.players-card { min-height: 0; display: flex; flex-direction: column; }
.players-card h2 { font-size: 5vh; margin-bottom: 2vh; }
#lobby-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(22vh, 1fr)); gap: 3vh 2vw; align-content: start; }
#lobby-players li { display: flex; flex-direction: column; align-items: center; gap: 1.2vh; animation: pop-in .5s ease-out both; position: relative; }
#lobby-players .avatar { --size: 17vh; }
#lobby-players .name { font-family: var(--display); font-size: 3.6vh; text-align: center; text-shadow: 0 .3vh 0 var(--red-1); max-width: 24vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby-players .crown { position: absolute; top: -3.6vh; font-size: 5vh; filter: drop-shadow(0 .4vh .4vh rgba(0, 0, 0, .4)); }
#lobby-players li.off { opacity: .45; }
.lobby-hint { font-size: 3vh; margin-top: auto; padding-top: 2vh; opacity: .9; }
.lobby-empty { font-size: 3.4vh; opacity: .8; }

/* ------------------------------------------------------------ spel */
#game { display: grid; grid-template-columns: 1fr 36vh; grid-template-rows: auto 1fr; gap: 1.5vh 2.5vh; padding: 3vh 3vh 3vh 3vh; }
#game header { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 2vh; }
#game header h1 { font-size: 5.6vh; }
#game .total { font-family: var(--display); font-size: 4.4vh; }
.board-wrap { position: relative; min-height: 0; min-width: 0; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; }
#frames { position: absolute; inset: 0; pointer-events: none; }
.vp-frame {
  position: absolute;
  border: .55vh solid; border-radius: 1vh;
  box-shadow: 0 0 0 .25vh rgba(0, 0, 0, .35), inset 0 0 0 .2vh rgba(255, 255, 255, .35);
  transition: left .25s ease-out, top .25s ease-out, width .25s ease-out, height .25s ease-out, opacity .4s;
}
.vp-frame .tag { position: absolute; left: -1.8vh; top: -1.8vh; }
.vp-frame .avatar { --size: 5vh; }

#progress { display: flex; flex-direction: column; gap: 1.6vh; min-height: 0; overflow: hidden; padding-bottom: 24vh; }
.prow { display: grid; grid-template-columns: 6vh 1fr; grid-template-rows: auto auto; column-gap: 1.2vh; align-items: center; }
.prow .avatar { --size: 6vh; grid-row: 1 / 3; }
.prow .pname { font-family: var(--display); font-size: 2.6vh; display: flex; justify-content: space-between; gap: 1vh; min-width: 0; }
.prow .pname span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.prow .pname b { font-weight: 400; color: var(--gold); flex: none; }
.prow .bar { height: 1.8vh; background: rgba(0, 0, 0, .35); border-radius: 1vh; overflow: hidden; border: .2vh solid rgba(255, 255, 255, .2); }
.prow .bar i { display: block; height: 100%; width: 0; border-radius: 1vh; transition: width .4s ease-out; }
.prow.off { opacity: .5; }
.prow.done .bar i { background-image: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.6), rgba(255,255,255,0)) !important; background-size: 50% 100%; animation: shimmer 2s linear infinite; }
.prow .helper { font-size: 2vh; opacity: .9; }

/* ------------------------------------------------------------ qr in de hoek */
#qr-corner {
  position: fixed; right: 2.5vh; bottom: 2.5vh; z-index: 60;
  background: var(--cream); color: var(--ink);
  border-radius: 1.6vh; padding: 1vh; text-align: center;
  border: .4vh solid var(--gold);
  box-shadow: 0 1vh 3vh rgba(0, 0, 0, .4);
}
#qr-corner .qr { width: 15vh; height: 15vh; }
#qr-corner .code { font-family: var(--display); font-size: 2.8vh; letter-spacing: .5vh; color: var(--red-3); line-height: 1.1; margin-top: .4vh; }

/* ------------------------------------------------------------ meldingen */
#pause-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(40, 3, 8, .75); backdrop-filter: blur(4px);
  font-family: var(--display); font-size: 12vh; color: var(--gold);
  text-shadow: 0 .6vh 0 var(--brown);
}
#pause-overlay small { font-size: 4vh; color: var(--cream); }
#banner {
  position: fixed; left: 50%; top: 40%; z-index: 85;
  transform: translate(-50%, -50%) scale(.3); opacity: 0;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink); border: .7vh solid var(--cream);
  border-radius: 3vh; padding: 3vh 7vh;
  font-family: var(--display); font-size: 9vh; white-space: nowrap;
  box-shadow: 0 1.2vh 0 var(--gold-deep), 0 3vh 8vh rgba(0, 0, 0, .5);
  pointer-events: none;
  transition: transform .45s cubic-bezier(.2, 1.6, .4, 1), opacity .3s;
}
#banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
#banner small { display: block; font-size: 3.6vh; text-align: center; }
#conn-lost { position: fixed; left: 50%; top: 2vh; transform: translateX(-50%); background: #000c; padding: 1vh 2vh; border-radius: 1vh; z-index: 99; font-size: 2.2vh; }

/* ------------------------------------------------------------ onthulling */
/* onderaan ruimte voor de onthullingstekst, zodat die niet over het bord (en de X) valt */
body.revealing #game { grid-template-columns: 1fr; grid-template-rows: 1fr; padding: 2vh 2vh 24vh; }
body.revealing #game header, body.revealing #progress, body.revealing #frames { display: none; }
#reveal-text {
  position: fixed; left: 50%; bottom: 3vh; z-index: 70;
  transform: translate(-50%, 4vh); opacity: 0;
  max-width: 78vw; text-align: center;
  background: linear-gradient(180deg, rgba(142, 14, 27, .95), rgba(92, 7, 16, .95));
  border: .6vh solid var(--gold); border-radius: 3vh;
  padding: 2vh 5vh;
  font-family: var(--display); font-size: 6.6vh; line-height: 1.05;
  color: var(--gold); text-shadow: 0 .5vh 0 var(--brown);
  box-shadow: 0 2vh 6vh rgba(0, 0, 0, .6);
  transition: opacity .9s, transform .9s cubic-bezier(.2, 1.4, .4, 1);
  pointer-events: none;
}
#reveal-text.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ finale */
#finale { display: flex; flex-direction: column; align-items: center; padding: 5vh 5vw; gap: 3vh; text-align: center; }
#finale h1 { font-size: 11vh; line-height: 1; }
#finale .fin-body { display: flex; gap: 5vh; align-items: center; justify-content: center; flex: 1; min-height: 0; }
#finale canvas { height: 46vh; border-radius: 2vh; border: .7vh solid var(--gold); box-shadow: 0 2vh 6vh rgba(0, 0, 0, .5); }
#finale .fin-text { font-family: var(--display); font-size: 5vh; color: var(--gold); text-shadow: 0 .4vh 0 var(--brown); max-width: 40vw; }
#finale ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 4vh; flex-wrap: wrap; justify-content: center; }
#finale li { display: flex; flex-direction: column; align-items: center; gap: 1vh; font-size: 2.6vh; }
#finale li .avatar { --size: 13vh; }
#finale li b { font-family: var(--display); font-weight: 400; font-size: 3.2vh; }
