/* ==========================================================================
   SIAM — Duel des colosses
   Feuille de style unique. Aucune dépendance externe (APK hors-ligne).
   ========================================================================== */

:root {
    --bg: #07191a;
    --bg-deep: #041112;
    --bg-soft: #0b2426;
    --panel: rgba(15, 43, 44, 0.74);
    --panel-solid: #0e2b2c;
    --panel-raised: #123536;
    --line: rgba(232, 181, 91, 0.18);
    --line-strong: rgba(232, 181, 91, 0.42);
    --gold: #e8b55b;
    --gold-bright: #f7d99c;
    --gold-dim: #b98a3f;
    --ivory: #f3ead7;
    --text: #e9f1ee;
    --muted: #91aaa6;
    --muted-2: #6f8b87;
    --p0: #f08a5d;
    --p0-soft: rgba(240, 138, 93, 0.16);
    --p0-strong: #ff9d70;
    --p1: #46c2b4;
    --p1-soft: rgba(70, 194, 180, 0.16);
    --p1-strong: #6fe0d2;
    --danger: #ff6b5e;
    --ok: #76d6a4;
    --board-frame: #2b2118;
    --board-wood: #4a3826;
    --board-tile: #cbb489;
    --board-tile-alt: #c2a97c;
    --board-edge: #b79b6c;
    --rock: #5c6670;
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.38);
    --radius: 18px;
    --radius-sm: 12px;
    --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
    --font-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overscroll-behavior: none;
}

body {
    background:
        radial-gradient(1200px 800px at 15% -10%, rgba(70, 194, 180, 0.12), transparent 60%),
        radial-gradient(900px 700px at 95% 100%, rgba(232, 181, 91, 0.09), transparent 55%),
        linear-gradient(155deg, #061516 0%, #07191a 45%, #051314 100%);
    color: var(--text);
    position: fixed;
    inset: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(232, 181, 91, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 181, 91, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at 50% 45%, black, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 45%, black, transparent 78%);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

button:disabled {
    cursor: not-allowed;
}

h1, h2, h3, h4, p {
    margin: 0;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.015em;
}

.icon {
    display: inline-flex;
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hidden {
    display: none !important;
}

.is-invisible {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Structure générale
   ========================================================================== */

.app {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 16px);
    opacity: 0;
    transform: translateY(14px) scale(0.992);
    pointer-events: none;
    transition: opacity 260ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.screen.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.screen.scroll-screen {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dim) transparent;
}

.screen.scroll-screen::-webkit-scrollbar {
    width: 8px;
}

.screen.scroll-screen::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 99px;
}

.page-head,
.topbar {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    padding: 4px 0 12px;
}

.topbar {
    justify-content: space-between;
}

.page-head h2 {
    font-size: clamp(1.45rem, 3.6vw, 2rem);
    line-height: 1.05;
}

.page-head .eyebrow {
    margin-bottom: 4px;
}

.head-spacer {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.page-body {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.24em;
    font-size: 1.05rem;
    color: var(--ivory);
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 120ms ease;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.icon-btn:hover {
    color: var(--gold-bright);
    background: rgba(232, 181, 91, 0.09);
    border-color: var(--line);
}

.icon-btn:active {
    transform: scale(0.94);
}

.icon-btn.small {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

.eyebrow-line {
    display: inline-block;
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.fine-print {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--muted-2);
}

.fine-print.center {
    text-align: center;
}

/* ==========================================================================
   Boutons
   ========================================================================== */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 650;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: transform 120ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold) 58%, #c99642);
    color: #20180c;
    box-shadow: 0 10px 26px rgba(232, 181, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.btn-primary:hover {
    box-shadow: 0 14px 34px rgba(232, 181, 91, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(232, 181, 91, 0.2);
    color: var(--ivory);
}

.btn-secondary:hover {
    background: rgba(232, 181, 91, 0.09);
    border-color: var(--line-strong);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--muted);
}

.btn-ghost:hover {
    color: var(--ivory);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-danger {
    background: linear-gradient(135deg, #ff897d, var(--danger));
    color: #2a0c09;
    box-shadow: 0 10px 24px rgba(255, 107, 94, 0.2);
}

.btn-lg {
    min-height: 54px;
    padding: 0 26px;
    font-size: 1rem;
    border-radius: 14px;
}

.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.8rem;
    border-radius: 10px;
}

.btn:disabled {
    opacity: 0.42;
    box-shadow: none;
    transform: none;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 650;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
}

.link-btn:hover {
    color: var(--gold-bright);
    border-bottom-color: var(--line-strong);
}

/* ==========================================================================
   Accueil
   ========================================================================== */

#screen-home {
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.home-main {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(24px, 5vw, 70px);
    padding: 10px 0 20px;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 6.4vw, 4.6rem);
    line-height: 0.98;
    margin: 14px 0 18px;
    color: var(--ivory);
    text-wrap: balance;
}

.hero-copy h1 em {
    font-style: italic;
    color: var(--gold);
    position: relative;
}

.hero-copy h1 em::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.06em;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0.55;
}

.hero-lead {
    font-size: clamp(0.95rem, 1.55vw, 1.1rem);
    line-height: 1.65;
    color: var(--muted);
    max-width: 46ch;
    margin-bottom: 26px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
}

.meta-pill .icon {
    color: var(--gold);
    font-size: 0.9rem;
}

.apk-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: min(100%, 380px);
    margin-top: 16px;
    padding: 10px 13px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.apk-link:hover {
    background: rgba(232, 181, 91, 0.07);
    border-color: var(--line-strong);
}

.apk-link:active {
    transform: scale(0.99);
}

.apk-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    background: rgba(232, 181, 91, 0.1);
    border: 1px solid var(--line);
    flex: 0 0 auto;
    font-size: 1rem;
}

.apk-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.apk-copy strong {
    font-size: 0.78rem;
    color: var(--ivory);
    font-weight: 650;
}

.apk-copy small {
    font-size: 0.64rem;
    color: var(--muted-2);
}

.apk-arrow {
    color: var(--gold-dim);
    font-size: 0.85rem;
    flex: 0 0 auto;
}

body[data-screen="game"] .apk-link {
    display: none;
}

.hero-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
}

.hero-glow {
    position: absolute;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 181, 91, 0.18), transparent 65%);
    filter: blur(10px);
}

.hero-board {
    position: relative;
    width: min(38vw, 400px);
    max-width: 100%;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 10px;
    border-radius: 20px;
    background: linear-gradient(145deg, #3a2a1c, #241a11);
    border: 1px solid rgba(232, 181, 91, 0.25);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: rotate(3deg);
    animation: heroFloat 7s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: rotate(3deg) translateY(0); }
    50% { transform: rotate(2deg) translateY(-9px); }
}

.hero-board .mini-tile {
    border-radius: 7px;
    background: linear-gradient(145deg, var(--board-tile), var(--board-tile-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 2px rgba(60, 40, 18, 0.2);
    position: relative;
}

.hero-board .mini-tile.edge {
    background: linear-gradient(145deg, #bfa170, var(--board-edge));
}

.hero-board .mini-piece {
    width: 76%;
    height: 76%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-board .mini-piece svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35));
}

.hero-caption {
    position: absolute;
    right: -10px;
    bottom: 8%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(7, 25, 26, 0.82);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.hero-caption-num {
    font-family: var(--font-display);
    font-size: 2.6rem;
    line-height: 1;
    color: var(--gold);
}

.hero-caption span:last-child {
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-2);
    padding-top: 8px;
}

.footer-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold-dim);
}

/* ==========================================================================
   Cartes de mode / panneaux
   ========================================================================== */

.modes-body > *,
.online-body > * {
    flex-shrink: 0;
}

.modes-body {
    max-width: 760px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.compact {
    gap: 5px;
}

.field-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.field-help {
    font-size: 0.68rem;
    line-height: 1.4;
    color: var(--muted-2);
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    min-height: 46px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(3, 14, 15, 0.55);
    color: var(--ivory);
    padding: 0 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
    font-size: 0.92rem;
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
    background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

input::placeholder {
    color: var(--muted-2);
}

input:focus,
select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(232, 181, 91, 0.1);
    background: rgba(3, 14, 15, 0.78);
}

.mode-card {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon copy action"
        "extra extra extra";
    align-items: center;
    gap: 14px 16px;
    padding: 18px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(18, 53, 54, 0.72), rgba(9, 31, 32, 0.66));
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.mode-card::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -15%;
    width: 40%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 181, 91, 0.08), transparent 70%);
    pointer-events: none;
}

.mode-icon {
    grid-area: icon;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold);
    background: rgba(232, 181, 91, 0.09);
    border: 1px solid var(--line);
}

.mode-copy {
    grid-area: copy;
    padding-top: 10px;
}

.mode-kicker,
.panel-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 4px;
}

.mode-copy h3,
.panel h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: var(--ivory);
}

.mode-copy p:not(.mode-kicker),
.panel p:not(.panel-kicker) {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--muted);
}

.mode-card > .btn {
    grid-area: action;
    align-self: center;
}

.mode-card > .difficulty {
    grid-area: extra;
    justify-self: start;
}

.mode-ai {
    border-color: rgba(70, 194, 180, 0.22);
}

.mode-online {
    border-color: rgba(232, 181, 91, 0.22);
}

.difficulty {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.diff-btn {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 650;
    color: var(--muted);
    transition: background 150ms ease, color 150ms ease;
}

.diff-btn.is-active {
    background: rgba(70, 194, 180, 0.16);
    color: var(--p1-strong);
}

.panel {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel > .btn {
    margin-top: auto;
}

.panel h3 {
    margin-bottom: 2px;
}

/* ==========================================================================
   Salon en ligne
   ========================================================================== */

.online-body {
    max-width: 940px;
}

#screen-modes .page-head,
#screen-modes .page-body {
    max-width: 760px;
}

#screen-online .page-head,
#screen-online .page-body {
    max-width: 940px;
}

#screen-rules .page-head,
#screen-rules .page-body {
    max-width: 760px;
}

#screen-profile .page-head,
#screen-profile .page-body {
    max-width: 760px;
}

#screen-lobby .page-head,
#screen-lobby .page-body {
    max-width: 640px;
}

.connection-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.76rem;
    color: var(--muted);
}

.status-dot,
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--muted-2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.status-dot.is-online,
.online-dot.is-online {
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(118, 214, 164, 0.12), 0 0 12px rgba(118, 214, 164, 0.45);
}

.status-dot.is-connecting,
.online-dot.is-connecting {
    background: var(--gold);
    animation: pulseDot 1.2s infinite;
}

.status-dot.is-offline,
.online-dot.is-offline {
    background: var(--muted-2);
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.online-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quick-panel {
    border-color: rgba(232, 181, 91, 0.24);
    background: linear-gradient(150deg, rgba(232, 181, 91, 0.08), rgba(15, 43, 44, 0.72));
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.switch-line input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: background 180ms ease;
    flex: 0 0 auto;
}

.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 180ms ease, background 180ms ease;
}

.switch-line input:checked + .switch {
    background: rgba(70, 194, 180, 0.28);
    border-color: rgba(70, 194, 180, 0.4);
}

.switch-line input:checked + .switch::after {
    transform: translateX(16px);
    background: var(--p1-strong);
}

.switch-block {
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.code-row {
    display: flex;
    gap: 8px;
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-family: var(--font-display);
    font-size: 1.35rem !important;
    font-weight: 700;
    text-align: center;
    min-width: 0;
}

.code-row .btn {
    flex: 0 0 auto;
}

.rooms-block {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-head h3 {
    font-size: 1.12rem;
    color: var(--ivory);
}

.rooms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
    text-align: left;
}

.room-item:hover {
    border-color: var(--line-strong);
    background: rgba(232, 181, 91, 0.06);
}

.room-item:active {
    transform: scale(0.99);
}

.room-code {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    min-width: 54px;
}

.room-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.room-host {
    font-size: 0.78rem;
    color: var(--ivory);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-sub {
    font-size: 0.66rem;
    color: var(--muted-2);
}

.room-open {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--ok);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 20px;
    text-align: center;
    border-radius: 11px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--muted-2);
    font-size: 0.8rem;
}

.online-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

/* ==========================================================================
   Salon d'attente
   ========================================================================== */

.lobby-body {
    max-width: 640px;
    justify-content: center;
    gap: 16px;
}

.lobby-code-card {
    padding: 22px;
    border-radius: var(--radius);
    text-align: center;
    background: linear-gradient(150deg, rgba(232, 181, 91, 0.09), rgba(15, 43, 44, 0.7));
    border: 1px solid var(--line);
}

.lobby-code {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 4.6rem);
    letter-spacing: 0.24em;
    line-height: 1.05;
    color: var(--gold-bright);
    text-shadow: 0 0 36px rgba(232, 181, 91, 0.3);
    margin: 6px 0 12px;
    padding-left: 0.24em;
}

.lobby-code-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 9px;
}

.lobby-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lobby-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    min-height: 76px;
}

.lobby-player.is-empty {
    border-style: dashed;
    opacity: 0.62;
}

.lobby-player .player-avatar {
    width: 42px;
    height: 42px;
}

.lobby-player-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lobby-player-name {
    font-weight: 650;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-player-tag {
    font-size: 0.66rem;
    color: var(--muted-2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lobby-status {
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ==========================================================================
   Plateau / jeu
   ========================================================================== */

.game-screen {
    justify-content: flex-start;
    gap: 7px;
    max-width: 760px;
    margin: 0 auto;
    padding: calc(var(--safe-top) + 6px) calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 10px);
}

.game-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
}

.game-top .icon-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
}

.game-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.match-pips {
    display: flex;
    gap: 5px;
}

.match-pip {
    width: 18px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 220ms ease, box-shadow 220ms ease;
}

.match-pip.p0.is-won {
    background: var(--p0);
    box-shadow: 0 0 10px rgba(240, 138, 93, 0.5);
}

.match-pip.p1.is-won {
    background: var(--p1);
    box-shadow: 0 0 10px rgba(70, 194, 180, 0.5);
}

.match-label {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.timer {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.timer-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.09);
    stroke-width: 2.5;
}

.timer-progress {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 94.25;
    stroke-dashoffset: 0;
    transition: stroke 200ms ease;
}

.timer.is-low .timer-progress {
    stroke: var(--danger);
}

.timer.is-low {
    animation: timerPulse 0.8s infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

#timer-text {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* Cartes joueurs */

.players-row {
    display: flex;
    align-items: stretch;
    gap: 7px;
    flex: 0 0 auto;
    width: 100%;
}

.player-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.player-card.p0.is-active {
    background: linear-gradient(120deg, rgba(240, 138, 93, 0.13), rgba(255, 255, 255, 0.03));
    border-color: rgba(240, 138, 93, 0.4);
    box-shadow: 0 0 22px rgba(240, 138, 93, 0.12);
}

.player-card.p1.is-active {
    background: linear-gradient(120deg, rgba(70, 194, 180, 0.13), rgba(255, 255, 255, 0.03));
    border-color: rgba(70, 194, 180, 0.4);
    box-shadow: 0 0 22px rgba(70, 194, 180, 0.12);
}

.player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.1rem;
    overflow: hidden;
}

.player-avatar svg {
    width: 86%;
    height: 86%;
}

.player-avatar.av0 {
    background: var(--p0-soft);
    border: 1px solid rgba(240, 138, 93, 0.34);
    color: var(--p0);
}

.player-avatar.av1 {
    background: var(--p1-soft);
    border: 1px solid rgba(70, 194, 180, 0.34);
    color: var(--p1);
}

.player-card-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.player-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.player-name {
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-sub {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 10px;
}

.player-reserve {
    display: inline-flex;
    gap: 2px;
}

.reserve-pip {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.player-card.p0 .reserve-pip.is-full {
    background: var(--p0);
}

.player-card.p1 .reserve-pip.is-full {
    background: var(--p1);
}

.player-role {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ivory);
    min-width: 20px;
    text-align: center;
    flex: 0 0 auto;
}

.player-card.p0 .player-score { color: var(--p0-strong); }
.player-card.p1 .player-score { color: var(--p1-strong); }

.versus {
    align-self: center;
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--muted-2);
    flex: 0 0 auto;
}

/* Plateau */

.board-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.board-frame {
    position: relative;
    width: min(92vw, 440px, calc(100dvh - 296px));
    max-width: 100%;
    aspect-ratio: 1;
    padding: clamp(7px, 1.6vw, 11px);
    border-radius: 19px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 35%),
        repeating-linear-gradient(125deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 9px),
        linear-gradient(145deg, #3c2c1d, #241a11 70%);
    border: 1px solid rgba(232, 181, 91, 0.3);
    box-shadow:
        var(--shadow-lg),
        0 0 0 5px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.board-corner {
    position: absolute;
    width: 15px;
    height: 15px;
    border: 1px solid rgba(232, 181, 91, 0.5);
    pointer-events: none;
}

.board-corner.tl { top: 4px; left: 4px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.board-corner.tr { top: 4px; right: 4px; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.board-corner.bl { bottom: 4px; left: 4px; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.board-corner.br { bottom: 4px; right: 4px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }

.board {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: clamp(2px, 0.55vw, 4px);
    border-radius: 11px;
    overflow: hidden;
    background: #3a2a1b;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Repère discret du carré central 3 × 3 : le pourtour est la zone de
   déploiement, l'intérieur est la zone de manœuvre. */
.board::before {
    content: "";
    position: absolute;
    inset: 20%;
    border: 1px solid rgba(86, 60, 29, 0.16);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.tile {
    position: relative;
    border-radius: clamp(3px, 0.7vw, 6px);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 45%),
        linear-gradient(145deg, var(--board-tile), var(--board-tile-alt));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -2px 3px rgba(83, 58, 27, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: visible;
    transition: background 180ms ease, box-shadow 180ms ease;
    touch-action: manipulation;
}

.tile.edge {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 45%),
        linear-gradient(145deg, #c3a97a, #b39768);
    box-shadow:
        inset 0 0 0 1px rgba(84, 58, 26, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -2px 3px rgba(83, 58, 27, 0.18);
}

.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1.5px solid transparent;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    pointer-events: none;
}

.tile.is-valid::after {
    border-color: rgba(247, 217, 156, 0.9);
    box-shadow: inset 0 0 14px rgba(232, 181, 91, 0.35), 0 0 10px rgba(232, 181, 91, 0.2);
    animation: validPulse 1.6s ease-in-out infinite;
}

.tile.is-valid-move::after {
    border-color: rgba(70, 194, 180, 0.9);
    box-shadow: inset 0 0 14px rgba(70, 194, 180, 0.3), 0 0 10px rgba(70, 194, 180, 0.16);
}

.tile.is-selected::after {
    border-color: var(--gold-bright);
    box-shadow: inset 0 0 18px rgba(232, 181, 91, 0.45), 0 0 14px rgba(232, 181, 91, 0.3);
}

.tile.is-push-line {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 45%),
        linear-gradient(145deg, #c99570, #b57b59);
}

.tile.is-push-line::after {
    border-color: rgba(255, 138, 93, 0.9);
    box-shadow: inset 0 0 16px rgba(255, 138, 93, 0.35);
}

.tile.is-push-target::after {
    border-color: rgba(255, 107, 94, 0.95);
    box-shadow: inset 0 0 20px rgba(255, 107, 94, 0.45), 0 0 16px rgba(255, 107, 94, 0.25);
}

.tile.is-last-from {
    box-shadow: inset 0 0 0 2px rgba(255, 107, 94, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tile.is-last-to {
    box-shadow: inset 0 0 0 2px rgba(118, 214, 164, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tile.is-rock-cell {
    background:
        radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.08), transparent 65%),
        linear-gradient(145deg, #bda77d, #ab9265);
}

@keyframes validPulse {
    0%, 100% { box-shadow: inset 0 0 14px rgba(232, 181, 91, 0.3), 0 0 8px rgba(232, 181, 91, 0.14); }
    50% { box-shadow: inset 0 0 18px rgba(232, 181, 91, 0.5), 0 0 16px rgba(232, 181, 91, 0.3); }
}

/* Pièces */

.piece {
    position: absolute;
    inset: 4%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    will-change: transform;
}

.piece .piece-art {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 50%;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 4px 4px rgba(50, 32, 12, 0.4));
}

.piece .piece-art svg {
    width: 88%;
    height: 88%;
    overflow: visible;
}

.piece .piece-art .tint-main { fill: currentColor; }
.piece .piece-art .tint-light { fill: #fdf6e8; fill-opacity: 0.9; }
.piece .piece-art .tint-dark { fill: rgba(0, 0, 0, 0.24); }
.piece .piece-art .tint-accent { fill: var(--gold-bright); }

.player-p0-piece { color: var(--p0); }
.player-p1-piece { color: var(--p1); }
.rock-piece { color: #5b6670; }

.rock-piece .piece-art svg {
    width: 82%;
    height: 82%;
    filter: drop-shadow(0 4px 5px rgba(20, 20, 20, 0.48));
}

.piece.is-new {
    animation: pieceDrop 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pieceDrop {
    0% { transform: scale(0.55); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.piece.is-moving {
    z-index: 5;
}

.piece.is-selected .piece-art {
    filter: drop-shadow(0 0 8px rgba(232, 181, 91, 0.9)) drop-shadow(0 4px 4px rgba(50, 32, 12, 0.4));
}

.piece.is-threatened .piece-art {
    filter: drop-shadow(0 0 8px rgba(255, 107, 94, 0.75)) drop-shadow(0 4px 4px rgba(50, 32, 12, 0.4));
}

.tile .piece {
    pointer-events: auto;
}

/* Flèche de poussée affichée sur la ligne */
.push-arrow {
    position: absolute;
    z-index: 8;
    width: 22px;
    height: 22px;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: arrowNudge 1.1s ease-in-out infinite;
}

.push-arrow svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

@keyframes arrowNudge {
    0%, 100% { transform: translate(0, 0); opacity: 0.85; }
    50% { transform: translate(var(--ax, 0), var(--ay, 0)); opacity: 1; }
}

.expel-marker {
    position: absolute;
    z-index: 9;
    width: 36%;
    height: 36%;
    border-radius: 50%;
    border: 2px dashed var(--danger);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(255, 107, 94, 0.12);
    pointer-events: none;
    animation: expelBlink 0.9s ease-in-out infinite;
}

@keyframes expelBlink {
    0%, 100% { opacity: 0.55; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Toast sur le plateau */

.board-toast {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(4, 17, 18, 0.9);
    border: 1px solid var(--line);
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--gold-bright);
    white-space: nowrap;
    z-index: 20;
    box-shadow: var(--shadow-md);
    animation: toastIn 220ms ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.thinking {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(4, 17, 18, 0.88);
    border: 1px solid var(--line);
    font-size: 0.7rem;
    color: var(--gold);
    z-index: 15;
}

.thinking-dots {
    display: inline-flex;
    gap: 3px;
}

.thinking-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    animation: think 1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes think {
    0%, 100% { opacity: 0.25; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

/* Réserve */

.tray-block {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tray-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.tray-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-dim);
}

.tray-note {
    font-size: 0.6rem;
    color: var(--muted-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reserve-tray {
    display: flex;
    gap: 7px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 52px;
    align-items: center;
}

.reserve-slot {
    position: relative;
    flex: 1 1 0;
    max-width: 58px;
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.reserve-slot.is-filled {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
}

.reserve-slot.is-filled.p0 {
    color: var(--p0);
    background: var(--p0-soft);
    border-color: rgba(240, 138, 93, 0.22);
}

.reserve-slot.is-filled.p1 {
    color: var(--p1);
    background: var(--p1-soft);
    border-color: rgba(70, 194, 180, 0.22);
}

.reserve-slot.is-filled:hover,
.reserve-slot.is-selected {
    border-color: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.reserve-slot.is-filled.is-disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.reserve-slot svg {
    width: 82%;
    height: 82%;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.32));
}

.reserve-empty {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

/* Indications / barre d'actions */

.hint-bar {
    flex: 0 0 auto;
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--muted);
    min-height: 18px;
    padding: 0 6px;
}

.hint-bar strong {
    color: var(--gold-bright);
    font-weight: 650;
}

.action-bar {
    flex: 0 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 5px 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.action-btn .icon {
    font-size: 1.1rem;
}

.action-btn:not(:disabled):hover {
    background: rgba(232, 181, 91, 0.1);
    border-color: var(--line);
    color: var(--gold-bright);
}

.action-btn:not(:disabled):active {
    transform: scale(0.96);
}

.action-btn:disabled {
    opacity: 0.32;
}

.action-btn.action-cancel:not(:disabled) {
    color: #ffb1a9;
    border-color: rgba(255, 107, 94, 0.2);
}

/* Panneaux de choix */

.choice-panel {
    position: absolute;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 8px);
    transform: translateX(-50%);
    width: min(94vw, 440px);
    padding: 14px;
    border-radius: 16px;
    background: rgba(6, 25, 26, 0.97);
    border: 1px solid var(--line-strong);
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.5), var(--shadow-md);
    z-index: 60;
    backdrop-filter: blur(18px);
    animation: sheetUp 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
    from { opacity: 0; transform: translate(-50%, 14px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.choice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}

.orientation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.orient-btn {
    min-height: 58px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--ivory);
    font-size: 0.62rem;
    transition: background 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.orient-btn .icon {
    font-size: 1.25rem;
    color: var(--gold);
}

.orient-btn.is-current {
    border-color: var(--line-strong);
    background: rgba(232, 181, 91, 0.1);
}

.orient-btn:hover {
    background: rgba(70, 194, 180, 0.1);
    border-color: rgba(70, 194, 180, 0.35);
}

.orient-btn:active {
    transform: scale(0.97);
}

.orientation-grid.keep-mode {
    grid-template-columns: repeat(5, 1fr);
}

.orient-btn.keep-btn {
    border-color: rgba(70, 194, 180, 0.3);
    background: rgba(70, 194, 180, 0.08);
}

.choice-help {
    margin-top: 9px;
    font-size: 0.66rem;
    color: var(--muted);
    line-height: 1.4;
    text-align: center;
}

.force-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 2px;
}

.force-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 56px;
}

.force-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1;
    color: var(--p1-strong);
}

.force-side:last-child .force-value {
    color: var(--danger);
}

.force-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted-2);
}

.force-vs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.force-track {
    height: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.force-track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--p1), var(--p1-strong));
    transition: width 260ms ease;
}

.force-track.resistance i {
    background: linear-gradient(90deg, var(--danger), #ff9b8f);
    margin-left: auto;
}

.push-result {
    font-size: 0.7rem;
    text-align: center;
    color: var(--muted);
    margin-bottom: 10px;
}

.push-result.is-win {
    color: var(--gold-bright);
    font-weight: 650;
}

.push-result.is-fail {
    color: #ff9b8f;
}

.choice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Bandeau connexion / tour */

.connection-banner {
    position: absolute;
    top: calc(var(--safe-top) + 54px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(4, 17, 18, 0.94);
    border: 1px solid rgba(232, 181, 91, 0.3);
    font-size: 0.7rem;
    color: var(--gold);
    z-index: 55;
    box-shadow: var(--shadow-md);
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(232, 181, 91, 0.2);
    border-top-color: var(--gold);
    animation: spin 0.9s linear infinite;
    display: inline-block;
    flex: 0 0 auto;
}

.spinner.small {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

.spinner.large {
    width: 34px;
    height: 34px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.turn-banner {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 22px;
    border-radius: 12px;
    background: rgba(4, 17, 18, 0.94);
    border: 1px solid var(--line-strong);
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: 1.1rem;
    z-index: 40;
    box-shadow: var(--shadow-md);
    animation: turnBanner 1.8s ease forwards;
    pointer-events: none;
}

@keyframes turnBanner {
    0% { opacity: 0; transform: translate(-50%, -42%) scale(0.94); }
    12%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -55%) scale(1.02); }
}

/* Overlay de fin de manche */

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 12, 13, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 80;
    animation: fadeIn 220ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-card {
    width: min(94vw, 430px);
    max-height: 88dvh;
    overflow-y: auto;
    padding: 26px 22px;
    border-radius: 20px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(232, 181, 91, 0.13), transparent 55%),
        linear-gradient(160deg, #102f30, #06191a);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: overlayIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes overlayIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.overlay-card .eyebrow {
    justify-content: center;
    margin-bottom: 8px;
}

.overlay-card h2 {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    color: var(--ivory);
    margin-bottom: 6px;
}

.overlay-sub {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.overlay-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 12px 0 16px;
    font-family: var(--font-display);
    font-size: 2rem;
}

.overlay-score .score-p0 { color: var(--p0-strong); }
.overlay-score .score-p1 { color: var(--p1-strong); }
.overlay-score .score-sep { color: var(--muted-2); font-size: 1.2rem; }

.overlay-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-bottom: 18px;
}

.overlay-stat {
    padding: 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overlay-stat span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ivory);
}

.overlay-stat small {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}

.overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-actions .btn {
    width: 100%;
}

/* ==========================================================================
   Règles
   ========================================================================== */

.rules-body {
    max-width: 760px;
    gap: 14px;
}

.rule-hero {
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(232, 181, 91, 0.1), rgba(15, 43, 44, 0.72));
    border: 1px solid var(--line);
}

.rule-hero h3 {
    font-size: clamp(1.35rem, 3.6vw, 1.8rem);
    color: var(--gold-bright);
    margin-bottom: 8px;
}

.rule-hero p,
.rule-card p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--muted);
}

.rule-card {
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-card h3 {
    font-size: 1.25rem;
    color: var(--ivory);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 181, 91, 0.12);
    border: 1px solid var(--line-strong);
    color: var(--gold);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.rule-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rule-list li {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--muted);
}

.rule-list li::marker {
    color: var(--gold-dim);
}

.rule-list strong,
.rule-card p strong {
    color: var(--ivory);
    font-weight: 650;
}

.diagram {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.diagram-board {
    width: min(68vw, 250px);
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px;
    border-radius: 11px;
    background: #3a2a1b;
    box-shadow: var(--shadow-md);
}

.diagram-cell {
    border-radius: 3px;
    background: linear-gradient(145deg, var(--board-tile), var(--board-tile-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.diagram-cell.edge {
    background: linear-gradient(145deg, #c3a97a, #b39768);
}

.diagram-cell.p0 { color: var(--p0); }
.diagram-cell.p1 { color: var(--p1); }
.diagram-cell.rock { color: #5b6670; }

.diagram-cell.is-target {
    box-shadow: inset 0 0 0 2px rgba(255, 107, 94, 0.8), inset 0 0 12px rgba(255, 107, 94, 0.25);
    animation: diagramPulse 1.4s ease-in-out infinite;
}

@keyframes diagramPulse {
    0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 107, 94, 0.7), inset 0 0 10px rgba(255, 107, 94, 0.2); }
    50% { box-shadow: inset 0 0 0 2px rgba(255, 107, 94, 1), inset 0 0 16px rgba(255, 107, 94, 0.4); }
}

.diagram-expel {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--danger);
    color: #2a0c09;
    font-size: 0.55rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.diagram-cell svg {
    width: 88%;
    height: 88%;
    filter: drop-shadow(0 2px 2px rgba(50, 32, 12, 0.3));
}

.diagram-cell .cell-force {
    position: absolute;
    top: 1px;
    right: 1px;
    font-size: 0.45rem;
    font-weight: 700;
    color: var(--gold-bright);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 3px;
    padding: 1px 3px;
}

.diagram-caption {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted-2);
    line-height: 1.45;
}

.force-example {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.force-example-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 90px;
}

.force-big {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
}

.force-example-side.force .force-big { color: var(--p1-strong); }
.force-example-side.resist .force-big { color: var(--danger); }

.force-example-side span:not(.force-big) {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.force-example-side small {
    font-size: 0.58rem;
    color: var(--muted-2);
    text-align: center;
}

.force-example-op {
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--gold);
}

.force-example-ok {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(118, 214, 164, 0.12);
    border: 1px solid rgba(118, 214, 164, 0.3);
    color: var(--ok);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tips-card {
    border-color: rgba(232, 181, 91, 0.18);
    background: linear-gradient(145deg, rgba(232, 181, 91, 0.05), rgba(255, 255, 255, 0.02));
}

/* ==========================================================================
   Profil
   ========================================================================== */

.profile-body {
    max-width: 760px;
}

.identity-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(70, 194, 180, 0.08), rgba(15, 43, 44, 0.6));
    border: 1px solid rgba(70, 194, 180, 0.18);
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 181, 91, 0.1);
    border: 1px solid var(--line-strong);
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.5rem;
    flex: 0 0 auto;
}

.identity-card h3 {
    font-size: 1.3rem;
    color: var(--ivory);
    margin-bottom: 3px;
}

.identity-card p {
    font-size: 0.74rem;
    color: var(--muted);
}

.profile-auth-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    align-self: flex-start;
}

.seg-btn {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 650;
    color: var(--muted);
    transition: background 150ms ease, color 150ms ease;
}

.seg-btn.is-active {
    background: rgba(232, 181, 91, 0.13);
    color: var(--gold-bright);
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-error {
    font-size: 0.74rem;
    color: #ff9b8f;
    line-height: 1.4;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-card {
    padding: 14px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.stat-card span {
    font-family: var(--font-display);
    font-size: 1.55rem;
    color: var(--gold-bright);
    line-height: 1;
}

.stat-card small {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-2);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.history-item {
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.history-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    cursor: pointer;
    user-select: none;
}

.history-result {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--muted-2);
}

.history-result.win { background: var(--ok); box-shadow: 0 0 8px rgba(118, 214, 164, 0.5); }
.history-result.loss { background: var(--danger); }
.history-result.draw { background: var(--gold); }

.history-main {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--ivory);
}

.history-sub {
    font-size: 0.64rem;
    color: var(--muted-2);
}

.history-score {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--muted);
}

.history-detail {
    display: none;
    padding: 0 13px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item.is-open .history-detail {
    display: block;
}

.history-round {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.68rem;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-round:last-child {
    border-bottom: 0;
}

.history-round strong {
    color: var(--ivory);
    font-weight: 600;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.local-stats-panel {
    margin-top: 4px;
}

/* ==========================================================================
   Modales
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 12, 13, 0.74);
    backdrop-filter: blur(8px);
    z-index: 200;
    animation: fadeIn 180ms ease;
}

.modal-card {
    width: min(94vw, 500px);
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: linear-gradient(160deg, #102f30, #06191a);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: overlayIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-card.small {
    width: min(94vw, 420px);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.modal-head h2 {
    font-size: 1.3rem;
    color: var(--ivory);
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.confirm-message {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted);
}

.settings-server-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-about {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    color: var(--muted-2);
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Toasts & confettis
   ========================================================================== */

.toast-layer {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 300;
    pointer-events: none;
    width: min(92vw, 420px);
}

body[data-screen="game"] .toast-layer {
    top: auto;
    bottom: calc(var(--safe-bottom) + 218px);
}

.toast {
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(4, 17, 18, 0.96);
    border: 1px solid var(--line-strong);
    color: var(--gold-bright);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: toastLife 3.2s ease forwards;
}

.toast.is-error {
    border-color: rgba(255, 107, 94, 0.4);
    color: #ffb1a9;
}

.toast.is-ok {
    border-color: rgba(118, 214, 164, 0.35);
    color: var(--ok);
}

@keyframes toastLife {
    0% { opacity: 0; transform: translateY(-8px) scale(0.96); }
    8%, 88% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 90;
}

/* ==========================================================================
   Adaptations écran
   ========================================================================== */

@media (max-width: 860px) {
    .home-main {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 18px;
    }

    .hero-art {
        display: none;
    }

    .hero-copy h1 {
        font-size: clamp(2.6rem, 11vw, 3.8rem);
    }

    .online-grid {
        grid-template-columns: 1fr;
    }

    .mode-card {
        grid-template-columns: 50px minmax(0, 1fr);
        grid-template-areas:
            "icon copy"
            "extra extra"
            "action action";
        gap: 12px;
    }

    .mode-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        font-size: 1.3rem;
    }

    .mode-card > .btn {
        width: 100%;
    }

    .mode-card > .difficulty {
        justify-self: stretch;
    }

    .diff-btn {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .screen {
        padding-left: calc(var(--safe-left) + 12px);
        padding-right: calc(var(--safe-right) + 12px);
    }

    .page-head {
        gap: 10px;
        padding-bottom: 8px;
    }

    .page-head h2 {
        font-size: 1.35rem;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .head-spacer {
        width: 38px;
        height: 38px;
    }

    .hero-copy h1 {
        margin-top: 10px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-meta {
        gap: 6px;
    }

    .meta-pill {
        padding: 5px 9px;
        font-size: 0.64rem;
    }

    .lobby-players {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .player-role {
        display: none;
    }

    .versus {
        display: none;
    }

    .board-frame {
        width: min(94vw, 440px, calc(100dvh - 292px));
    }

    .action-btn {
        min-height: 48px;
        font-size: 0.56rem;
    }

    .action-btn .icon {
        font-size: 1rem;
    }

    .tray-note {
        display: none;
    }

    .reserve-tray {
        min-height: 48px;
        padding: 5px 6px;
        gap: 5px;
    }

    .game-top .icon-btn {
        width: 34px;
        height: 34px;
    }

    .timer {
        width: 36px;
        height: 36px;
    }

    .player-card {
        padding: 7px 8px;
        gap: 7px;
    }

    .player-avatar {
        width: 30px;
        height: 30px;
    }

    .player-name {
        font-size: 0.76rem;
    }

    .player-score {
        font-size: 1.2rem;
    }

    .overlay-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .force-example {
        gap: 8px;
    }

    .force-example-side {
        min-width: 74px;
    }
}

@media (max-height: 640px) {
    .board-frame {
        width: min(90vw, 380px, calc(100dvh - 258px));
    }

    .game-screen {
        gap: 4px;
    }

    .player-card {
        padding: 6px 8px;
    }

    .tray-block {
        gap: 2px;
    }

    .reserve-tray {
        min-height: 44px;
    }

    .action-btn {
        min-height: 44px;
    }

    .hint-bar {
        font-size: 0.66rem;
    }
}

@media (min-width: 1100px) and (min-height: 800px) {
    .board-frame {
        width: min(48vw, 480px, calc(100dvh - 310px));
    }

    .game-screen {
        max-width: 820px;
    }
}

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