:root {
  color-scheme: light;
  --bg: #eef7ff;
  --bg-deep: #e7e1fb;
  --surface: rgba(255, 255, 255, .84);
  --surface-strong: #ffffff;
  --surface-soft: rgba(64, 85, 145, .08);
  --line: rgba(55, 75, 128, .17);
  --line-bright: rgba(18, 145, 190, .38);
  --text: #182541;
  --muted: #667395;
  --cyan: #138fb8;
  --cyan-strong: #28bdd8;
  --violet: #8266da;
  --violet-strong: #7351d7;
  --gold: #d69b22;
  --danger: #d84a69;
  --success: #16976c;
  --shadow: 0 22px 60px rgba(62, 82, 137, .16);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% 3%, rgba(83, 220, 244, .34), transparent 34%),
    radial-gradient(circle at 92% 14%, rgba(184, 143, 255, .3), transparent 36%),
    linear-gradient(145deg, #fbfdff 0%, var(--bg) 48%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  opacity: .2;
  background-image:
    radial-gradient(circle at 15% 19%, #577aa8 0 1px, transparent 1.5px),
    radial-gradient(circle at 76% 8%, #7b61b9 0 1px, transparent 1.5px),
    radial-gradient(circle at 35% 73%, #4e93ae 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 66%, #7b6da8 0 1px, transparent 1.5px);
  background-size: 220px 220px, 310px 310px, 270px 270px, 360px 360px;
  pointer-events: none;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  z-index: -2;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(95px);
  opacity: .25;
  pointer-events: none;
}
.ambient--one { top: 8%; left: -20%; background: var(--cyan); }
.ambient--two { right: -22%; bottom: -8%; background: var(--violet); }

.container { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.container-wide { width: min(1500px, calc(100% - 32px)); margin-inline: auto; }

.site-header,
.game-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.brand__logo { width: 190px; height: 58px; display: block; object-fit: contain; object-position: left center; filter: drop-shadow(0 5px 9px rgba(43,69,119,.2)); }
.brand--compact .brand__logo { width: 164px; height: 54px; }

.site-nav, .game-header__tools { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  padding: 9px 13px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  transition: color .2s ease, background .2s ease;
  border-radius: 12px;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--text); background: var(--surface-soft); }

.button,
.icon-button,
.code-button {
  border: 0;
  color: var(--text);
  cursor: pointer;
}
.button {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: .91rem;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button--primary {
  color: #04121a;
  background: linear-gradient(135deg, #9af2ff, var(--cyan-strong));
  box-shadow: 0 13px 30px rgba(31, 200, 238, .2), inset 0 1px rgba(255, 255, 255, .7);
}
.button--primary:hover:not(:disabled) { box-shadow: 0 16px 40px rgba(31, 200, 238, .34); }
.button--secondary {
  color: #fff;
  background: linear-gradient(135deg, #a985ff, var(--violet-strong));
  box-shadow: 0 13px 30px rgba(113, 71, 239, .22), inset 0 1px rgba(255, 255, 255, .35);
}
.button--danger { background: linear-gradient(135deg, #ff8ca0, #d84166); }
.button--ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .56); color: var(--muted); }
.button--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .92); color: var(--text); }
.button--small { min-height: 38px; padding: 7px 13px; font-size: .8rem; }
.button--wide { width: 100%; }
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .64);
  font-weight: 900;
  transition: .18s ease;
}
.icon-button:hover { color: var(--cyan); border-color: var(--line-bright); background: rgba(101, 232, 255, .08); }

.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.93), rgba(242,247,255,.82));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}
.glass-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(125deg, rgba(255, 255, 255, .7), transparent 34%);
  pointer-events: none;
}

.eyebrow, .card-kicker {
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; }
.eyebrow i { width: 23px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan)); box-shadow: 0 0 10px var(--cyan); }
.card-kicker { display: block; margin-bottom: 7px; color: #168aac; letter-spacing: .13em; }

.home-main { padding: 34px 0 64px; }
.hero { min-height: 460px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 45px; }
.hero__copy h1, .content-hero h1 {
  margin: 15px 0 20px;
  font-size: clamp(2.75rem, 6.2vw, 5.65rem);
  line-height: .98;
  letter-spacing: -.065em;
}
.hero__copy h1 em { color: transparent; font-style: normal; background: linear-gradient(90deg, var(--cyan), #c5afff 60%, var(--gold)); background-clip: text; -webkit-background-clip: text; }
.hero__copy > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 1.02rem; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 31px; }
.hero__facts span { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .56); font-size: .79rem; }
.hero__facts strong { color: var(--text); font-size: .9rem; }
.hero__facts--center { justify-content: center; }

.hero__visual { min-height: 410px; display: grid; place-items: center; position: relative; perspective: 900px; }
.orbital { position: absolute; border: 1px solid rgba(109, 224, 255, .18); border-radius: 50%; transform: rotateX(68deg) rotateZ(-18deg); }
.orbital::before, .orbital::after { position: absolute; width: 7px; height: 7px; content: ""; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.orbital::before { top: 15%; left: 15%; }
.orbital::after { right: 8%; bottom: 27%; background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.orbital--outer { width: 390px; height: 390px; animation: orbit 18s linear infinite; }
.orbital--inner { width: 280px; height: 280px; border-style: dashed; animation: orbit-reverse 13s linear infinite; }
.hero-gem {
  width: 180px;
  height: 180px;
  position: relative;
  transform: rotate(45deg);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 34px 56px 34px 56px;
  background: linear-gradient(135deg, #f1ffff 0%, #67e7ff 22%, #4476db 54%, #8c5bf3 78%, #e48ff1 100%);
  box-shadow: 0 0 90px rgba(93, 224, 255, .34), inset 0 0 35px rgba(255, 255, 255, .55);
  animation: gem-float 5s ease-in-out infinite;
}
.hero-gem::before, .hero-gem::after { position: absolute; content: ""; border: 1px solid rgba(255,255,255,.36); }
.hero-gem::before { inset: 24px; border-radius: 19px 38px 19px 38px; }
.hero-gem::after { inset: 55px; transform: rotate(45deg); background: rgba(255,255,255,.13); }
.hero-gem span { position: absolute; top: 12px; left: 24px; width: 53px; height: 18px; transform: rotate(-15deg); border-radius: 50%; background: rgba(255,255,255,.7); filter: blur(5px); }
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: white; box-shadow: 0 0 15px white; }
.spark--one { top: 20%; left: 15%; animation: sparkle 3s infinite; }
.spark--two { right: 12%; bottom: 22%; animation: sparkle 4s 1s infinite; }
.spark--three { top: 35%; right: 9%; animation: sparkle 2.5s .3s infinite; }

@keyframes orbit { to { transform: rotateX(68deg) rotateZ(342deg); } }
@keyframes orbit-reverse { to { transform: rotateX(68deg) rotateZ(-378deg); } }
@keyframes gem-float { 0%, 100% { translate: 0 -7px; rotate: -1deg; } 50% { translate: 0 10px; rotate: 2deg; } }
@keyframes sparkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.8); } }

.auth-grid, .play-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.auth-grid { margin-top: 30px; }
.auth-card { padding: 30px; }
.auth-card--accent { border-color: rgba(156, 120, 255, .3); }
.auth-card h2, .play-card h3, .section-title h2, .dashboard__heading h2, .side-title h2, .action-card h2, .rules-section h2 { margin: 0; letter-spacing: -.03em; }
.auth-card > p, .play-card p { margin: 6px 0 22px; color: var(--muted); }
form label { display: grid; gap: 7px; margin-bottom: 15px; color: #334363; font-size: .82rem; font-weight: 700; }
input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, .88);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus { border-color: rgba(101, 232, 255, .58); box-shadow: 0 0 0 4px rgba(101, 232, 255, .08); }
.form-message { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: .8rem; }
.form-message.is-success { color: var(--success); }

.notice { display: flex; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.notice--danger { border-color: rgba(216, 74, 105, .34); background: rgba(255, 225, 233, .72); color: #8f2941; }

.dashboard { margin-top: 20px; }
.dashboard__heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 21px; }
.dashboard__heading h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.player-chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .8rem; }
.player-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }
.play-card { min-height: 310px; padding: 26px; display: flex; flex-direction: column; }
.play-card--create { border-color: rgba(101, 232, 255, .27); }
.play-card__icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 16px; color: #03131b; background: linear-gradient(135deg, #bff8ff, var(--cyan-strong)); box-shadow: 0 10px 30px rgba(31, 200, 238, .2); font-size: 1.5rem; }
.play-card__icon--violet { color: white; background: linear-gradient(135deg, #bb9fff, var(--violet-strong)); }
.play-card .button, .play-card form { margin-top: auto; }
.join-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.join-form input { text-align: center; letter-spacing: .22em; text-transform: uppercase; font-weight: 900; }

.recent-section { margin-top: 55px; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.section-title h2 { font-size: 1.65rem; }
.text-link { color: var(--muted); font-size: .84rem; font-weight: 750; }
.text-link span { color: var(--cyan); }
.game-list { display: grid; gap: 9px; }
.game-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 10px 110px 110px 1fr 30px;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .55);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.game-row:hover { transform: translateX(3px); border-color: var(--line-bright); background: rgba(101, 232, 255, .045); }
.game-row__status { width: 8px; height: 8px; border-radius: 50%; }
.game-row__status--waiting { background: var(--gold); box-shadow: 0 0 11px var(--gold); }
.game-row__status--running { background: var(--success); box-shadow: 0 0 11px var(--success); }
.game-row__status--finished { background: #7e87a8; }
.game-row__code { min-width: 0; display: grid; gap: 1px; }
.game-row__code strong { overflow: hidden; font-size: .78rem; font-weight: 900; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.game-row__code small { color: #8590aa; font-size: .58rem; font-weight: 850; letter-spacing: .12em; }
.game-row__players { justify-self: end; color: var(--muted); font-size: .82rem; }
.game-row__arrow { justify-self: end; color: var(--cyan); font-size: 1.2rem; }

.status-badge { width: fit-content; display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: .68rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.status-badge--waiting { color: #875a05; background: rgba(255, 211, 105, .28); border: 1px solid rgba(196, 139, 22, .28); }
.status-badge--running { color: #08734f; background: rgba(94, 230, 172, .2); border: 1px solid rgba(34, 157, 109, .24); }
.status-badge--finished { color: #586581; background: rgba(170, 178, 210, .16); border: 1px solid var(--line); }

.empty-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 24px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); text-align: center; background: rgba(255,255,255,.48); }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 0; font-size: .85rem; }
.empty-state__gem { width: 28px; height: 28px; margin-bottom: 10px; transform: rotate(45deg); border-radius: 6px; background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 0 24px rgba(101,232,255,.35); }

.site-footer { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--line); color: #717a9d; font-size: .75rem; }
.site-footer a { color: var(--cyan); }

/* Accueil compact : tout le contenu principal tient dans la fenêtre sur ordinateur. */
.home-page { height: 100svh; min-height: 520px; overflow: hidden; }
.home-page .site-header { height: 68px; min-height: 68px; }
.home-page .brand__logo { width: 172px; height: 52px; }
.home-page .home-main {
  height: calc(100svh - 116px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(560px, 1.2fr);
  align-items: stretch;
  gap: 16px;
  padding: 8px 0 12px;
}
.home-page .hero {
  min-height: 0;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0;
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3.2vh, 34px);
  border: 1px solid rgba(73,102,159,.16);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(229,242,255,.72));
  box-shadow: var(--shadow);
}
.home-page .hero__copy { position: relative; z-index: 2; }
.home-page .hero__copy h1 { margin: 9px 0 13px; font-size: clamp(2.05rem, 3.6vw, 3.35rem); line-height: 1.01; }
.home-page .hero__copy > p { max-width: 480px; font-size: clamp(.78rem, 1.3vw, .92rem); }
.home-page .hero__facts { gap: 6px; margin-top: 16px; }
.home-page .hero__facts span { padding: 6px 9px; font-size: .68rem; backdrop-filter: blur(8px); }
.home-page .hero__facts strong { font-size: .76rem; }
.home-page .hero__visual { min-height: 0; width: 230px; height: 230px; position: absolute; right: -62px; bottom: -72px; opacity: .62; }
.home-page .orbital--outer { width: 220px; height: 220px; }
.home-page .orbital--inner { width: 158px; height: 158px; }
.home-page .hero-gem { width: 96px; height: 96px; border-radius: 20px 31px 20px 31px; }
.home-page .hero-gem::before { inset: 14px; border-radius: 12px 22px 12px 22px; }
.home-page .hero-gem::after { inset: 30px; }
.home-page .auth-grid { align-self: center; gap: 12px; margin: 0; }
.home-page .auth-card { padding: clamp(15px, 2.1vh, 21px); border-radius: 21px; }
.home-page .auth-card h2 { font-size: 1.3rem; }
.home-page .auth-card > p { margin: 3px 0 10px; font-size: .76rem; }
.home-page .auth-card label { gap: 4px; margin-bottom: 8px; font-size: .72rem; }
.home-page .auth-card input { min-height: 40px; padding: 7px 11px; border-radius: 11px; }
.home-page .auth-card .button { min-height: 40px; padding-block: 7px; }
.home-page .form-message { min-height: 15px; margin-top: 5px; font-size: .7rem; }
.home-page .dashboard { min-height: 0; margin: 0; padding: 4px; overflow-y: auto; }
.home-page .dashboard__heading { margin-bottom: 10px; }
.home-page .dashboard__heading h2 { font-size: 1.65rem; }
.home-page .play-grid { gap: 10px; }
.home-page .play-card { min-height: 190px; padding: 16px; }
.home-page .play-card__icon { width: 38px; height: 38px; margin-bottom: 10px; border-radius: 12px; font-size: 1.05rem; }
.home-page .play-card p { margin: 3px 0 10px; font-size: .75rem; }
.home-page .recent-section { margin-top: 14px; }
.home-page .section-title { margin-bottom: 8px; }
.home-page .game-list { max-height: 190px; overflow-y: auto; }
.home-page .game-row { min-height: 48px; padding-block: 6px; }
.home-page .site-footer { height: 48px; min-height: 48px; }

.content-main { padding: 28px 0 70px; }
.content-hero { max-width: 860px; margin: 0 auto 55px; text-align: center; }
.content-hero h1 { margin-bottom: 16px; font-size: clamp(3rem, 7vw, 5.4rem); }
.content-hero p { max-width: 700px; margin: auto; color: var(--muted); font-size: 1.05rem; }
.content-hero--compact { margin-bottom: 34px; }
.rules-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 13px; }
.rules-section { min-height: 310px; display: grid; grid-template-columns: 68px 1fr; align-content: start; gap: 15px; padding: 20px; }
.rules-section__visual { width: 68px; display: grid; place-items: center; align-content: start; position: relative; }
.rules-section__visual svg { width: 63px; height: 63px; display: block; filter: drop-shadow(0 6px 8px rgba(58,76,121,.18)); }
.rules-number { width: 25px; height: 25px; position: absolute; top: -4px; left: -3px; z-index: 2; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--cyan), #5570cf); box-shadow: 0 5px 12px rgba(48,100,151,.22); font-size: .73rem; font-weight: 950; line-height: 1; }
.rules-section p { color: var(--muted); }
.rules-section--win { border-color: rgba(255, 212, 118, .28); }
.pretty-list { padding: 0; margin: 12px 0 0; list-style: none; counter-reset: steps; }
.pretty-list li { position: relative; margin: 8px 0; padding-left: 28px; color: var(--muted); font-size: .78rem; line-height: 1.42; counter-increment: steps; }
.pretty-list li::before { position: absolute; left: 0; top: 0; width: 20px; height: 20px; display: grid; place-items: center; content: counter(steps); border: 1px solid var(--line-bright); border-radius: 7px; color: var(--cyan); background: rgba(255,255,255,.65); font-size: .62rem; font-weight: 900; }
.rules-effects { margin-top: 28px; }
.effects-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.effect-card { min-height: 178px; padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.7); box-shadow: 0 12px 30px rgba(70,88,135,.09); }
.effect-card__icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 10px; border: 1px solid rgba(71,91,143,.12); border-radius: 18px; color: var(--cyan); background: rgba(255,255,255,.78); font-weight: 950; }
.effect-card__icon svg { width: 56px; height: 56px; display: block; filter: drop-shadow(0 4px 6px rgba(50,70,110,.18)); }
.effect-card h3 { margin: 0; font-size: 1rem; }
.effect-card p { margin: 7px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.effect-card--angel .effect-card__icon { color: var(--gold); background: rgba(255,212,118,.08); }
.effect-card--demon .effect-card__icon, .effect-card--bankruptcy .effect-card__icon { color: var(--danger); background: rgba(255,113,140,.08); }
.effect-card--place .effect-card__icon { color: #c9b3ff; background: rgba(156,120,255,.09); }

/* Règlement clair et ludique. Le texte reste celui de config/rules.json. */
.rules-page .site-header { min-height: 72px; }
.rules-page .brand__logo { width: 178px; height: 54px; }
.rules-page .content-main { padding-top: 14px; }
.rules-hero { max-width: 100%; min-height: 190px; position: relative; margin-bottom: 18px; padding: 22px 150px 20px; overflow: hidden; border: 1px solid rgba(67,91,145,.14); border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(225,243,255,.76) 56%, rgba(236,225,255,.78)); box-shadow: var(--shadow); }
.rules-hero h1 { margin: 5px 0 7px; font-size: clamp(2.25rem, 5vw, 4rem); }
.rules-hero p { font-size: .94rem; }
.rules-hero .hero__facts { margin-top: 13px; }
.rules-hero__gem { width: 125px; height: 125px; position: absolute; right: 26px; top: 32px; display: grid; place-items: center; opacity: .9; }
.rules-hero__gem svg { width: 118px; height: 118px; filter: drop-shadow(0 15px 18px rgba(45,111,168,.2)); }
.rules-section--setup { background: linear-gradient(145deg, rgba(236,251,255,.96), rgba(255,255,255,.9)); }
.rules-section--turn { background: linear-gradient(145deg, rgba(241,237,255,.96), rgba(255,255,255,.9)); }
.rules-section--win { background: linear-gradient(145deg, rgba(255,248,219,.96), rgba(255,255,255,.92)); }
.rules-section--win p { margin-top: 12px; font-size: .82rem; line-height: 1.5; }
.effect-card--get { background: linear-gradient(145deg, #e2f8ff, #fff); }
.effect-card--place { background: linear-gradient(145deg, #eee8ff, #fff); }
.effect-card--steal { background: linear-gradient(145deg, #ffe5f1, #fff); }
.effect-card--angel { background: linear-gradient(145deg, #fff3ce, #fff); }
.effect-card--demon { background: linear-gradient(145deg, #ffe3e8, #fff); }
.effect-card--d12 { background: linear-gradient(145deg, #e7edff, #fff); }
.effect-card--bankruptcy { background: linear-gradient(145deg, #ffe0e7, #fff); }
.effect-card--return { background: linear-gradient(145deg, #ffeadc, #fff); }

.leaderboard-card { padding: 16px; }
.leaderboard-table { min-width: 650px; }
.leaderboard-card { overflow-x: auto; }
.leaderboard-row { min-height: 62px; display: grid; grid-template-columns: 70px 1.6fr repeat(3, .75fr); align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .87rem; }
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row--head { min-height: 42px; color: #717b9f; font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.leaderboard-row--podium { color: var(--text); background: linear-gradient(90deg, rgba(101,232,255,.04), transparent); }
.rank { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); font-weight: 900; }
.rank--1 { color: #241a00; background: linear-gradient(135deg, #fff0a8, #eab84a); box-shadow: 0 0 20px rgba(255,212,118,.22); }
.rank--2 { color: #172033; background: linear-gradient(135deg, #eef4ff, #aeb9cd); }
.rank--3 { color: #24150d; background: linear-gradient(135deg, #efb58d, #b66f43); }

/* Partie */
.svg-sprite { width: 0; height: 0; position: fixed; inset: 0 auto auto 0; overflow: hidden; pointer-events: none; }
.svg-sprite > svg { width: 0; height: 0; display: block; overflow: hidden; }
.game-page { height: 100svh; min-height: 100svh; overflow: hidden; background: radial-gradient(circle at 4% 6%, rgba(64,208,236,.28), transparent 29%), radial-gradient(circle at 94% 4%, rgba(174,133,255,.28), transparent 34%), linear-gradient(145deg, #f8fcff, #e9f3ff 52%, #ece6fb); }
.game-header { height: 68px; min-height: 68px; }
.game-header .brand__logo { filter: drop-shadow(0 5px 8px rgba(45,72,123,.18)); }
.game-shell { height: calc(100svh - 68px); min-height: 0; display: grid; grid-template-columns: minmax(520px, 1fr) minmax(290px, 350px); gap: 14px; padding: 3px 0 10px; overflow: hidden; align-items: stretch; }
.board-section { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.board-heading { height: 54px; min-height: 54px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 5px; padding: 0 4px; }
.board-heading h1 { margin: 4px 0 0; font-size: 1.55rem; letter-spacing: -.035em; }
.board-heading h1 [data-room-name] { display: inline-block; max-width: min(48vw, 520px); overflow: hidden; vertical-align: bottom; text-overflow: ellipsis; white-space: nowrap; }
.room-name-edit { width: 28px; height: 28px; display: inline-grid; place-items: center; margin-left: 4px; vertical-align: 3px; border: 1px solid rgba(39,150,190,.24); border-radius: 9px; color: #168eb7; background: rgba(255,255,255,.72); box-shadow: 0 4px 12px rgba(49,91,149,.1); cursor: pointer; font-size: .82rem; transition: transform .18s ease, background .18s ease; }
.room-name-edit:hover { transform: translateY(-2px); background: white; }
.room-name-edit[hidden] { display: none; }
.code-button { padding: 0; color: var(--text); background: transparent; font-weight: 900; letter-spacing: .1em; }
.code-button span { color: var(--cyan); font-size: .85rem; }
.board-wrap { width: 100%; min-height: 0; flex: 1 1 auto; display: grid; place-items: center; padding-bottom: 8px; }
.board {
  width: min(100%, calc(100svh - 160px), 920px);
  aspect-ratio: 1;
  position: relative;
  container-type: inline-size;
  border: 1px solid rgba(217, 226, 255, .38);
  border-radius: 5.5%;
  overflow: hidden;
  background:
    radial-gradient(circle at 49% 42%, rgba(255,255,255,.8), transparent 29%),
    radial-gradient(circle at 72% 70%, rgba(229, 183, 255, .24), transparent 35%),
    linear-gradient(145deg, #d8efff, #d8ddf8 55%, #e8d8f3);
  box-shadow: 0 24px 60px rgba(61,78,125,.24), 0 0 45px rgba(67,190,222,.14), inset 0 0 55px rgba(255,255,255,.42);
}
.board::before {
  position: absolute;
  inset: 10.5%;
  content: "";
  border: 1px solid rgba(72, 98, 158, .16);
  border-radius: 3.5%;
  background:
    radial-gradient(circle at 50% 36%, rgba(132, 229, 255, .24), transparent 34%),
    linear-gradient(135deg, rgba(249,252,255,.96), rgba(236,239,255,.95));
  box-shadow: inset 0 0 48px rgba(90,108,161,.1), 0 0 0 3px rgba(255,255,255,.24);
}
.board::after { position: absolute; inset: 1.45%; z-index: 1; content: ""; pointer-events: none; border: 1px solid rgba(182, 133, 63, .2); border-radius: 4.6%; box-shadow: inset 0 0 30px rgba(120,230,255,.08); }
.board__halo { position: absolute; inset: 13%; border-radius: 50%; background: radial-gradient(circle, rgba(72,194,222,.14), transparent 68%); filter: blur(8px); }
.board__track { position: absolute; inset: 4.6%; border: 1px dashed rgba(57,96,150,.16); border-radius: 3%; }
.board__tiles, .board__pawns { position: absolute; inset: 0; }
.tile {
  --tile-color: #637099;
  width: 9.15%;
  height: 9.15%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  display: block;
  padding: 0;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tile-color), white 42%);
  border-radius: 19%;
  color: white;
  background:
    linear-gradient(135deg, rgba(255,255,255,.23), transparent 23% 68%, rgba(255,255,255,.08)),
    linear-gradient(145deg, color-mix(in srgb, var(--tile-color), white 17%), color-mix(in srgb, var(--tile-color), #071020 54%));
  box-shadow: inset 0 1px rgba(255,255,255,.29), inset 0 -1px rgba(0,0,0,.2), 0 5px 13px rgba(0,0,0,.34), 0 0 13px color-mix(in srgb, var(--tile-color), transparent 76%);
  cursor: pointer;
  transition: scale .18s ease, filter .18s ease, z-index .18s ease;
}
.tile::before { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(32deg, transparent 47%, rgba(255,255,255,.12) 48% 50%, transparent 51%), linear-gradient(148deg, transparent 44%, rgba(255,255,255,.08) 45% 47%, transparent 48%); opacity: .75; }
.tile::after { position: absolute; top: 6%; left: 9%; width: 46%; height: 25%; content: ""; pointer-events: none; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.3), transparent 68%); transform: rotate(-18deg); }
.tile:hover, .tile:focus-visible { z-index: 9; scale: 1.08; filter: brightness(1.15); outline: 2px solid rgba(255,255,255,.55); outline-offset: 1px; }
.tile__icon {
  width: 84%;
  height: 70%;
  position: absolute;
  top: 2%;
  left: 50%;
  z-index: 2;
  display: block;
  overflow: visible;
  transform: translateX(-50%);
  filter: drop-shadow(0 .55cqi .75cqi rgba(0,0,0,.32));
}
.tile__label {
  position: absolute;
  right: 5%;
  bottom: 8%;
  left: 5%;
  z-index: 2;
  overflow: hidden;
  color: #fff;
  font-size: clamp(6px, 1.55cqi, 11px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.025em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,.72);
  white-space: nowrap;
}
.tile--start { --tile-color: #21876c; }
.tile--get { --tile-color: #167da5; }
.tile--place { --tile-color: #6952bc; }
.tile--steal { --tile-color: #a8427a; }
.tile--angel { --tile-color: #ad792c; }
.tile--demon { --tile-color: #8f2944; }
.tile--d12 { --tile-color: #3859ad; }
.tile--bankruptcy { --tile-color: #4d152b; }
.tile--return { --tile-color: #99502f; }
.tile.is-current { animation: tile-pulse 1.6s ease-in-out infinite; outline: 2px solid white; outline-offset: 2px; }
@keyframes tile-pulse { 50% { filter: brightness(1.35); box-shadow: 0 0 28px var(--tile-color); } }

.board__fx { position: absolute; inset: 0; z-index: 30; overflow: hidden; pointer-events: none; }
.board__center { position: absolute; inset: 12.8%; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.board__crest { width: min(34%, 165px); height: auto; display: block; margin-bottom: clamp(1px, .65cqi, 5px); opacity: .94; filter: drop-shadow(0 6px 12px rgba(45,72,123,.22)); }
.board__turn { min-width: 44%; padding: clamp(2px, .55cqi, 5px) clamp(9px, 1.4cqi, 15px); border: 1px solid rgba(72,104,166,.12); border-radius: 999px; background: rgba(255,255,255,.6); box-shadow: 0 7px 18px rgba(67,88,140,.08); }
.board__turn-label { display: block; color: var(--cyan); font-size: clamp(.43rem, 1.15cqi, .66rem); font-weight: 900; letter-spacing: .15em; line-height: 1.1; text-transform: uppercase; }
.board__turn-name { max-width: 100%; display: block; margin-top: 1px; overflow: hidden; font-size: clamp(.8rem, 2.6cqi, 1.42rem); line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.diamond-dashboard { width: 98%; min-height: 0; max-height: 390px; position: relative; flex: 1 1 0; margin-top: clamp(4px, .8cqi, 8px); }
.player-homes { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 10cqi, 82px) clamp(62px, 14cqi, 112px); }
.player-home { min-width: 0; min-height: 0; position: relative; z-index: 2; display: flex; flex-direction: column; padding: clamp(5px, 1.15cqi, 10px); overflow: hidden; pointer-events: auto; border: 1px solid color-mix(in srgb, var(--player-color), white 34%); border-radius: clamp(10px, 2cqi, 17px); color: #293d63; background: linear-gradient(145deg, rgba(255,255,255,.94), color-mix(in srgb, var(--player-color), white 91%)); box-shadow: 0 10px 24px rgba(58,79,132,.13), inset 0 1px rgba(255,255,255,.96); transition: transform .28s ease, box-shadow .28s ease; }
.player-home::before { width: 54%; height: 50%; position: absolute; top: -34%; left: -10%; content: ""; transform: rotate(-10deg); border-radius: 45%; background: color-mix(in srgb, var(--player-color), transparent 87%); }
.player-home.is-viewer { box-shadow: 0 10px 25px rgba(58,79,132,.15), inset 4px 0 var(--player-color); }
.player-home.is-current { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--player-color), transparent 72%), 0 0 0 2px color-mix(in srgb, var(--player-color), transparent 64%), inset 0 1px white; }
.player-home__header { min-width: 0; display: grid; grid-template-columns: clamp(27px, 5.7cqi, 46px) minmax(0, 1fr) auto; align-items: center; gap: clamp(3px, .7cqi, 7px); position: relative; z-index: 2; }
.player-home__pawn { width: clamp(25px, 5.2cqi, 42px); height: clamp(31px, 6.2cqi, 50px); display: grid; place-items: center; filter: drop-shadow(0 3px 4px rgba(43,64,113,.25)); }
.player-home__pawn-icon { width: 100%; height: 100%; display: block; overflow: visible; }
.player-home__identity { min-width: 0; text-align: left; }
.player-home__identity small { display: block; color: #7783a1; font-size: clamp(.34rem, .74cqi, .5rem); font-weight: 850; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.player-home__identity strong { max-width: 100%; display: block; overflow: hidden; margin-top: 2px; font-size: clamp(.55rem, 1.35cqi, .84rem); line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.player-home__hand { min-width: clamp(42px, 8.4cqi, 66px); display: grid; grid-template-columns: clamp(15px, 3.3cqi, 26px) auto; grid-template-rows: auto auto; align-items: center; column-gap: 3px; padding: 3px 5px; border: 1px solid rgba(80,109,169,.13); border-radius: 10px; background: rgba(255,255,255,.76); box-shadow: 0 3px 9px rgba(58,83,139,.09); }
.player-home__hand-gem { width: clamp(15px, 3.2cqi, 26px); aspect-ratio: 1.08; grid-row: 1 / 3; display: block; clip-path: polygon(18% 8%, 82% 8%, 100% 38%, 50% 100%, 0 38%); background: linear-gradient(135deg, #fff 0 12%, #8cecff 29%, #fff 46%, #7298ee 68%, #c19eff); filter: drop-shadow(0 2px 2px rgba(42,108,166,.28)); }
.player-home__hand strong { color: #234a76; font-size: clamp(.65rem, 1.55cqi, .96rem); font-weight: 1000; line-height: .9; text-align: left; }
.player-home__hand small { color: #7b86a3; font-size: clamp(.28rem, .58cqi, .4rem); line-height: 1; white-space: nowrap; }
.player-home__camp-title { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 5px; margin: clamp(2px, .45cqi, 4px) 1px; color: #74809d; font-size: clamp(.3rem, .63cqi, .43rem); font-weight: 900; letter-spacing: .045em; line-height: 1; text-transform: uppercase; }
.player-home__camp-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-home__camp-title strong { flex: 0 0 auto; color: var(--player-color); font-size: clamp(.38rem, .78cqi, .54rem); }
.player-home__camp { min-height: 0; flex: 1 1 auto; display: grid; align-items: center; }
.player-home__grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: clamp(1px, .25cqi, 3px); }
.camp-slot { aspect-ratio: 1; position: relative; display: grid; place-items: center; border: 1px solid rgba(70,94,151,.16); border-radius: 35%; background: rgba(69,93,150,.055); box-shadow: inset 0 1px 3px rgba(61,80,132,.08); }
.camp-slot::before { width: 68%; aspect-ratio: 1.06; content: ""; clip-path: polygon(18% 8%, 82% 8%, 100% 38%, 50% 100%, 0 38%); background: rgba(85,110,165,.13); }
.camp-slot.is-filled { border-color: rgba(38,175,214,.3); background: rgba(111,221,245,.13); box-shadow: 0 0 11px rgba(50,184,222,.2), inset 0 1px rgba(255,255,255,.75); }
.camp-slot.is-filled::before { background: linear-gradient(135deg, #fff 0 13%, #91eeff 29%, #fff 46%, #7298ee 68%, #c19eff); filter: drop-shadow(0 2px 3px rgba(40,108,167,.28)); }
.board-core { width: clamp(76px, 15cqi, 124px); height: clamp(56px, 9.5cqi, 78px); position: absolute; left: 50%; top: 50%; z-index: 6; display: grid; place-items: center; transform: translate(-50%, -50%); }
.focus-token { width: clamp(27px, 5.2cqi, 43px); height: clamp(33px, 6.2cqi, 52px); position: absolute; left: 50%; top: 0; z-index: 4; transform: translate(-50%, -76%); filter: drop-shadow(0 6px 7px rgba(38,65,122,.28)); transition: opacity .2s ease, transform .25s ease; }
.focus-token svg { width: 100%; height: 100%; display: block; overflow: visible; }
.board__hint { max-width: 82%; margin-top: clamp(4px, 1cqi, 9px); color: #697494; font-size: clamp(.4rem, 1.05cqi, .66rem); }
.dice {
  width: clamp(76px, 15cqi, 124px);
  min-width: 0;
  height: clamp(54px, 9.5cqi, 78px);
  position: relative;
  justify-self: center;
  margin-top: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  overflow: hidden;
  border: 1px solid rgba(151, 239, 255, .65);
  grid-template-rows: 1fr auto;
  gap: clamp(1px, .3cqi, 3px);
  padding: clamp(5px, .8cqi, 8px);
  border-radius: clamp(15px, 2.6cqi, 22px);
  color: #168eb7;
  background: linear-gradient(145deg, #ffffff, #dbeaff);
  box-shadow: 0 16px 34px rgba(66,84,134,.22), 0 0 28px rgba(55,181,213,.18), inset 0 1px rgba(255,255,255,.9);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.dice:not(:disabled):hover { transform: translateY(-4px) rotate(-2deg); box-shadow: 0 22px 42px rgba(0,0,0,.44), 0 0 40px rgba(101,232,255,.35); }
.dice:disabled { cursor: default; opacity: .67; }
.dice__set { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: clamp(5px, 1.1cqi, 10px); }
.dice__set[hidden] { display: none; }
.die-face { display: grid; place-items: center; color: #236b9c; font-weight: 1000; line-height: 1; text-shadow: 0 1px rgba(255,255,255,.9); }
.die-face--d6 { width: clamp(25px, 4.7cqi, 39px); aspect-ratio: 1; border: 1px solid rgba(62,144,190,.32); border-radius: 23%; font-size: clamp(.75rem, 2.25cqi, 1.25rem); background: linear-gradient(145deg, #fff, #cfecff); box-shadow: 0 5px 11px rgba(39,91,151,.2), inset 0 1px white; }
.die-face--d12 { width: clamp(35px, 6.4cqi, 53px); aspect-ratio: 1; color: #7150b9; font-size: clamp(.82rem, 2.5cqi, 1.35rem); clip-path: polygon(50% 0, 92% 25%, 100% 69%, 69% 100%, 31% 100%, 0 69%, 8% 25%); background: linear-gradient(145deg, #fff, #e7dbff 58%, #c2a5ff); filter: drop-shadow(0 5px 7px rgba(94,67,156,.26)); }
.dice__total { position: relative; z-index: 2; padding: 1px 6px; border-radius: 999px; color: #2f789f; font-size: clamp(.38rem, .75cqi, .54rem); font-weight: 950; line-height: 1.2; background: rgba(255,255,255,.78); }
.dice__total[hidden] { display: none; }
.dice__shine { position: absolute; top: -35%; left: -50%; width: 55%; height: 170%; transform: rotate(26deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); }
.dice.is-rolling { animation: dice-roll .72s ease-in-out infinite; }
.dice.is-rolling .die-face--d6:first-child { animation: die-wobble .34s ease-in-out infinite alternate; }
.dice.is-rolling .die-face--d6:last-child { animation: die-wobble .29s .06s ease-in-out infinite alternate-reverse; }
.dice.is-rolling .die-face--d12 { animation: d12-spin .42s ease-in-out infinite alternate; }
.dice.is-rolling .dice__shine { animation: shine 1s linear infinite; }
@keyframes dice-roll { 0%,100% { transform: rotate(-6deg) scale(.96); } 50% { transform: rotate(8deg) scale(1.05); } }
@keyframes die-wobble { from { transform: translateY(-2px) rotate(-10deg); } to { transform: translateY(2px) rotate(10deg); } }
@keyframes d12-spin { from { transform: rotate(-12deg) scale(.92); } to { transform: rotate(13deg) scale(1.05); } }
@keyframes shine { to { left: 125%; } }

.pawn {
  --pawn-color: var(--cyan);
  width: clamp(27px, 5.25%, 48px);
  aspect-ratio: 5 / 6;
  position: absolute;
  left: calc(var(--x) + var(--offset-x));
  top: calc(var(--y) + var(--offset-y));
  z-index: 12;
  display: block;
  transform: translate(-50%, -62%);
  filter: drop-shadow(0 3px 4px rgba(20,37,81,.52));
  transition: left .7s cubic-bezier(.2,.8,.2,1), top .7s cubic-bezier(.2,.8,.2,1), scale .25s ease;
}
.pawn__figure { width: 100%; height: 100%; display: block; overflow: visible; }
.pawn::after { width: 36%; aspect-ratio: 1; position: absolute; right: -5%; bottom: 2%; content: ""; border: 2px solid white; border-radius: 50%; background: var(--pawn-color); box-shadow: 0 0 8px var(--pawn-color); }
.pawn--ruby { --pawn-color: #ff607d; }
.pawn--sapphire { --pawn-color: #56cfff; }
.pawn--amethyst { --pawn-color: #b589ff; }
.pawn--topaz { --pawn-color: #ffd36a; }
.pawn.is-current { z-index: 15; scale: 1.17; animation: pawn-glow 1.4s ease-in-out infinite; }
@keyframes pawn-glow { 50% { filter: brightness(1.23) drop-shadow(0 0 8px var(--pawn-color)); } }

.fx-diamond { width: clamp(10px, 2.5cqi, 20px); aspect-ratio: 1; position: absolute; left: 0; top: 0; display: block; clip-path: polygon(18% 8%, 82% 8%, 100% 38%, 50% 100%, 0 38%); background: linear-gradient(135deg, #fff 0 12%, #8ef2ff 28%, #fff 46%, #7099ee 68%, #c399ff); filter: drop-shadow(0 3px 5px rgba(30,101,165,.46)); }
.fx-burst { width: 9cqi; aspect-ratio: 1; position: absolute; border: 2px solid rgba(255,104,130,.68); border-radius: 50%; box-shadow: 0 0 24px rgba(255,75,111,.42); }
.fx-number { position: absolute; color: #d83e60; font-size: clamp(.75rem, 2.8cqi, 1.45rem); font-weight: 1000; text-shadow: 0 2px 8px rgba(255,255,255,.9); }
.action-fx-card { min-width: 32%; max-width: 58%; position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; gap: 4px; padding: 2.2cqi 2.8cqi; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.86); border-radius: 2.4cqi; color: #24375c; background: rgba(255,255,255,.95); box-shadow: 0 18px 40px rgba(48,70,125,.24), 0 0 34px rgba(74,192,224,.25); backdrop-filter: blur(8px); }
.action-fx-card svg { width: 7.5cqi; height: 7.5cqi; filter: drop-shadow(0 5px 8px rgba(42,72,131,.24)); }
.action-fx-card strong { font-size: clamp(.55rem, 1.8cqi, 1rem); line-height: 1.05; }
.action-fx-card small { max-width: 230px; color: #5e6c8c; font-size: clamp(.4rem, 1.05cqi, .64rem); font-weight: 750; line-height: 1.25; text-align: center; }
.action-fx-card__double { margin-top: 3px; padding: 3px 8px; border-radius: 999px; font-size: clamp(.4rem, .9cqi, .58rem); font-style: normal; font-weight: 1000; letter-spacing: .08em; text-transform: uppercase; }
.action-fx-card__double--paradise { color: #85620c; background: linear-gradient(135deg, #fff3a9, #ffe1a0); box-shadow: 0 0 16px rgba(244,193,68,.28); }
.action-fx-card__double--hell { color: #a02d45; background: linear-gradient(135deg, #ffd7de, #ffb6c5); box-shadow: 0 0 16px rgba(219,64,93,.25); }

.game-sidebar { min-height: 0; max-height: 100%; display: grid; align-content: start; gap: 9px; position: static; overflow-y: auto; padding: 0 3px 2px 0; scrollbar-width: thin; scrollbar-color: rgba(101,232,255,.3) transparent; }
.room-card, .players-card, .action-card, .event-card { padding: 15px; border-radius: 18px; }
.room-card__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.room-card__top strong { display: block; font-size: 1.25rem; letter-spacing: .15em; }
.room-card__progress { height: 5px; margin-top: 15px; overflow: hidden; border-radius: 99px; background: rgba(68,84,132,.11); }
.room-card__progress span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 15px var(--cyan); transition: width .35s ease; }
.room-card small { display: block; margin-top: 7px; color: #697594; }
.side-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.side-title h2, .action-card h2 { font-size: 1.12rem; }
.turn-counter { padding: 4px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .66rem; }
.players-list { display: grid; gap: 7px; }
.player-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid transparent; border-radius: 13px; background: rgba(83,105,160,.055); transition: .2s ease; }
.player-row.is-current { border-color: rgba(19,143,184,.28); background: rgba(78,201,225,.11); }
.player-row.is-viewer { box-shadow: inset 3px 0 var(--cyan); }
.player-avatar { width: 40px; height: 48px; position: relative; display: grid; place-items: center; }
.player-avatar svg { width: 36px; height: 44px; display: block; overflow: visible; filter: drop-shadow(0 3px 4px color-mix(in srgb, var(--player-color), transparent 55%)); }
.player-avatar::after { width: 10px; aspect-ratio: 1; position: absolute; right: 0; bottom: 2px; content: ""; border: 2px solid white; border-radius: 50%; background: var(--player-color); box-shadow: 0 0 8px color-mix(in srgb, var(--player-color), transparent 35%); }
.player-avatar--ruby { --player-color: #ff607d; }
.player-avatar--sapphire { --player-color: #56cfff; }
.player-avatar--amethyst { --player-color: #b589ff; }
.player-avatar--topaz { --player-color: #ffd36a; }
.player-row__identity { min-width: 0; }
.player-row__identity strong { display: block; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.player-row__identity small { display: block; color: #7781a1; font-size: .66rem; }
.player-stats { text-align: right; }
.player-stats strong { display: flex; justify-content: end; align-items: center; gap: 4px; color: var(--cyan); font-size: .8rem; }
.player-stats strong::before { width: 11px; aspect-ratio: 1.1; content: ""; clip-path: polygon(18% 8%, 82% 8%, 100% 38%, 50% 100%, 0 38%); background: linear-gradient(135deg, #fff, #7be6ff 40%, #7c8bea 75%, #c39cff); filter: drop-shadow(0 1px 2px rgba(47,86,149,.25)); }
.player-stats.is-waiting strong::before { display: none; }
.player-stats small { color: #8e98bb; font-size: .63rem; }
.camp-meter { grid-column: 2 / -1; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(68,84,132,.1); }
.camp-meter span { height: 100%; display: block; border-radius: inherit; background: var(--player-color); transition: width .4s ease; }

.action-card { min-height: 158px; border-color: rgba(101,232,255,.21); }
.action-card > p { margin: 7px 0 15px; color: var(--muted); font-size: .79rem; }
.action-controls { display: grid; gap: 8px; }
.pawn-picker { display: grid; gap: 7px; margin-bottom: 4px; padding: 8px; border: 1px solid rgba(85,105,163,.13); border-radius: 14px; background: rgba(84,108,165,.045); }
.pawn-picker__title { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #687594; font-size: .66rem; }
.pawn-picker__title strong { color: #314667; font-size: .7rem; }
.pawn-picker__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pawn-choice { min-width: 0; min-height: 54px; position: relative; display: grid; place-items: center; padding: 3px; border: 1px solid transparent; border-radius: 12px; color: var(--text); background: rgba(255,255,255,.72); box-shadow: 0 3px 8px rgba(61,82,136,.07); cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.pawn-choice svg { width: 34px; height: 41px; display: block; overflow: visible; }
.pawn-choice span { max-width: 100%; overflow: hidden; color: #687695; font-size: .53rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.pawn-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(27,158,196,.34); background: #fff; }
.pawn-choice.is-selected { border-color: #21a8cd; background: linear-gradient(145deg, #effcff, #eef0ff); box-shadow: 0 0 0 2px rgba(41,181,214,.12), 0 5px 14px rgba(42,126,179,.13); }
.pawn-choice.is-selected::after { width: 15px; height: 15px; position: absolute; top: 3px; right: 3px; display: grid; place-items: center; content: "✓"; border-radius: 50%; color: white; background: #19a7c9; font-size: .55rem; font-weight: 950; }
.pawn-choice:disabled { cursor: not-allowed; opacity: .28; filter: grayscale(.75); }
.auto-next { display: grid; gap: 5px; }
.auto-next__label { color: #707d9b; font-size: .66rem; font-weight: 750; text-align: center; }
.auto-next__track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(67,88,142,.1); }
.auto-next__track::before { width: 100%; height: 100%; display: block; content: ""; transform-origin: left; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); animation: auto-next 10s linear forwards; }
@keyframes auto-next { from { scale: 0 1; } to { scale: 1 1; } }
.target-button { width: 100%; min-height: 42px; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.04); cursor: pointer; }
.target-button:hover { border-color: var(--line-bright); background: rgba(101,232,255,.08); }
.event-card p { margin: 0; color: #596784; font-size: .78rem; }
.loader { width: 23px; height: 23px; justify-self: center; margin: 10px; border: 2px solid rgba(255,255,255,.13); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

.tile-dialog {
  width: min(430px, calc(100% - 30px));
  padding: 28px;
  border: 1px solid var(--line-bright);
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(145deg, #ffffff, #edf4ff);
  box-shadow: 0 30px 80px rgba(45,63,109,.3), 0 0 45px rgba(83,190,216,.12);
}
.room-name-dialog { width: min(500px, calc(100% - 30px)); padding: 28px; border: 1px solid var(--line-bright); border-radius: 24px; color: var(--text); background: linear-gradient(145deg, #ffffff, #edf4ff); box-shadow: 0 30px 80px rgba(45,63,109,.3), 0 0 45px rgba(83,190,216,.12); }
.room-name-dialog::backdrop { background: rgba(62,73,112,.42); backdrop-filter: blur(8px); }
.room-name-dialog h2 { margin: 6px 0 5px; font-size: 1.45rem; }
.room-name-dialog > p { margin: 0 0 18px; color: var(--muted); font-size: .84rem; }
.room-name-form { display: grid; gap: 8px; }
.room-name-form label { color: #415274; font-size: .75rem; font-weight: 900; }
.room-name-form input { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid rgba(74,106,169,.2); border-radius: 13px; color: var(--text); background: rgba(255,255,255,.84); box-shadow: inset 0 2px 7px rgba(56,77,129,.06); font: inherit; }
.room-name-form input:focus { border-color: #2aaed2; outline: 3px solid rgba(42,174,210,.13); }
.room-name-form > small { color: #7a86a3; font-size: .68rem; }
.room-name-form__actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.tile-dialog::backdrop { background: rgba(62,73,112,.42); backdrop-filter: blur(8px); }
.tile-dialog__close { position: absolute; top: 11px; right: 12px; width: 35px; height: 35px; border: 0; border-radius: 10px; color: var(--muted); background: rgba(68,84,132,.08); cursor: pointer; }
.tile-dialog__symbol { width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid var(--line-bright); border-radius: 20px; color: var(--cyan); background: linear-gradient(145deg, rgba(101,232,255,.13), rgba(156,120,255,.08)); }
.tile-dialog__icon { width: 68px; height: 68px; display: block; filter: drop-shadow(0 5px 8px rgba(0,0,0,.42)); }
.tile-dialog h2 { margin: 0; font-size: 1.35rem; }
.tile-dialog p { margin-bottom: 0; color: var(--muted); }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: min(360px, calc(100% - 36px)); padding: 12px 16px; transform: translateY(25px); border: 1px solid var(--line-bright); border-radius: 13px; opacity: 0; visibility: hidden; color: var(--text); background: #ffffff; box-shadow: var(--shadow); font-size: .8rem; transition: .25s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; visibility: visible; }
.toast.is-error { border-color: rgba(255,113,140,.5); }

.error-page { min-height: calc(100vh - 90px); display: grid; place-items: center; }
.error-card { width: min(510px, 100%); padding: 40px; text-align: center; }
.error-card__icon { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 18px; border: 1px solid rgba(255,113,140,.4); border-radius: 20px; color: var(--danger); background: rgba(255,113,140,.08); font-size: 1.5rem; font-weight: 950; }
.error-card h1 { margin: 0; }
.error-card p { color: var(--muted); }

@media (max-width: 1120px) {
  .game-shell { grid-template-columns: minmax(470px, 1fr) 292px; gap: 10px; }
  .effects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 40px 0; text-align: center; }
  .hero__copy > p { margin-inline: auto; }
  .hero__facts { justify-content: center; }
  .hero__visual { min-height: 330px; order: -1; }
  .hero-gem { width: 135px; height: 135px; }
  .orbital--outer { width: 310px; height: 310px; }
  .orbital--inner { width: 225px; height: 225px; }
  .home-page { height: auto; min-height: 100svh; overflow-y: auto; }
  .home-page .site-header { height: 64px; min-height: 64px; }
  .home-page .home-main { height: auto; display: grid; grid-template-columns: 1fr; gap: 12px; padding: 10px 0 24px; }
  .home-page .hero { min-height: 300px; padding: 24px; text-align: left; }
  .home-page .hero__copy > p { margin-inline: 0; }
  .home-page .hero__facts { justify-content: flex-start; }
  .home-page .hero__visual { width: 220px; height: 220px; right: -55px; bottom: -70px; order: initial; }
  .home-page .auth-grid { width: 100%; }
  .home-page .site-footer { height: auto; min-height: 58px; }
  .rules-layout { grid-template-columns: 1fr; }
  .rules-section { min-height: auto; }
  .rules-hero { padding-inline: 35px 145px; }
  .game-page { height: auto; min-height: 100svh; overflow-x: hidden; overflow-y: auto; }
  .game-header { height: 64px; min-height: 64px; }
  .game-shell { height: auto; min-height: calc(100svh - 64px); grid-template-columns: 1fr; overflow: visible; padding-bottom: 28px; }
  .board-section { min-height: auto; }
  .board-wrap { display: grid; }
  .board { width: min(100%, calc(100svh - 150px), 760px); max-width: 760px; }
  .game-sidebar { max-height: none; position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .players-card, .action-card { grid-row: span 2; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .game-header { height: 60px; min-height: 60px; }
  .brand--compact .brand__logo { width: 145px; height: 48px; }
  .game-shell { height: calc(100svh - 60px); }
  .board-heading { height: 46px; min-height: 46px; }
  .board-heading h1 { margin-top: 1px; font-size: 1.3rem; }
  .board-heading .eyebrow { font-size: .64rem; }
  .board { width: min(100%, calc(100svh - 140px), 920px); }
  .board__crest { width: min(29%, 145px); }
  .diamond-dashboard { max-height: 350px; margin-top: 3px; }
  .player-homes { gap: clamp(42px, 9cqi, 68px) clamp(56px, 13cqi, 96px); }
  .room-card, .players-card, .action-card, .event-card { padding: 12px; }
  .action-card { min-height: 138px; }
  .player-row { padding: 7px; }
}

@media (max-width: 680px) {
  .container { width: min(100% - 24px, 1160px); }
  .container-wide { width: min(100% - 16px, 1500px); }
  .site-header { min-height: 72px; }
  .site-nav a { display: none; }
  .home-main { padding-top: 20px; }
  .hero__visual { min-height: 270px; }
  .orbital--outer { width: 260px; height: 260px; }
  .orbital--inner { width: 190px; height: 190px; }
  .hero__copy h1 { font-size: clamp(2.4rem, 13vw, 4rem); }
  .auth-grid, .play-grid { grid-template-columns: 1fr; }
  .dashboard__heading { align-items: start; }
  .player-chip { display: none; }
  .game-row { grid-template-columns: 8px 90px 1fr 24px; gap: 8px; padding: 8px 12px; }
  .game-row .status-badge { display: none; }
  .game-row__players { font-size: .72rem; }
  .site-footer { flex-direction: column; justify-content: center; text-align: center; }
  .rules-hero { min-height: auto; padding: 24px 20px; text-align: left; }
  .rules-hero__gem { width: 75px; height: 75px; right: 12px; top: 10px; opacity: .28; }
  .rules-hero__gem svg { width: 72px; height: 72px; }
  .rules-hero .hero__facts { justify-content: flex-start; }
  .rules-section { grid-template-columns: 58px 1fr; padding: 17px; }
  .rules-section__visual, .rules-section__visual svg { width: 54px; height: 54px; }
  .rules-number { font-size: 2rem; }
  .effects-grid { grid-template-columns: 1fr; }
  .brand__logo { width: 168px; height: 52px; }
  .brand--compact .brand__logo { width: 138px; height: 46px; }
  .game-header__tools .button:first-of-type { display: none; }
  .board-heading { min-height: 54px; }
  .board-heading h1 { font-size: 1.2rem; }
  .board-heading h1 [data-room-name] { max-width: 48vw; }
  .tile__label { display: none; }
  .tile__icon { width: 86%; height: 86%; top: 50%; transform: translate(-50%, -50%); }
  .board__center { inset: 12.5%; }
  .diamond-dashboard { width: 99%; }
  .player-homes { gap: clamp(36px, 8cqi, 54px) clamp(46px, 11cqi, 72px); }
  .player-home { padding: 4px; border-radius: 9px; }
  .player-home__header { grid-template-columns: clamp(22px, 5cqi, 32px) minmax(0, 1fr) auto; }
  .player-home__pawn { width: clamp(21px, 4.7cqi, 30px); height: clamp(26px, 5.6cqi, 36px); }
  .player-home__hand { min-width: 38px; padding: 2px 3px; }
  .player-home__camp-title { margin-block: 2px; }
  .player-home__grid { gap: 1px; }
  .game-sidebar { grid-template-columns: 1fr; }
  .players-card, .action-card { grid-row: auto; }
  .room-card { order: 1; }
  .players-card { order: 2; }
  .action-card { order: 0; }
  .event-card { order: 3; }
  .board__hint { margin-top: 7px; }
}

@media (max-width: 420px) {
  .game-header__tools { gap: 5px; }
  .game-header__tools .button { padding: 6px 9px; }
  .board-heading .eyebrow { font-size: .6rem; }
  .board { border-radius: 4%; }
  .tile { border-radius: 16%; }
  .pawn { border-width: 1px; }
  .player-home__identity small, .player-home__camp-title span, .player-home__hand small { display: none; }
  .room-name-form__actions { grid-template-columns: 1fr; }
  .content-hero h1 { font-size: 2.7rem; }
  .join-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
