/* LUDOVIC — the blue, red, yellow and green identity of the supplied logo. */
:root {
  --ink: #142d58;
  --muted: #667a99;
  --paper: #f1f6ff;
  --line: #dce6f4;
  --green: #147eb8;
  --lime: #ffd236;
  --orange: #ee464c;
  --white: #fff;
  --shadow: 0 8px 28px #1639680b;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
body {
  background:
    radial-gradient(ellipse at 88% 0%, #e1f3ff 0, transparent 46%), #f3f7ff;
}
h1,
h2,
h3 {
  font-weight: 800;
}
h1 {
  letter-spacing: -1.25px;
}
.shell {
  grid-template-columns: 252px 1fr;
}
.sidebar {
  padding: 25px 20px;
  background: #fff;
  border-right: 2px solid #e4ecf8;
  width: auto;
}
.brand {
  margin-bottom: 38px;
  gap: 10px;
  letter-spacing: 0;
}
.brand-logo {
  width: 63px;
  height: 63px;
  object-fit: contain;
  border: 1px solid #e1eaf6;
  border-radius: 17px;
  background: #fff;
  flex-shrink: 0;
}
.brand strong {
  display: block;
  color: #142d58;
  font-size: 24px;
  letter-spacing: 0.5px;
  font-weight: 900;
}
.brand small {
  display: block;
  color: #637a9b;
  font-size: 9px;
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.navlabel {
  color: #8a9bb3;
}
.nav button {
  border: 1px solid transparent;
  font-size: 13px;
}
.nav button span {
  color: #218dcb;
}
.nav button.active {
  background: #e8f4ff;
  border-color: #cce7fa;
  box-shadow: inset 4px 0 0 #ffd236;
  color: #135b91;
}
.nav button:hover {
  background: #f1f7ff;
}
.nav button:nth-child(3n + 2) span {
  color: #e9474e;
}
.nav button:nth-child(3n) span {
  color: #44a65b;
}
.side-card {
  background: #edf7ff;
  border: 1px solid #d6eaf8;
  color: #142d58;
}
.side-card > span {
  color: #f6bd1b;
}
.avatar {
  background: #ffda3f;
  color: #142d58;
}
.topbar {
  background: #ffffffd9;
  border-bottom-color: #dce6f4;
  height: 84px;
}
.topbar-right > .pill {
  background: #f3faff;
  color: #2675a4;
  border-color: #d8eefa;
}
.content {
  padding-top: 32px;
}
.eyebrow {
  color: #1a85be;
  letter-spacing: 2px;
}
.heading h1 {
  color: #142d58;
}
.btn {
  border-radius: 11px;
  border: 1.5px solid #dce6f4;
  font-weight: 800;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
  filter: none;
  box-shadow: 0 5px 12px #18335a12;
}
.btn.primary {
  background: #198fc8;
  border-color: #147db4;
  box-shadow: 0 3px 0 #11699c;
  color: #fff;
}
.btn.primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #11699c;
}
.btn.lime {
  background: #ffd236;
  color: #142d58;
  border-color: #e6b91c;
  box-shadow: 0 3px 0 #b88b13;
}
.btn.danger {
  color: #d63c48;
  background: #fff3f4;
  border-color: #f6d8db;
}
.pill {
  border-radius: 11px;
}
.hero {
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 100%, #244a7d, transparent 60%), #142d58;
  grid-template-columns: 1.35fr 1fr;
  min-height: 285px;
  padding: 32px 35px;
  border: 2px solid #10264d;
  box-shadow: 0 7px 0 #d5e4f5;
  color: #fff;
  margin-bottom: 30px;
}
.hero:before {
  content: "+";
  position: absolute;
  right: 36%;
  top: 18px;
  font-size: 50px;
  font-weight: 900;
  color: #f04a50;
  transform: rotate(12deg);
  opacity: 0.85;
  pointer-events: none;
}
.hero:after {
  content: "÷";
  position: absolute;
  right: 18px;
  bottom: 8px;
  font-size: 48px;
  font-weight: 900;
  color: #ffd236;
  transform: rotate(-13deg);
  pointer-events: none;
}
.hero .eyebrow {
  color: #ffd236;
}
.hero h2 {
  font-size: 32px;
  max-width: 470px;
}
.hero p {
  color: #c8def3;
}
.hero-art {
  transform: none;
  isolation: isolate;
  align-self: center;
  justify-self: center;
}
.hero-logo {
  width: 255px;
  height: 255px;
  object-fit: contain;
  background: white;
  border-radius: 30px;
  transform: rotate(3deg);
  box-shadow: 0 8px 0 #0b1d3a;
  border: 4px solid white;
}
.stat,
.card {
  border: 1.5px solid #dce6f4;
  border-radius: 17px;
  box-shadow: 0 5px 0 #e2ebf6;
}
.stat {
  border-top: 4px solid #26a9df;
}
.stat:nth-child(2) {
  border-top-color: #48b65e;
}
.stat:nth-child(3) {
  border-top-color: #ffd236;
}
.stat:nth-child(4) {
  border-top-color: #ef4a50;
}
.stat .symbol {
  background: #e8f6ff;
  color: #1787c0;
  font-weight: 900;
}
.stat:nth-child(2) .symbol {
  background: #ecf8ed;
  color: #35954b;
}
.stat:nth-child(3) .symbol {
  background: #fff7d8;
  color: #a67d0b;
}
.stat:nth-child(4) .symbol {
  background: #fff0f1;
  color: #db3f48;
}
.stat strong {
  font-size: 30px;
  color: #142d58;
}
.card-head h2 {
  font-size: 18px;
  color: #142d58;
}
.room-icon {
  background: #eaf6ff;
  color: #1889c1;
  border: 1px solid #cde8f8;
}
.room-tile {
  border-top-color: #e8eef8;
}
.status {
  background: #eaf6ff;
  color: #187fb0;
  border: 1px solid #d4eafa;
}
.status.question,
.status.selection {
  background: #fff5cd;
  color: #8f6b0d;
  border-color: #f7e5a3;
}
.status.computer {
  background: #e9f4ff;
  color: #156dba;
  border-color: #badcf8;
}
.status.completed {
  background: #eaf8ee;
  color: #308845;
}
.bar-track {
  background: #edf3fc;
}
.bar-fill {
  background: linear-gradient(90deg, #1c91ca, #34b8e7);
}
.empty {
  background: #f5f9ff;
  color: #7588a3;
  border: 1px dashed #dfebf8;
}
.notice {
  background: #fff9df;
  border: 1px solid #f3de91;
  color: #6d571a;
}
.error {
  background: #fff0f2;
  color: #b73140;
}
.field input,
.field select,
.field textarea,
input.control,
select.control {
  border: 1.5px solid #d8e4f4;
  border-radius: 10px;
  padding: 12px;
  color: #142d58;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #27a8df;
  outline: 3px solid #dff3fd;
  outline-offset: 1px;
}
.checks input {
  accent-color: #168ec6;
}
th {
  color: #6480a4;
  background: #eff6ff;
}
td,
th {
  border-bottom-color: #e6eef9;
}
.badge {
  background: #eef7ff;
  color: #235c8b;
  border: 1px solid #d9eaf8;
}
.profile {
  border-top-color: #dce6f4;
}
.dialog-head {
  border-bottom: 1px solid #e0e9f5;
  padding-bottom: 17px;
}
dialog {
  border: 2px solid #d7e8f9;
  border-radius: 21px;
  box-shadow: 0 22px 80px #152d5829;
}
dialog::backdrop {
  background: #142d5888;
}
.login {
  grid-template-columns: 1.1fr 1fr;
  background: #f5f9ff;
}
.login-intro {
  padding: 36px 7vw 42px;
  background:
    radial-gradient(circle at 20% 80%, #234d82, transparent 60%), #142d58;
  align-items: flex-start;
}
.login-intro .brand {
  margin-bottom: 15px;
}
.login-intro .brand strong {
  color: white;
}
.login-intro .brand small {
  color: #c1d8ef;
}
.login-intro .brand-logo {
  width: 55px;
  height: 55px;
}
.login-logo-panel {
  width: min(340px, 80%);
  align-self: center;
  aspect-ratio: 1;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 0 #0d2042;
  margin: 7px 0 29px;
  transform: rotate(-2deg);
  overflow: hidden;
}
.login-logo-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-intro h1 {
  font-size: clamp(34px, 3.4vw, 53px);
  letter-spacing: -1.7px;
  margin-bottom: 15px;
}
.login-intro p {
  color: #c4d9ef;
  margin-bottom: 20px;
}
.login-intro .eyebrow {
  color: #ffd236;
}
.login-form {
  max-width: 500px;
  padding: 45px;
}
.login-form h2 {
  color: #142d58;
}
.login-form .btn.primary {
  padding: 14px;
}
.login-foot {
  font-size: 12px;
}
.board-viewport {
  background: radial-gradient(circle, #fff 20%, #edf6ff 100%);
  border: 1px solid #e2ecf8;
}
.board-card {
  border-top: 5px solid #25a7dd;
}
.track {
  fill: #fff;
  stroke: #b8d0e9;
  stroke-width: 1.2;
}
.safe {
  fill: #fff1ac;
  stroke: #e1bf48;
}
.token.legal {
  filter: drop-shadow(0 0 5px #ffc52e);
  stroke: #142d58;
  stroke-width: 3;
}
.player-line.current {
  background: #fff6d5;
  border: 1px solid #f4df8e;
}
.timer {
  background: #fff1b7;
  color: #86600c;
  font-weight: 800;
}
.win {
  background: linear-gradient(145deg, #e6f9ed, #effbff);
  border: 2px solid #9cd9ac;
  color: #1e6a3d;
}
.computer-thinking {
  padding: 23px 0;
}
.computer-thinking > span {
  font-size: 52px;
  display: block;
  margin-bottom: 15px;
}
.computer-thinking h2 {
  font-size: 23px;
}
.computer-thinking p {
  color: #6d819c;
  font-size: 13px;
}
#toast {
  background: #142d58;
  border: 1px solid #278fc1;
}
details {
  margin: 13px 0;
  padding: 9px;
  border: 1px solid #dce7f5;
  border-radius: 10px;
}
summary {
  cursor: pointer;
  font-weight: 700;
  color: #246a9c;
}
@media (min-width: 1500px) {
  .hero-logo {
    width: 275px;
    height: 275px;
  }
  .hero {
    min-height: 315px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 215px 1fr;
  }
  .sidebar {
    padding: 23px 13px;
  }
  .brand strong {
    font-size: 21px;
  }
  .brand-logo {
    width: 48px;
    height: 48px;
  }
  .brand small {
    font-size: 8px;
  }
  .hero {
    padding: 26px;
    grid-template-columns: 1.3fr 1fr;
  }
  .hero-logo {
    width: 210px;
    height: 210px;
  }
  .hero h2 {
    font-size: 28px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    padding: 14px 17px;
    border-right: 0;
    border-bottom: 2px solid #dfebf8;
  }
  .sidebar .brand {
    margin-bottom: 0;
  }
  .brand-logo {
    width: 48px;
    height: 48px;
  }
  .brand strong {
    font-size: 24px;
  }
  .brand small {
    font-size: 9px;
  }
  .nav button {
    font-size: 12px;
  }
  .topbar {
    height: 61px;
  }
  .hero {
    min-height: 228px;
    grid-template-columns: 1fr 125px;
    padding: 23px 20px;
    gap: 12px;
  }
  .hero h2 {
    font-size: 23px;
  }
  .hero p {
    font-size: 12px;
  }
  .hero-logo {
    width: 125px;
    height: 125px;
    border-radius: 18px;
    box-shadow: 0 5px 0 #0b1d3a;
  }
  .hero-art {
    transform: none;
  }
  .hero:before {
    right: 25%;
    font-size: 30px;
  }
  .hero:after {
    font-size: 31px;
    right: 8px;
  }
  .hero .btn {
    font-size: 11px;
    padding: 11px;
  }
  .hero .eyebrow {
    font-size: 8px;
  }
  .login {
    display: block;
  }
  .login-intro {
    padding: 28px 30px;
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 8px 12px;
  }
  .login-intro > .brand {
    grid-column: 1/-1;
    margin-bottom: 12px;
  }
  .login-logo-panel {
    width: 130px;
    grid-column: 2;
    grid-row: 2/6;
    margin: 0;
    align-self: center;
  }
  .login-intro h1 {
    font-size: 33px;
    grid-column: 1;
    margin: 0;
  }
  .login-intro > .eyebrow {
    font-size: 8px;
    grid-column: 1;
  }
  .login-intro > p {
    font-size: 12px;
    grid-column: 1;
    margin: 7px 0;
  }
  .login-intro > .row {
    grid-column: 1/-1;
  }
  .login-form {
    padding: 27px 30px;
  }
  .heading {
    gap: 10px;
  }
  .heading h1 {
    font-size: 28px;
  }
  .content {
    padding-top: 24px;
  }
  .hero h2 br {
    display: none;
  }
}
@media (max-width: 390px) {
  .hero {
    grid-template-columns: 1fr 94px;
  }
  .hero-logo {
    width: 94px;
    height: 94px;
  }
  .hero h2 {
    font-size: 21px;
  }
  .login-intro {
    grid-template-columns: 1fr 105px;
    padding: 22px;
  }
  .login-logo-panel {
    width: 105px;
  }
  .login-intro h1 {
    font-size: 29px;
  }
  .login-form {
    padding: 25px 22px;
  }
}
@media print {
  body {
    background: white;
  }
  .card,
  .stat {
    box-shadow: none;
  }
  .hero {
    box-shadow: none;
  }
  .hero-logo {
    transform: none;
    box-shadow: none;
  }
}
/* Game view: fit the board to the available desktop viewport at normal browser zoom. */
.board-viewport svg.conventional-board {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.board-viewport {
  overflow: hidden;
  max-height: none;
}
@media (min-width: 1000px) and (min-height: 600px) {
  .shell:has(.game-grid) {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .shell:has(.game-grid) .topbar {
    height: 56px;
    padding: 0 20px;
  }
  .shell:has(.game-grid) .sidebar {
    padding: 18px 14px;
  }
  .shell:has(.game-grid) .brand {
    gap: 7px;
    margin-bottom: 20px;
  }
  .shell:has(.game-grid) .brand-logo {
    width: 48px;
    height: 48px;
  }
  .shell:has(.game-grid) .brand strong {
    font-size: 21px;
  }
  .shell:has(.game-grid) .nav button {
    font-size: 14px;
  }
  .content:has(.game-grid) {
    padding: 12px 18px;
    max-width: none;
  }
  .content:has(.game-grid) > .heading {
    height: 48px;
    margin-bottom: 10px;
  }
  .content:has(.game-grid) > .heading .eyebrow,
  .content:has(.game-grid) > .heading p {
    display: none;
  }
  .content:has(.game-grid) > .heading h1 {
    font-size: 26px;
    margin: 0;
  }
  .game-grid {
    height: calc(100dvh - 138px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
  }
  .game-grid .board-card {
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .game-grid .board-card > .row {
    padding: 3px 6px !important;
    flex-shrink: 0;
    min-height: 30px;
  }
  .game-grid .board-card > .row small {
    font-size: 13px;
  }
  .game-grid .board-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .game-grid .board-viewport svg {
    height: 100%;
    width: 100%;
    max-height: 100%;
  }
  .game-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }
  .game-panel > .card {
    margin: 0;
    padding: 12px;
  }
  .game-panel .card-head {
    margin-bottom: 8px;
  }
  .game-panel .card-head h2 {
    font-size: 16px;
  }
  .game-panel p {
    margin-bottom: 8px;
    line-height: 1.35;
    font-size: 14px;
  }
  .game-panel small,
  .game-panel .help {
    font-size: 13px;
    line-height: 1.3;
  }
  .game-panel .eyebrow {
    font-size: 12px;
    letter-spacing: 0.7px;
    margin: 8px 0;
  }
  .game-panel .question {
    font-size: 28px;
    margin: 12px 0;
  }
  .game-panel .field {
    margin: 8px 0;
  }
  .game-panel .field label {
    font-size: 14px;
  }
  .game-panel .answer-input {
    font-size: 24px !important;
    padding: 8px;
  }
  .game-panel .btn {
    font-size: 14px;
    padding: 9px 12px;
  }
  .game-panel .notice {
    padding: 9px;
    font-size: 14px;
  }
  .game-panel .player-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 5px;
  }
  .game-panel .player-line {
    padding: 5px;
    gap: 5px;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    align-items: center;
    font-size: 14px;
  }
  .game-panel .player-line strong {
    overflow-wrap: anywhere;
  }
  .game-panel .online {
    grid-column: 2;
    font-size: 12px;
    margin: 0;
  }
  .game-panel .computer-thinking {
    padding: 8px 0;
  }
  .game-panel .computer-thinking > span {
    font-size: 32px;
    margin-bottom: 6px;
  }
  .game-panel .computer-thinking h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }
}
@media (min-width: 1600px) and (min-height: 850px) {
  .game-grid {
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 20px;
  }
  .game-panel > .card {
    padding: 18px;
  }
  .game-panel p,
  .game-panel .player-line {
    font-size: 15px;
  }
  .game-panel .question {
    font-size: 34px;
  }
}
@media (min-width: 1000px) and (min-height: 600px) {
  .game-grid {
    grid-template-rows: minmax(0, 1fr);
  }
  .game-panel {
    min-height: 0;
  }
  .game-panel > .card {
    padding: 10px;
    flex-shrink: 0;
  }
  .game-panel .status {
    font-size: 13px;
    margin: 0;
    letter-spacing: 0;
    line-height: 1.3;
  }
  .game-panel .card-head {
    margin-bottom: 6px;
  }
  .game-panel .player-line {
    padding: 4px;
    row-gap: 1px;
  }
  .game-panel .notice {
    margin: 8px 0 0;
  }
  .game-panel > .card:last-child p {
    margin-bottom: 4px;
  }
}
@media (min-width: 1000px) and (min-height: 600px) and (max-height: 849px) {
  .game-panel .player-line {
    display: flex;
    padding: 5px 4px;
    min-height: 28px;
  }
  .game-panel .player-line strong {
    font-size: 14px;
  }
  .game-panel .online {
    margin-left: auto;
    font-size: 0;
  }
  .game-panel .online::after {
    content: attr(data-short);
    font-size: 12px;
  }
  .game-panel .question {
    margin: 8px 0;
  }
  .game-panel .eyebrow {
    margin: 6px 0;
  }
  .game-panel .field {
    margin: 6px 0;
  }
  .game-panel p {
    margin-bottom: 5px;
  }
  .game-panel .notice {
    padding: 6px;
    margin-top: 6px;
  }
}
@media (min-width: 1000px) and (min-height: 600px) and (max-height: 849px) {
  .game-panel > .card {
    padding: 8px;
  }
  .game-panel .status.question {
    margin: 0;
    font-size: 13px;
  }
  .game-panel #answer-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: end;
  }
  .game-panel #answer-form .field {
    min-width: 0;
    margin: 0;
  }
  .game-panel #answer-form p:empty {
    display: none;
  }
  .game-panel #answer-form button {
    min-height: 46px;
  }
  .game-panel #answer-form:has([name="remainder"]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .game-panel #answer-form:has([name="remainder"]) input {
    font-size: 20px !important;
  }
  .game-panel .help {
    margin-top: 6px;
  }
  .game-panel .player-line {
    min-height: 22px;
    padding: 3px 4px;
  }
}
@media (min-width: 1000px) and (min-height: 600px) and (max-height: 849px) {
  .game-panel #question-box > .row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .game-panel #question-box > .row .btn {
    padding: 9px 4px;
    white-space: nowrap;
  }
  .game-panel #question-box > h2 {
    font-size: 20px;
    margin: 8px 0;
  }
}

@media (min-width: 1200px) and (min-height: 600px) and (max-height: 699px) {
  .game-grid {
    grid-template-columns: minmax(0, 1fr) 470px;
  }
  .game-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }
  .game-panel > .card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .game-panel > .card:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
  .game-panel > .card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  .game-panel .player-list {
    grid-template-columns: 1fr;
  }
  .game-panel .question {
    font-size: 24px;
  }
  .game-panel #answer-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .game-panel #answer-form button {
    min-height: 36px;
    padding: 6px;
  }
  .game-panel #answer-form:has([name="remainder"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-panel #answer-form:has([name="remainder"]) button {
    grid-column: 1 / -1;
  }
  .game-panel #question-box > .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) and (min-height: 600px) and (max-height: 699px) {
  .shell:has(.game-grid) .side-card {
    display: none;
  }
}
/* Long 4–20-number questions keep readable text without squeezing the board UI. */
.game-panel .question.long-question {
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
@media (min-width: 1200px) and (min-height: 600px) and (max-height: 849px) {
  .game-grid:has(.long-question) {
    grid-template-columns: minmax(0, 1fr) 570px;
  }
  .game-grid:has(.long-question) .game-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }
  .game-grid:has(.long-question) .game-panel > .card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .game-grid:has(.long-question) .game-panel > .card:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
  .game-grid:has(.long-question) .game-panel > .card:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  .game-grid:has(.long-question) .player-list {
    grid-template-columns: 1fr;
  }
  .game-grid:has(.long-question) #answer-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
