/* Chrono de table. Pas de variables CSS ni de grid : compatibilité avec les vieux navigateurs mobiles.
   Couleurs : fond #14161c, surface #1e2129, bord #2c303b, texte #eef0f4, atténué #9aa1b1,
   accent vert #3ddc84 (à toi), jaune #f2c94c (marque), rouge #ff6b6b (alerte). */

* { -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #14161c;
  color: #eef0f4;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100%; }
h1, h2 { margin: 0 0 12px; }
h2 { font-size: 22px; }
a { color: #4fa3ff; }
.hidden { display: none; }
.muted { color: #9aa1b1; }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: #ff6b6b; margin: 8px 0 0; }
.error:empty { display: none; }

.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 32px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.screen.center { padding-top: 30vh; text-align: center; }

.row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.row > * + * { margin-left: 8px; }
.row.wrap { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.row.wrap > * { margin: 0 8px 8px 0; }
.row input { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; }

.topbar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  min-height: 40px; margin-bottom: 8px;
}

.card {
  background: #1e2129;
  border: 1px solid #2c303b;
  border-radius: 14px;
  padding: 14px;
  margin: 0 0 14px;
}
.card-title {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  margin-bottom: 8px;
}
.card p { margin: 4px 0; }

label { display: block; font-weight: 600; margin: 0 0 10px; }
label:last-child { margin-bottom: 0; }
input, select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 18px; /* >= 16px : pas de zoom auto sur iOS */
  color: #eef0f4; background: #14161c;
  border: 1px solid #3a3f4c; border-radius: 10px;
  padding: 10px 12px;
  -webkit-appearance: none; appearance: none;
}
.row input { margin-top: 0; }
input:focus, select:focus { outline: none; border-color: #4fa3ff; }
label.check { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; font-weight: 400; }
label.check input { width: 22px; height: 22px; margin: 0 10px 0 0; -webkit-appearance: checkbox; appearance: auto; }

.btn {
  display: inline-block;
  font: inherit; font-weight: 600;
  color: #eef0f4; background: #2c303b;
  border: 0; border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  -webkit-appearance: none;
}
.btn.primary { background: #3ddc84; color: #0b1f13; }
.btn.danger { background: #4a2328; color: #ffb3b3; }
.btn.big { display: block; width: 100%; font-size: 18px; padding: 16px; margin: 0 0 12px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn:active { opacity: .8; }
.link {
  font: inherit; color: #4fa3ff; background: none; border: 0; padding: 8px 0;
  cursor: pointer; text-decoration: none; -webkit-appearance: none;
}
.icon {
  font: inherit; font-size: 14px;
  color: #eef0f4; background: #2c303b;
  border: 0; border-radius: 8px;
  min-width: 36px; height: 36px; padding: 0 8px; margin-left: 6px;
  cursor: pointer; -webkit-appearance: none;
}
.icon.danger { color: #ff6b6b; }
.icon[disabled] { opacity: .3; }

/* Accueil */
.home { padding-top: 12vh; }
.logo { font-size: 44px; letter-spacing: -1px; text-align: center; margin-bottom: 4px; }
.logo span { display: block; font-size: 18px; letter-spacing: 6px; text-transform: uppercase; color: #f2c94c; }
.tagline { text-align: center; margin: 0 0 28px; }
.code-input { text-transform: uppercase; letter-spacing: 6px; font-size: 22px; font-weight: 700; text-align: center; }
.sep { text-align: center; color: #9aa1b1; margin: 6px 0 18px; }

/* Réglages */
.modes { border: 0; margin: 0 0 6px; padding: 0; }
.mode {
  position: relative;
  border: 2px solid #2c303b; border-radius: 12px;
  padding: 10px 12px 10px 42px; margin: 0 0 8px;
  cursor: pointer; font-weight: 400;
}
.mode input { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; margin: 0; -webkit-appearance: radio; appearance: auto; }
.mode b { display: block; }
.mode small { color: #9aa1b1; }
.mode.on { border-color: #3ddc84; background: #18271f; }
.mode-opts { padding-top: 6px; }

/* Lobby */
.share { text-align: center; }
.share .code { font-size: 54px; font-weight: 800; letter-spacing: 10px; color: #f2c94c; line-height: 1.1; margin: 0 0 6px; padding-left: 10px; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; border-radius: 8px; background: #fff; }
.qr img[src=""] { display: none; }
.plist, .times, .adjust { list-style: none; margin: 0; padding: 0; }
.plist li, .times li, .adjust li {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  padding: 8px 0; border-top: 1px solid #2c303b;
}
.plist li:first-child, .times li:first-child, .adjust li:first-child { border-top: 0; }
.pname { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname em { color: #9aa1b1; font-style: normal; font-size: 13px; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: middle; -webkit-flex-shrink: 0; flex-shrink: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555b69; margin: 0 8px; -webkit-flex-shrink: 0; flex-shrink: 0; }
.dot.on { background: #3ddc84; }

/* Jeu : écran joueur */
.play { min-height: 100%; }
.pass {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  width: 100%; min-height: 52vh;
  margin: 0 0 14px; padding: 20px;
  font: inherit; color: #eef0f4;
  border: 0; border-radius: 24px;
  -webkit-appearance: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.pass.mine { background: #3ddc84; color: #0b1f13; cursor: pointer; -webkit-box-shadow: 0 0 0 6px rgba(61, 220, 132, .25); box-shadow: 0 0 0 6px rgba(61, 220, 132, .25); }
.pass.mine:active { background: #2fbf70; }
.pass.wait { background: #1e2129; border: 1px solid #2c303b; }
.pass.sent { opacity: .6; }
.pass .who { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.pass.mine .who { font-size: 34px; }
.pass .name { font-size: 34px; font-weight: 800; margin: 4px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass .hint { font-size: 15px; font-weight: 600; opacity: .8; }
.big-time { font-size: 72px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 8px 0; }
.big-time.dim { font-size: 44px; color: #9aa1b1; }
.big-time.low, .ptime.low { color: #ff6b6b; }
.pass.mine .big-time.low { color: #7a0a0a; }
.btn.oops { display: block; width: 100%; margin: -4px 0 14px; background: #3a3220; color: #f2c94c; }

.times li { padding-left: 14px; padding-right: 14px; }
.times li.active { background: #222a24; }
.times li.out { opacity: .4; }
.ptime { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 8px; }
.times.compact .ptime { font-size: 18px; }
.over { color: #ff9f43; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.times { background: #1e2129; border: 1px solid #2c303b; border-radius: 14px; padding: 0; margin-bottom: 14px; overflow: hidden; }

/* Vue table */
.tableview .now {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  border: 4px solid #3ddc84; border-radius: 24px; padding: 18px; margin-bottom: 14px; text-align: center;
}
.tableview .now .name { font-size: 40px; font-weight: 800; }
.tableview .now .big-time { font-size: 96px; }
.tableview .ptime { font-size: 26px; }
.tableview .times li { padding-top: 12px; padding-bottom: 12px; font-size: 20px; }

/* Organisateur */
.admin .link { font-weight: 600; }
.admin .row { margin-top: 10px; }
.adjust .icon { font-size: 13px; }

/* Pause */
.overlay {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(10, 11, 15, .92);
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  text-align: center; padding: 24px;
}
.overlay > div { width: 100%; max-width: 360px; }
.overlay h2 { font-size: 44px; letter-spacing: 4px; text-transform: uppercase; color: #f2c94c; }

/* Lancement */
.pick-player { text-align: left; }
.pick-player .chip { width: 16px; height: 16px; margin-right: 12px; }

/* Tirage au sort du premier joueur */
.draw {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 30;
  background: #0a0b0f; /* opaque : l'écran de jeu derrière révélerait le gagnant */
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  text-align: center; padding: 24px;
}
.draw.hidden { display: none; }
.draw > div { width: 100%; max-width: 420px; }
.draw-title { font-size: 20px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #f2c94c; margin: 0 0 20px; }
.draw-name {
  font-size: 44px; font-weight: 800; line-height: 1.15;
  border: 4px solid #2c303b; border-radius: 22px;
  padding: 24px 12px; min-height: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.draw-sub { font-size: 18px; color: #9aa1b1; margin: 18px 0; min-height: 26px; }
.draw-dots .chip { width: 14px; height: 14px; margin: 0 5px; opacity: .3; }
.draw-dots .chip.on { opacity: 1; -webkit-transform: scale(1.5); transform: scale(1.5); }
.draw.reveal .draw-name { -webkit-animation: draw-pop .6s ease-out; animation: draw-pop .6s ease-out; background: #1e2129; }
.draw.reveal .draw-sub { color: #eef0f4; font-size: 24px; font-weight: 700; }
@-webkit-keyframes draw-pop {
  0% { -webkit-transform: scale(1); }
  40% { -webkit-transform: scale(1.18); }
  100% { -webkit-transform: scale(1); }
}
@keyframes draw-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Fin */
.recap { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.recap th { text-align: left; color: #9aa1b1; font-weight: 600; font-size: 13px; padding: 6px 4px; }
.recap td { padding: 8px 4px; border-top: 1px solid #2c303b; white-space: nowrap; }
.recap td:first-child { white-space: normal; }
.recap tr.out td { opacity: .5; }

/* Divers */
.netbar { position: -webkit-sticky; position: sticky; top: 0; z-index: 5; background: #4a2328; color: #ffd6d6; text-align: center; font-size: 14px; padding: 6px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 20;
  max-width: 480px; margin: 0 auto;
  background: #eef0f4; color: #14161c; font-weight: 600;
  border-radius: 12px; padding: 12px 16px; text-align: center;
  -webkit-box-shadow: 0 6px 24px rgba(0, 0, 0, .4); box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}
.toast.hidden { display: none; }
.awake { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.noscript { padding: 24px; text-align: center; }

@media (max-height: 640px) {
  .pass { min-height: 44vh; }
  .big-time { font-size: 56px; }
}
@media (min-width: 900px) {
  .tableview { max-width: 860px; }
  .tableview .now .big-time { font-size: 140px; }
}
