/* Tout est en rem : la taille de base suit la plus petite dimension de l'écran */
html { font-size: clamp(11px, 2.1vmin, 44px); }
section { position: fixed; inset: 0; }
#lobby { display: flex; flex-direction: column; padding: 2rem 3rem 2.2rem; gap: 1.5rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo.big { font-size: 3.6rem; }
.tip { font-family: var(--disp); font-size: 1.7rem; color: var(--paper); }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(17rem, 25rem) 1fr; gap: 2.4rem; }
.join { padding: 1.6rem 1.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .9rem; min-height: 0; }
.join h2 { font-size: 1.9rem; color: var(--gold); }
.qrwrap { background: #fff; border: .25rem solid var(--ink); padding: .6rem; width: min(100%, 16rem); aspect-ratio: 1; display: grid; place-items: center; box-shadow: 0 0 0 .25rem var(--bark); }
.qrwrap canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.or { font-size: 1rem; line-height: 1.35; color: var(--cream); }
.or b { color: var(--paper); }
.codelabel { font-family: var(--disp); font-size: 1.4rem; color: var(--cream); letter-spacing: .12em; }
.code { display: flex; gap: .4rem; }
.code span { width: 3.1rem; height: 3.9rem; display: grid; place-items: center; font-family: var(--disp); font-size: 2.8rem; line-height: 1; color: var(--paper); text-shadow: .16rem 0 var(--ink), -.16rem 0 var(--ink), 0 .16rem var(--ink), 0 -.16rem var(--ink), .16rem .16rem var(--ink), -.16rem -.16rem var(--ink), .16rem -.16rem var(--ink), -.16rem .16rem var(--ink); background: linear-gradient(rgba(255,255,255,.16), rgba(0,0,0,.2)), url(/g/p/mound_1.png) center / 170% auto #5aa02c; border: .2rem solid #2c5412; border-radius: .9rem; box-shadow: 0 .25rem 0 #234410; }

.board { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.slots { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); gap: 1rem 1.2rem; }
.slot { position: relative; display: flex; align-items: center; gap: 1rem; padding: .3rem 1.2rem .3rem .8rem; min-width: 0; background: var(--earth) #4a2a14; background-size: auto, 230px; border: .2rem solid var(--ink); border-radius: 1.5rem; box-shadow: inset 0 0 0 .2rem rgba(255,214,150,.16), 0 .4rem 1rem rgba(20,10,3,.45); }
.slot.empty { background: rgba(35, 23, 18, .45); border: .22rem dashed rgba(245, 183, 132, .6); box-shadow: none; justify-content: center; color: var(--cream); font-family: var(--disp); font-size: 1.7rem; }
.slot.ready { background-color: #123b0c; box-shadow: inset 0 0 0 .22rem var(--leaf), 0 .4rem 1rem rgba(20,10,3,.45); }
.slot.idle { box-shadow: inset 0 0 0 .22rem var(--orange), 0 .4rem 1rem rgba(20,10,3,.45); }
.slot.off { opacity: .6; }
.slot.pop { animation: pop .3s steps(5); }
@keyframes pop { 0% { transform: translateY(-1.2rem); opacity: 0; } 100% { transform: none; opacity: 1; } }
.who { min-width: 0; flex: 1; }
.pname { font-family: var(--disp); font-size: 1.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; color: var(--paper); }
.pstate { font-size: .95rem; color: var(--cream); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .2rem; }
.stamp { position: absolute; right: .8rem; top: .8rem; font-family: var(--disp); font-size: 1.4rem; padding: .05rem .6rem .1rem; border: .18rem solid var(--ink); letter-spacing: .06em; line-height: 1.1; }
.stamp.ok { background: var(--green); color: #fff; } .stamp.warn { background: var(--orange); color: var(--ink); } .stamp.bad { background: var(--red); color: #fff; }
.vote { background: var(--red); color: #fff; padding: .02rem .55rem; font-size: .9rem; border: .15rem solid var(--ink); }

.status { text-align: center; font-family: var(--disp); font-size: 2.3rem; min-height: 3rem; color: var(--paper); }
.status.go { color: var(--leaf); }
.rules { margin: 0; text-align: center; color: var(--paper); font-size: 1rem; line-height: 1.4; text-shadow: 2px 2px 0 var(--ink); }

/* vote */
#vote { display: flex; flex-direction: column; align-items: center; padding: 2rem 3rem; gap: 1.2rem; }
.votetitle { font-size: 4.4rem; color: var(--paper); text-shadow: .2rem 0 var(--ink), -.2rem 0 var(--ink), 0 .2rem var(--ink), 0 -.2rem var(--ink), .2rem .2rem var(--ink), -.2rem -.2rem var(--ink), .2rem -.2rem var(--ink), -.2rem .2rem var(--ink), 0 .4rem 0 var(--ink); }
.timer { width: min(60rem, 80%); height: 1.4rem; border: .22rem solid var(--ink); background: #2b1b12; box-shadow: 0 0 0 .2rem var(--bark); overflow: hidden; }
#timerFill { height: 100%; background: var(--gold); width: 100%; transform-origin: left; }
.cards { flex: 1; min-height: 0; display: flex; gap: 2.4rem; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.gcard { position: relative; width: min(30rem, 44%); display: flex; flex-direction: column; transition: transform .15s steps(4), opacity .2s; padding: .5rem; }
.gcard .cover { position: relative; border: .22rem solid var(--ink); background: var(--sky); }
.gcard .cover canvas { display: block; width: 100%; height: auto; }
.gcard .info { padding: .6rem .5rem .5rem; display: grid; gap: .3rem; }
.gcard h2 { font-size: 2.5rem; color: var(--gold); line-height: 1; }
.gcard p { margin: 0; color: var(--paper); font-size: 1.05rem; line-height: 1.3; }
.voters { display: flex; gap: .2rem; min-height: 3.2rem; align-items: flex-end; flex-wrap: wrap; margin-top: .2rem; }
.gcard.win { transform: scale(1.06); z-index: 2; }
.gcard.win { box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 0 6px var(--ink), 6px 6px 0 rgba(35,23,18,.55); }
.gcard.lose { opacity: .35; transform: scale(.95); }
.gcard .badge { position: absolute; top: -.8rem; right: -.8rem; min-width: 3rem; text-align: center; background: var(--gold); color: var(--ink); border: .2rem solid var(--ink); font-family: var(--disp); font-size: 2.2rem; line-height: 1.1; padding: 0 .6rem; }
.votehint { margin: 0; color: var(--paper); font-family: var(--disp); font-size: 1.8rem; text-shadow: 2px 2px 0 var(--ink); }

/* compte à rebours */
.countdown { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(35, 23, 18, .8); }
.cdwrap { text-align: center; }
.cdgame { font-family: var(--disp); font-size: 4rem; color: var(--gold); text-shadow: .2rem .2rem 0 var(--ink); }
#cdNum { font-family: var(--disp); font-size: 22rem; line-height: .95; color: var(--paper); text-shadow: .5rem 0 var(--ink), -.5rem 0 var(--ink), 0 .5rem var(--ink), 0 -.5rem var(--ink), .5rem .5rem var(--ink), -.5rem -.5rem var(--ink), .5rem -.5rem var(--ink), -.5rem .5rem var(--ink), 0 1rem 0 var(--ink); animation: beat 1s steps(6) infinite; }
@keyframes beat { 0% { transform: scale(1.3); } 40% { transform: scale(1); } 100% { transform: scale(.94); } }

/* fin de partie */
#over { display: grid; place-items: center; }
.overbox { text-align: center; width: min(90vw, 46rem); }
.crown { display: flex; justify-content: center; margin-bottom: .2rem; }
#overTitle { font-size: 4.2rem; margin: .3rem 0 1.2rem; color: var(--gold); text-shadow: .2rem 0 var(--ink), -.2rem 0 var(--ink), 0 .2rem var(--ink), 0 -.2rem var(--ink), .2rem .2rem var(--ink), -.2rem -.2rem var(--ink), .2rem -.2rem var(--ink), -.2rem .2rem var(--ink), 0 .4rem 0 var(--ink); }
.rank { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .8rem; }
.rank li { display: flex; align-items: center; gap: 1rem; padding: .2rem 1.4rem .2rem .8rem; font-family: var(--disp); font-size: 2rem; background: var(--earth) #4a2a14; background-size: auto, 230px; border: .2rem solid var(--ink); border-radius: 1.4rem; box-shadow: inset 0 0 0 .2rem rgba(255,214,150,.16), 0 .4rem 1rem rgba(20,10,3,.45); }
.rank li.first { box-shadow: inset 0 0 0 .25rem var(--gold), 0 .4rem 1rem rgba(20,10,3,.45); }
.rank li .pos { width: 2.2rem; color: var(--gold); }
.rank li .nm { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mut { color: var(--paper); font-size: 1.3rem; text-shadow: 2px 2px 0 var(--ink); }

#game { background: var(--ink); }
#game canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.conn { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; border: .2rem solid var(--ink); padding: .3rem 1.4rem; font-family: var(--disp); font-size: 1.5rem; z-index: 40; }
.fsbtn { position: fixed; right: 1rem; bottom: 1rem; z-index: 35; font-size: 1.1rem !important; opacity: .7; }
.fsbtn:hover { opacity: 1; }
body.is-fs .fsbtn { display: none; }

@media (max-aspect-ratio: 5/4) {
  #lobby { padding: 1.4rem; }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 1.2rem; }
  .join { flex-direction: row; flex-wrap: wrap; gap: 1.2rem; padding: 1rem; }
  .qrwrap { width: 11rem; }
  .gcard { width: min(30rem, 90%); }
}
@media (max-width: 760px) {
  .slots { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: min-content; overflow: auto; }
  #lobby { overflow: auto; }
  .tip { display: none; }
}

/* arrondis */
.qrwrap { border-radius: 1rem; } .stamp, .vote, .gcard .badge, .conn { border-radius: .7rem; }
.gcard .cover { border-radius: 1rem; overflow: hidden; } .timer, #timerFill { border-radius: 99px; }
.slot.empty { border-radius: 1.5rem; } .gcard { border-radius: 1.6rem; }
