* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: #EFE3C8;
    background: radial-gradient(ellipse at 50% -10%, rgba(212,175,55,0.10), transparent 55%), #17100A;
    min-height: 100vh;
}
a { color: #D4AF37; }
a:hover { color: #E8C468; }
button { font-family: inherit; cursor: pointer; }

.oie-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px;
    background: linear-gradient(180deg, #2A1810 0%, #1A0F08 100%);
    border-bottom: 3px solid #6B4423;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    flex-wrap: wrap; gap: 10px;
}
.oie-brand { display: flex; align-items: center; gap: 12px; }
.oie-title { font-family: 'Playfair Display', serif; font-weight: 900; font-size: 24px; color: #E8C468; margin: 0; }
.oie-subtitle { font-size: 11px; color: #B89968; margin: 2px 0 0; letter-spacing: 1px; text-transform: uppercase; }
.oie-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-badge {
    display: flex; align-items: center; gap: 8px;
    background: rgba(200,40,40,0.15); border: 1.5px solid #C82828; color: #FF8A8A;
    padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #FF3B3B; box-shadow: 0 0 8px #FF3B3B; }
.conn-badge { font-size: 11px; color: #9C8560; }
.conn-badge.ok { color: #7CC48A; }
.sound-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(232,196,104,0.08); border: 1.5px solid #6B4423;
    color: #E8C468; font-size: 15px; line-height: 1;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.sound-toggle:hover { border-color: #D4AF37; background: rgba(232,196,104,0.16); transform: scale(1.06); }
.sound-toggle.off { color: #9C8560; border-color: #4A3320; background: rgba(255,255,255,0.03); }

.oie-body {
    display: flex; gap: 20px; padding: 24px; align-items: flex-start;
    flex-wrap: wrap; justify-content: center;
}
.panel {
    background: linear-gradient(180deg, #2A1D12 0%, #221609 100%);
    border: 1px solid #4A3320; border-radius: 10px; padding: 16px;
}
.panel-title {
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: 14px; color: #D4AF37;
    margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #4A3320;
}

/* left panel */
.left-panel { width: 240px; flex-shrink: 0; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.player-row:last-child { border-bottom: none; }
.pawn-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.35); }
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 12.5px; font-weight: 600; color: #F0E4C8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-name.my-turn { color: #E8C468; }
.player-tag { font-size: 10px; color: #7A8B99; margin-left: 4px; }
.player-square { font-size: 10.5px; color: #9C8560; }
.progress-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 4px; margin-top: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #B9791A, #E8C468); transition: width 0.4s ease; }
.player-status { font-size: 9.5px; margin-top: 2px; }
.player-status.stuck { color: #FF8A8A; }
.player-status.skip { color: #E8C468; }
.empty-hint { font-size: 12px; color: #7A6B50; line-height: 1.5; }

/* board */
.center-stage { display: flex; justify-content: center; }
.wood-frame {
    background: linear-gradient(155deg, #6B4423 0%, #3E2415 55%, #2A1810 100%);
    border-radius: 18px; padding: 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.55), inset 0 0 0 2px rgba(0,0,0,0.3);
}
.rope-border {
    position: relative;
    border-radius: 10px; padding: 14px;
    display: flex; align-items: flex-start; gap: 14px;
    background: repeating-linear-gradient(45deg, #C9971B 0px, #C9971B 6px, #8A6410 6px, #8A6410 12px);
    box-shadow: inset 0 0 0 3px rgba(0,0,0,0.35);
}
.start-zone {
    position: relative; flex-shrink: 0; width: 150px; height: 170px;
    background: linear-gradient(180deg, #E9D7AC 0%, #DCC58C 100%);
    border: 2px solid #8A6410; border-radius: 10px;
    box-shadow: inset 0 0 14px rgba(90,60,10,0.35);
}
.start-zone-label {
    margin: 0; padding: 8px 0 4px; text-align: center;
    font-family: 'Playfair Display', serif; font-weight: 700; font-style: italic;
    font-size: 13px; color: #6B4423;
}
.board-grid {
    position: relative; width: 756px; height: 756px; flex-shrink: 0;
    background: #EFDBAE; border-radius: 4px; overflow: hidden;
}
.oie-pawn-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.oie-cell {
    position: absolute; width: 78px; height: 78px; margin: 3px; border-radius: 6px;
    box-sizing: border-box; display: flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(0,0,0,0.25); box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.oie-cell-special { animation: oieSpecialPulse 2.4s ease-in-out infinite; }
@keyframes oieSpecialPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.5), 0 0 12px rgba(212,175,55,0.55); }
    50% { box-shadow: 0 0 0 5px rgba(255,255,255,0.85), 0 0 24px rgba(212,175,55,0.95); }
}
.oie-cell {
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.oie-cell:hover {
    transform: scale(1.08);
    filter: brightness(1.25);
    box-shadow: 0 0 0 3px #E8C468, 0 4px 10px rgba(0,0,0,0.5);
    z-index: 3;
    cursor: default;
}
/* Brief highlight as an animated pawn passes over a square — placed after
   .oie-cell-special so it still wins on a special square (equal specificity,
   later rule takes it). Toggled from JS for the duration of one hop. */
.oie-cell-flash {
    transform: scale(1.1);
    filter: brightness(1.4);
    box-shadow: 0 0 0 4px #FFD34D, 0 0 18px 6px rgba(255,211,77,0.85);
    z-index: 4;
}
/* Landing squarely on a special square gets a bigger pop + an expanding ring
   burst (a short-lived absolutely-positioned span JS adds/removes). */
.oie-cell-flash-special {
    transform: scale(1.22);
    filter: brightness(1.6) saturate(1.3);
    box-shadow: 0 0 0 5px #fff, 0 0 30px 10px rgba(255,255,255,0.9);
    z-index: 7;
}
.oie-cell-ring {
    position: absolute; inset: 0;
    border-radius: 8px; border: 3px solid #FFD34D; pointer-events: none;
    animation: oieRingBurst 0.55s ease-out forwards;
}
@keyframes oieRingBurst {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.9); opacity: 0; }
}
.oie-cell-number {
    position: absolute; top: 2px; left: 3px; font-size: 10px; font-weight: 700; color: #fff;
    background: rgba(0,0,0,0.4); border-radius: 4px; padding: 1px 4px; line-height: 1.3;
}
.oie-cell-icon svg { width: 30px; height: 30px; display: block; }
.oie-pawn {
    position: absolute; width: 28px; height: 28px; border-radius: 50%;
    border: 2.5px solid #F3E3C3; box-shadow: 0 3px 6px rgba(0,0,0,0.5);
    z-index: 5; transition: left 0.45s cubic-bezier(0.3,0.6,0.3,1), top 0.45s cubic-bezier(0.3,0.6,0.3,1), transform 0.2s ease;
    pointer-events: auto; cursor: default;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: 11px; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.oie-pawn:hover { transform: scale(1.25); z-index: 8; }
.oie-pawn-finished { box-shadow: 0 0 0 2px #D4AF37, 0 3px 6px rgba(0,0,0,0.5); }
/* Reinforced golden halo for the active pawn (P1-4) — layered glow so the
   pawn whose turn it is reads instantly even mid-walk on a gold cell. */
.oie-pawn-myturn {
    box-shadow: 0 0 0 3px #FFD34D, 0 0 14px 4px rgba(232,196,104,0.95), 0 0 36px 12px rgba(212,175,55,0.55), 0 3px 6px rgba(0,0,0,0.5);
    animation: pawnPulse 1.1s ease-in-out infinite;
}
@keyframes pawnPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* Living pawns (P1-4): micro-bounce on every hop of the walk. Defined AFTER
   .oie-pawn-myturn so that, while both classes are present, the hop animation
   wins the `animation` cascade for the ~180ms of the bounce. */
.oie-pawn-hop { animation: oiePawnHop 0.18s ease-out; }
@keyframes oiePawnHop {
    0% { transform: translateY(0); }
    35% { transform: translateY(-8px); }
    70% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}
.oie-pawn-tooltip {
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
    background: #17100A; border: 1px solid #6B4423; color: #EFE3C8; font-family: 'Inter', sans-serif;
    font-weight: 500; font-size: 10.5px; padding: 3px 7px; border-radius: 5px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity 0.15s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.oie-pawn:hover .oie-pawn-tooltip { opacity: 1; }

/* ---------- Cartouche "Chat du Nid" — écrin héraldique (P1-5) ----------
   Double filet or : bordure extérieure fine #D4AF37 + filet intérieur
   #9A6B1F porté par ::before ; coins ornés plume SVG ; médaillon oie dorée ;
   bulles de chat alternées ; empty state à plume animée ; highlight des
   nouveaux messages. */
.cartouche {
    position: absolute; left: 254px; top: 254px; width: 248px; height: 248px;
    background: linear-gradient(180deg, #F6E9C6 0%, #EAD6A0 100%);
    border: 1.5px solid #D4AF37; border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 0 18px rgba(154,107,31,0.22);
    z-index: 10; display: flex; flex-direction: column; padding: 10px;
}
.cartouche::before {
    content: ''; position: absolute; inset: 6px; border-radius: 9px;
    border: 1px solid rgba(154,107,31,0.55); pointer-events: none;
}
.cartouche-corner {
    position: absolute; width: 17px; height: 17px; z-index: 2;
    color: #9A6B1F; opacity: 0.85; pointer-events: none;
}
.cartouche-corner svg { width: 100%; height: 100%; display: block; }
.cartouche-corner-tl { top: 3px; left: 3px; }
.cartouche-corner-tr { top: 3px; right: 3px; transform: rotate(90deg); }
.cartouche-corner-bl { bottom: 3px; left: 3px; transform: rotate(-90deg); }
.cartouche-corner-br { bottom: 3px; right: 3px; transform: rotate(180deg); }
.cartouche-head {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin: 2px 0 6px; position: relative; z-index: 1;
}
.cartouche-medallion {
    width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0;
    background: radial-gradient(circle at 32% 28%, #EFDD97, #D4AF37 62%, #9A6B1F);
    border: 1.5px solid #7C5210;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.65), 0 1px 4px rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
}
.cartouche-medallion svg { width: 17px; height: 17px; display: block; }
.cartouche-title {
    font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic; color: #8A2A1E;
    font-size: 14.5px; text-align: center; margin: 0; position: relative; z-index: 1;
}
.chat-feed {
    flex: 1; position: relative; z-index: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
    font-size: 10px; line-height: 1.35; color: #4A3010;
}
.chat-feed::-webkit-scrollbar { width: 4px; }
.chat-line {
    max-width: 96%; padding: 3px 7px; border-radius: 8px; align-self: flex-start;
    background: rgba(255,255,255,0.5); border: 1px solid rgba(154,107,31,0.35);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08); word-break: break-word;
}
.chat-line:nth-child(even) {
    align-self: flex-end; background: rgba(154,107,31,0.10);
    border-color: rgba(154,107,31,0.45);
}
.chat-line b { color: #6E1F15; font-weight: 700; }
.chat-line.chat-agent {
    background: rgba(212,175,55,0.14); border-color: rgba(212,175,55,0.55);
}
.chat-line.chat-agent b { color: #8A5A00; }
.chat-line.chat-new { animation: chatNewGlow 1s ease-out; }
@keyframes chatNewGlow {
    0% { background: rgba(212,175,55,0.42); box-shadow: 0 0 10px rgba(212,175,55,0.45); }
    100% { background: transparent; box-shadow: none; }
}
.chat-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px; color: #8A7550; font-style: italic;
    text-align: center; padding: 0 6px;
}
.chat-empty svg {
    width: 15px; height: 15px; opacity: 0.9;
    animation: chatFeatherFall 3.4s ease-in-out infinite;
}
@keyframes chatFeatherFall {
    0% { transform: translateY(-12px) rotate(-6deg); opacity: 0; }
    14% { opacity: 0.95; }
    62% { opacity: 0.85; }
    100% { transform: translateY(16px) rotate(30deg); opacity: 0; }
}
.chat-input-row {
    margin-top: 6px; position: relative; z-index: 1; display: flex; gap: 4px;
    align-items: center; background: rgba(255,255,255,0.5);
    border: 1px solid #B89968; border-radius: 8px; padding: 4px 6px;
}
.chat-input-row input { flex: 1; border: none; background: transparent; font-family: 'Inter', sans-serif; font-size: 10.5px; color: #4A3010; outline: none; min-width: 0; }
.chat-send-btn { border: none; background: none; padding: 2px; width: 18px; height: 18px; color: #6E1F15; flex-shrink: 0; }

/* right panel */
.right-panel { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.dice-zone { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* ---------- Paire de dés ivoire / pips d'or (P0-1) ----------
   Deux faces #F6E9C6 à pips positionnés par data-attr ; séquence de lancer
   chute/rebond/rotation (~0,8 s) ; flash du total + onde dorée (pattern
   .oie-cell-ring réutilisé via .dice-wave-ring). */
.dice-wrap { position: relative; }
.dice-pair { display: flex; gap: 10px; padding: 2px 0; }
.die-face {
    position: relative; width: 58px; height: 58px; flex-shrink: 0;
    background: linear-gradient(145deg, #FCF3DC 0%, #F6E9C6 45%, #E7D2A0 100%);
    border: 2px solid #9A6B1F; border-radius: 11px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.8), inset 0 0 0 1px rgba(154,107,31,0.15);
}
.die-pip {
    position: absolute; width: 10px; height: 10px; border-radius: 50%;
    transform: translate(-50%, -50%); pointer-events: none;
    background: radial-gradient(circle at 35% 30%, #F4DC93, #D4AF37 58%, #96701A);
    box-shadow: 0 1px 2px rgba(90,60,10,0.6), inset 0 1px 1px rgba(255,255,255,0.55);
}
.die-face.rolling { animation: oieDiceThrow 0.8s cubic-bezier(0.3,0.5,0.4,1) both; }
.die-face.rolling:last-child { animation-name: oieDiceThrowB; }
@keyframes oieDiceThrow {
    0% { transform: translateY(-44px) rotate(-40deg); opacity: 0; }
    14% { opacity: 1; }
    30% { transform: translateY(7px) rotate(28deg); }
    46% { transform: translateY(-12px) rotate(-18deg); }
    62% { transform: translateY(3px) rotate(9deg); }
    78% { transform: translateY(-3px) rotate(-4deg); }
    90% { transform: translateY(0) rotate(1deg); }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}
@keyframes oieDiceThrowB {
    0% { transform: translateY(-44px) rotate(46deg); opacity: 0; }
    14% { opacity: 1; }
    30% { transform: translateY(7px) rotate(-24deg); }
    46% { transform: translateY(-12px) rotate(20deg); }
    62% { transform: translateY(3px) rotate(-7deg); }
    78% { transform: translateY(-3px) rotate(3deg); }
    90% { transform: translateY(0) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}
.dice-total {
    font-family: 'Playfair Display', serif; font-weight: 900; font-size: 16px;
    color: #E8C468; letter-spacing: 0.4px; text-align: center; min-height: 21px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.55);
}
.dice-total.idle { color: #9C8560; font-weight: 700; font-size: 13px; }
.dice-total.pop { animation: diceTotalPop 0.5s cubic-bezier(0.2,0.9,0.3,1.3) both; }
@keyframes diceTotalPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.18); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.dice-wave-ring { border-color: #D4AF37 !important; inset: -5px !important; }
.turn-indicator { font-size: 12px; color: #B89968; text-align: center; }
.turn-indicator b { color: #E8C468; }
.roll-btn {
    width: 100%; background: linear-gradient(180deg, #E8C468, #B9791A); border: none; border-radius: 8px;
    padding: 11px; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 13.5px; color: #2A1810;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
.roll-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.event-log { max-height: 260px; overflow-y: auto; font-size: 11px; color: #C9B98C; line-height: 1.5; width: 100%; }
.event-log div { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

.legend-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 11px; color: #C9B98C; }
.legend-icon { width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.legend-icon svg { width: 13px; height: 13px; }

/* onboarding / lobby overlay */
.oie-overlay {
    position: fixed; inset: 0; background: rgba(10,6,3,0.88); display: flex; align-items: center; justify-content: center;
    z-index: 50; padding: 20px;
}
.oie-overlay[hidden] { display: none; }
.oie-modal {
    background: linear-gradient(180deg, #2A1D12 0%, #1c1208 100%); border: 1px solid #6B4423; border-radius: 14px;
    padding: 28px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.oie-modal h2 { font-family: 'Playfair Display', serif; color: #E8C468; margin: 0 0 6px; font-size: 20px; }
.oie-modal p { color: #B89968; font-size: 12.5px; line-height: 1.5; }
.oie-modal input, .oie-modal select {
    width: 100%; padding: 9px 10px; margin: 6px 0; border-radius: 6px; border: 1px solid #4A3320;
    background: #17100A; color: #EFE3C8; font-size: 13px;
}
.oie-modal button { width: 100%; margin-top: 10px; }
.oie-modal .oie-alt-btn { background: transparent; border: 1px solid #4A3320; color: #B89968; border-radius: 8px; padding: 9px; font-size: 12.5px; }
.oie-modal .oie-error { color: #FF8A8A; font-size: 12px; margin-top: 6px; min-height: 1em; }
.live-match-row {
    display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; margin-bottom: 6px;
    background: rgba(255,255,255,0.04); border-radius: 6px; font-size: 12px; cursor: pointer;
}
.live-match-row:hover { background: rgba(255,255,255,0.08); }
.win-banner {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50;
    background: radial-gradient(ellipse at center, rgba(10,6,3,0.35), rgba(10,6,3,0.72));
    border-radius: 0; flex-direction: column; gap: 14px; text-align: center;
}
.win-banner[hidden] { display: none; }
.win-banner h2 { font-family: 'Playfair Display', serif; color: #E8C468; font-size: 44px; margin: 0; position: relative; z-index: 1; text-shadow: 0 2px 12px rgba(0,0,0,0.8); animation: winPop 0.5s cubic-bezier(0.2,0.9,0.3,1.3); padding: 0 20px; }
.win-actions { display: flex; gap: 12px; position: relative; z-index: 1; }
.win-banner button { background: linear-gradient(180deg, #E8C468, #B9791A); border: none; border-radius: 10px; padding: 12px 26px; font-weight: 700; color: #2A1810; cursor: pointer; position: relative; z-index: 1; transition: transform .15s ease, box-shadow .15s ease; }
.win-banner button:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212,175,55,.4); }
.win-banner #winCloseBtn { background: linear-gradient(180deg, rgba(232,196,104,.2), rgba(185,121,26,.15)); color: #E8C468; border: 1px solid rgba(212,175,55,.4); }
.win-hint { color: #9C8560; font-size: 12px; position: relative; z-index: 1; margin: 0; }
@keyframes winPop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.fireworks-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* Desktop-first v1 (matches how Quantic Horses shipped — a real mobile pass
   with proper board rescaling comes as its own follow-up, not a half-attempt
   here). Panels restack below the board on narrower screens; the board
   itself scrolls horizontally rather than breaking its absolute-positioned
   cell layout. */
@media (max-width: 1180px) {
    .oie-body { flex-direction: column; align-items: center; }
    .left-panel, .right-panel { width: 100%; max-width: 756px; }
}
.center-stage { max-width: 100%; overflow-x: auto; }

/* Accessibility (audit D7) — reduced motion: kills the decorative loops and
   FX (special pulse, pawn pulse/hop, dice throw, total pop, expanding rings,
   falling feather). Gameplay still works: dice land instantly, pawns move by
   plain left/top transition. */
@media (prefers-reduced-motion: reduce) {
    .oie-cell-special, .oie-cell-flash, .oie-cell-flash-special, .oie-cell-ring,
    .oie-pawn-myturn, .oie-pawn-hop, .die-face.rolling, .dice-total.pop,
    .chat-line.chat-new, .chat-empty svg, .win-banner h2 {
        animation: none !important;
    }
    .oie-cell, .oie-pawn { transition: none !important; }
}

/* === Passe modes 03/09 : bouton retour + selecteur de mode === */
.oie-back-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-right: 10px;
    border: 1px solid rgba(212,175,55,.45); border-radius: 50%;
    background: linear-gradient(180deg, rgba(212,175,55,.16), rgba(212,175,55,.05));
    color: #E8C468; font-size: 18px; line-height: 1; text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    flex: 0 0 auto;
}
.oie-back-btn:hover { transform: translateX(-2px); background: linear-gradient(180deg, rgba(212,175,55,.28), rgba(212,175,55,.10)); box-shadow: 0 0 14px rgba(212,175,55,.35); }
.oie-brand { display: flex; align-items: center; gap: 10px; }

.oie-modal-sub { color: #B89968; font-size: 13px; margin: 2px 0 14px; }
.oie-modal-hint { color: #9C8560; font-size: 12.5px; margin: 4px 0 10px; line-height: 1.45; }

.mode-selector { display: flex; gap: 6px; margin-bottom: 16px; background: rgba(0,0,0,.35); padding: 5px; border-radius: 12px; border: 1px solid rgba(212,175,55,.25); }
.mode-btn {
    flex: 1; padding: 10px 8px; border: none; border-radius: 9px; cursor: pointer;
    background: transparent; color: #B89968; font-family: 'Playfair Display', serif;
    font-size: 14.5px; font-weight: 700; letter-spacing: .3px; text-align: center;
    transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.mode-btn:hover { color: #E8C468; }
.mode-btn.active { background: linear-gradient(180deg, #E8C468, #B9791A); color: #2A1810; box-shadow: 0 2px 12px rgba(212,175,55,.35); }
/* === Restructuration 20h : chat sous le départ + dés au centre === */
.oie-side-col { display: flex; flex-direction: column; gap: 14px; flex-shrink: 0; }
.chat-nest {
    position: static !important; width: 150px; height: 570px;
    padding: 8px 6px; gap: 4px;
}
.chat-nest .chat-feed { flex: 1; min-height: 0; }
.chat-nest .chat-line { max-width: 100%; font-size: 12.5px; padding: 4px 7px; line-height: 1.4; }
.chat-nest .chat-input-row input { font-size: 12px; }
.chat-nest .cartouche-head { margin: 1px 0 4px; }
.chat-nest .cartouche-title { font-size: 14px; }
.chat-nest .cartouche-medallion { width: 22px; height: 22px; }
.chat-nest .cartouche-medallion svg { width: 14px; height: 14px; }

.dice-cartouche {
    left: 254px; top: 254px; width: 248px; height: 248px;
    align-items: center; justify-content: flex-start; gap: 3px;
    padding: 8px;
}
.dice-cartouche .dice-zone { display: contents; }
.dice-cartouche .dice-wrap { position: relative; }
.dice-cartouche .roll-btn { margin-top: 2px; }
.dice-cartouche .turn-indicator { font-size: 11px; }

/* === Contraste fenetre des (cartouche clair) 04/09 === */
.dice-cartouche .dice-total {
    color: #4A3010; text-shadow: none;
}
.dice-cartouche .dice-total.idle { color: #6B4423; }
.dice-cartouche .turn-indicator { color: #6B4423; }
.dice-cartouche .turn-indicator b { color: #8A2A1E; }
