/* ===== Orapa Mine — une table de jeu en noyer : plateau verni cerclé de laiton, tapis de feutre bleu nuit, pièces laquées,
   ardoise en papier au feutre noir. Tout est dessiné (SVG et canvas) : aucune image de l'éditeur. Préfixe « or- ». ===== */

.or, .rb {
  --or-night: #150d07;
  --or-deep: #2a190e;
  --or-deep-2: #1d110a;
  --or-text: #f8eeda;
  --or-text-2: #c9b697;
  --or-line: rgb(255 226 176 / .22);
  --or-gold: #f3c55c;
  --or-gold-2: #c88b1a;
  --or-red: #e8322d;
  --or-green: #6fd88a;
  --or-display: 'Cinzel', 'Fraunces', Georgia, serif;
  --or-ui: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --or-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Matières des commandes : des tuiles de carton mat (comme le plateau) et des jetons laqués (comme les pièces).
     L'épaisseur est une tranche sous l'objet, pas une bordure. */
  --or-cream: #eadcbc;
  --or-edge: #120e0b;
  --or-tile-bg: linear-gradient(rgb(255 244 226 / .07), rgb(0 0 0 / .14)), var(--or-board, #2f2823) center / 256px;
  --or-tile-sh: inset 0 1px 0 rgb(255 244 226 / .12), 0 3px 0 var(--or-edge), 0 6px 10px -3px rgb(0 0 0 / .6);
  --or-tile-sh-down: inset 0 1px 0 rgb(255 244 226 / .08), 0 1px 0 var(--or-edge), 0 2px 4px -1px rgb(0 0 0 / .55);
  --or-lacq-bg: radial-gradient(120% 90% at 22% 8%, rgb(255 255 255 / .55) 0, rgb(255 255 255 / 0) 42%), linear-gradient(160deg, #ffdc7a, #fbb23a 52%, #d98e14);
  --or-lacq-sh: inset 0 1px 0 rgb(255 255 255 / .7), inset 0 -1px 0 rgb(120 70 0 / .35), 0 3px 0 #9b6a32, 0 4px 0 #5a3a16, 0 7px 12px -3px rgb(0 0 0 / .6);
  --or-lacq-sh-down: inset 0 1px 0 rgb(255 255 255 / .6), inset 0 -1px 0 rgb(120 70 0 / .35), 0 1px 0 #9b6a32, 0 2px 0 #5a3a16, 0 3px 5px -1px rgb(0 0 0 / .55);
  --or-press: cubic-bezier(0.2, 0, 0, 1);
}

.or {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  overflow: hidden; overflow: clip; color: var(--or-text); font-family: var(--or-body); font-weight: 600; line-height: 1.3;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  /* la table de noyer sous une lampe : une flaque de lumière chaude au centre, les bords qui tombent dans l'ombre */
  background:
    radial-gradient(ellipse 62% 48% at 50% 36%, rgb(255 205 140 / .2) 0, rgb(255 190 120 / .07) 45%, rgb(255 190 120 / 0) 75%),
    radial-gradient(ellipse 140% 110% at 50% 42%, rgb(0 0 0 / 0) 42%, rgb(0 0 0 / .42) 72%, rgb(0 0 0 / .78) 100%),
    var(--or-table, #2a1a0f) center top / 384px;
  background-color: #1a100a;
}
.or [hidden] { display: none !important; }
.or-hud { grid-row: 1; } .or-bar { grid-row: 2; } .or-main { grid-row: 3; } .or-dock { grid-row: 4; }
.or h1, .or h2, .or h3, .or p, .or ol, .or ul, .or figure { margin: 0; padding: 0; }
.or .icon { width: 1.15em; height: 1.15em; flex: none; display: block; }
.or :focus-visible { outline: 3px solid var(--or-gold); outline-offset: 2px; }
.or button { font-family: inherit; }

/* ---- haut ---- */
.or-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(7px + env(safe-area-inset-top)) 12px 5px; z-index: 5; }
.or-hud-r { display: flex; align-items: center; gap: 6px; flex: none; }
/* le tour : une plaque de carton ; quand c'est à moi, elle devient un jeton laqué */
.or-pill {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 16px; border-radius: 12px; white-space: nowrap;
  background: var(--or-tile-bg); border: 1px solid transparent; color: var(--or-cream); font: 600 .95rem/1 var(--or-ui);
  box-shadow: var(--or-tile-sh); margin-bottom: 3px;
}
.or-dot-i { width: 10px; height: 10px; border-radius: 50%; background: var(--or-text-2); flex: none; box-shadow: inset 0 1px 1px rgb(0 0 0 / .5); }
.or-pill.mine { background: var(--or-lacq-bg); color: #2a1800; box-shadow: var(--or-lacq-sh); text-shadow: 0 1px 0 rgb(255 255 255 / .45); }
.or-pill.mine .or-dot-i { background: #c0301f; box-shadow: inset 0 -1px 1px rgb(0 0 0 / .35), 0 0 0 2px rgb(255 255 255 / .35); animation: or-blink 1.1s ease-in-out infinite; }
.or-pill-t { overflow: hidden; text-overflow: ellipsis; }
/* les boutons ronds : des palets de carton */
.or-round {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid transparent; color: var(--or-cream); cursor: pointer; padding: 0; margin-bottom: 3px;
  display: inline-flex; align-items: center; justify-content: center; font: 700 1.15rem var(--or-ui);
  background: var(--or-tile-bg); box-shadow: var(--or-tile-sh);
  transition-property: transform, box-shadow; transition-duration: 150ms; transition-timing-function: var(--or-press);
}
.or-round.guide { gap: 2px; flex-wrap: wrap; padding: 7px; align-content: center; }
@keyframes or-blink { 50% { opacity: .35; } }

.or-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 10px 8px; scrollbar-width: none; justify-content: safe center; }
.or-bar::-webkit-scrollbar { display: none; }
/* les joueurs : des petites plaques ; celui qui joue est cerclé d'un filet doré imprimé */
.or-pl { display: flex; align-items: center; gap: 6px; flex: none; padding: 4px 11px 4px 5px; border-radius: 999px; background: var(--or-tile-bg); border: 1px solid transparent; box-shadow: inset 0 1px 0 rgb(255 244 226 / .1), 0 2px 0 var(--or-edge), 0 4px 7px -3px rgb(0 0 0 / .6); font-size: .8rem; font-weight: 800; color: var(--or-cream); }
.or-pl.active { box-shadow: inset 0 0 0 2px var(--or-gold), inset 0 1px 0 rgb(255 244 226 / .1), 0 2px 0 var(--or-edge), 0 4px 10px -2px rgb(243 197 92 / .35); }
.or-pl em.bad { display: inline-flex; gap: 3px; align-items: center; }
/* une solution fausse = un petit cube rouge laqué, comme ceux qu'on pose devant soi */
.or-cube {
  display: block; width: 10px; height: 10px; border-radius: 2px;
  background: radial-gradient(90% 90% at 25% 20%, rgb(255 255 255 / .55), rgb(255 255 255 / 0) 55%), #e2302a;
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / .25), 0 2px 0 #7a120d, 0 3px 3px rgb(0 0 0 / .5);
}
.or-pl.out { opacity: .5; filter: grayscale(.8); }
.or-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; background: var(--c, #555); border: 2px solid #fff4d6; flex: none; }
.or-pl em { font-style: normal; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--or-text-2); }
.or-pl em.bad { color: #ff8a80; letter-spacing: .1em; }

/* ---- contenu ---- */
.or-main { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 14px; -webkit-overflow-scrolling: touch; }
.or-main.place, .or-main.play, .or-main.over { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 2px 10px 6px; }
.or-center { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; align-content: start; text-align: center; padding: 14px 0 20px; justify-items: center; }
.or-center h1 {
  font: 800 clamp(2rem, 8vw, 3rem)/1 var(--or-display); letter-spacing: .1em; text-transform: uppercase; color: var(--or-gold);
  text-shadow: 0 1px 0 #fff0c4, 0 3px 0 #6e4a14, 0 6px 14px rgb(0 0 0 / .55);
}
.or-lead { color: var(--or-text-2); max-width: 46ch; }
.or-muted { color: var(--or-text-2); font-size: .9rem; }
.or-muted.small { font-size: .78rem; }
.or-hint { color: var(--or-text-2); font-size: .8rem; text-align: center; }

/* ---- plateau, pièces, bac ---- */
.or-scene-wrap { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; align-items: center; }
.or-scene { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; touch-action: none; -webkit-user-drag: none; overflow: visible; }
.or-scene.ro, .or-gem-icon { touch-action: auto; }
.or-scene-wrap > .or-scene { width: 100%; height: 100%; }
.or-lab-t { font: 700 13px var(--or-ui); text-anchor: middle; pointer-events: none; }
.or-tray-t { fill: rgb(246 226 186 / .6); font: 600 11px var(--or-ui); letter-spacing: .02em; pointer-events: none; }
/* Les pièces dessinent elles-mêmes leur tranche et leurs ombres (orapa-art.js) ; le mouvement est fait par des ressorts en JS,
   donc aucune transition CSS ici : elle se battrait avec l'attribut transform du SVG. */
.or-piece { cursor: grab; }
.or-piece.ro { cursor: default; pointer-events: none; }
.or-piece.drag { cursor: grabbing; }
.or-piece.bad .pc-outline { stroke: #ff3b30; stroke-width: 3.2; stroke-dasharray: none; }
.or-ghost-p { fill: rgb(111 216 138 / .22); stroke: #8fe3a6; stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.or-ghost-p.bad { fill: rgb(255 59 48 / .22); stroke: #ff6a5f; }
.or-gem-icon { display: block; overflow: visible; }

/* ---- la partie : ma mine en haut, mon ardoise en bas ---- */
.or-pane { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.or-pane h2 { display: flex; align-items: baseline; gap: 8px; font: 700 .78rem/1 var(--or-display); letter-spacing: .14em; text-transform: uppercase; color: var(--or-gold); text-shadow: 0 1px 0 rgb(0 0 0 / .6); }
.or-pane h2::before { content: ''; width: 18px; height: 2px; background: linear-gradient(90deg, transparent, var(--or-gold)); align-self: center; }
.or-pane h2 small { font: 600 .72rem var(--or-body); text-transform: none; letter-spacing: 0; color: var(--or-text-2); }
.or-stroke { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; stroke: #15151f; }
.or-slate { cursor: crosshair; }
.or-slate[data-tool="move"] { cursor: grab; }
.or-slate[data-tool="move"]:active { cursor: grabbing; }
.or-slate.zoomed { overflow: hidden; border-radius: 10px; }
/* le zoom de l'ardoise : trois petits boutons ronds en carton, dans le coin */
/* la boîte a exactement la forme de la feuille (708 × 572), pour que les boutons tombent dans son coin */
.or-slate-wrap { container-type: size; }
.or-slate-box { position: relative; flex: none; width: min(100cqw, 100cqh * 708 / 572); height: min(100cqh, 100cqw * 572 / 708); }
.or-slate-box > .or-scene { width: 100%; height: 100%; }
.or-slate-zoom { right: 12px; bottom: 10px; }
@media (max-width: 440px) { .or-slate-tools { gap: 5px; } .or-slate-tools .or-tool-b { padding-inline: 10px; } }
.or-slate-zoom { position: absolute; z-index: 2; display: flex; gap: 6px; }
.or-zb {
  width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid transparent; color: var(--or-cream); cursor: pointer; margin-bottom: 3px;
  display: inline-flex; align-items: center; justify-content: center; font: 700 1.2rem/1 var(--or-ui);
  background: var(--or-tile-bg); box-shadow: var(--or-tile-sh);
  transition-property: transform, box-shadow, opacity; transition-duration: 150ms; transition-timing-function: var(--or-press);
}
.or-zb.fit { background: var(--or-lacq-bg); color: #2a1800; box-shadow: var(--or-lacq-sh); font-size: 1rem; }
.or-zb:disabled { opacity: .4; cursor: default; }
.or-zb:not(:disabled):active { transform: translateY(2px); box-shadow: var(--or-tile-sh-down); }
.or-zb.fit:active { box-shadow: var(--or-lacq-sh-down); }
@media (prefers-reduced-motion: reduce) { .or-zb { transition-property: box-shadow, opacity; } .or-zb:not(:disabled):active { transform: none; } }
.or-slate-tools { flex: none; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.or-tool-b {
  min-height: 34px; padding: 3px 14px; border-radius: 10px; border: 1px solid transparent; color: var(--or-cream); font: 600 .8rem var(--or-ui); cursor: pointer; margin-bottom: 3px;
  background: var(--or-tile-bg); box-shadow: var(--or-tile-sh);
  transition-property: transform, box-shadow; transition-duration: 150ms; transition-timing-function: var(--or-press);
}
.or-tool-b.on { background: var(--or-lacq-bg); color: #2a1800; box-shadow: var(--or-lacq-sh); text-shadow: 0 1px 0 rgb(255 255 255 / .45); }
.or-tool-b:disabled { opacity: .45; cursor: default; }

/* ---- choix des gemmes ---- */
.or-gems-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.or-gem-card {
  display: grid; justify-items: center; align-content: center; gap: 7px; width: 112px; height: 116px; padding: 8px 4px; border-radius: 14px;
  /* un creux garni de feutre, découpé dans le carton */
  background: linear-gradient(rgb(10 18 36 / .35), rgb(10 18 36 / .35)), var(--or-felt, #1d3562) center / 128px; border: 1px solid transparent;
  box-shadow: inset 2px 3px 6px rgb(0 0 0 / .7), inset -1px -1px 0 rgb(255 244 226 / .1), 0 0 0 5px #2f2823, 0 0 0 6px rgb(255 244 226 / .07), 0 6px 12px 2px rgb(0 0 0 / .5);
  margin: 6px;
}
.or-gem-card small { font-size: .66rem; text-align: center; color: #d9e3f7; line-height: 1.1; }
.or-opts { display: grid; gap: 10px; width: 100%; max-width: 440px; }
.or-opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; text-align: left; cursor: pointer; color: var(--or-cream);
  background: var(--or-tile-bg); border: 1px solid transparent; box-shadow: var(--or-tile-sh); margin-bottom: 3px;
}
.or-opt.on { box-shadow: inset 0 0 0 2px var(--or-gold), var(--or-tile-sh); }
.or-opt input { width: 22px; height: 22px; accent-color: var(--or-gold); flex: none; }
.or-opt-i { width: 72px; flex: none; display: grid; place-items: center; }
.or-opt-t { display: grid; gap: 2px; }
.or-opt-t small { color: var(--or-text-2); font-weight: 600; }

/* ---- bas : ce qu'on attend de moi ---- */
/* le bas : un présentoir en carton posé devant le joueur, avec sa tranche vers le haut */
.or-dock {
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgb(255 244 226 / .06), rgb(0 0 0 / .18)), var(--or-board, #2f2823) center / 256px;
  box-shadow: inset 0 1px 0 rgb(255 244 226 / .14), 0 -3px 0 var(--or-edge), 0 -10px 22px rgb(0 0 0 / .45);
}
.or-dock-in { display: grid; gap: 8px; max-width: 760px; margin: 0 auto; }
.or-ask { font-weight: 700; font-size: .92rem; text-align: center; }
.or-btns, .or-sheet-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
/* les actions : des tuiles de carton épaisses ; l'action principale est un jeton laqué jaune, de la même laque que les pièces */
.or-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 20px; border-radius: 12px; cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent; color: var(--or-cream); font: 600 .94rem var(--or-ui);
  background: var(--or-tile-bg); box-shadow: var(--or-tile-sh);
  transition-property: transform, box-shadow; transition-duration: 150ms; transition-timing-function: var(--or-press);
}
.or-btn.primary { background: var(--or-lacq-bg); color: #2a1800; text-shadow: 0 1px 0 rgb(255 255 255 / .45); box-shadow: var(--or-lacq-sh); font-weight: 700; }
.or-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px rgb(234 220 188 / .28); margin-bottom: 0; }
.or-btn:disabled { opacity: .45; cursor: default; }
/* survol : la tuile monte d'un cran ; appui : elle s'enfonce sur sa tranche */
@media (hover: hover) {
  .or-btn:not(:disabled):hover, .or-round:hover, .or-tool-b:not(:disabled):hover, .or-zoom:hover, .or-opt:hover { transform: translateY(-2px); }
}
.or-btn:not(:disabled):active, .or-round:active, .or-tool-b:not(:disabled):active, .or-zoom:active, .or-opt:active { transform: translateY(2px); box-shadow: var(--or-tile-sh-down); }
.or-btn.primary:not(:disabled):active, .or-tool-b.on:not(:disabled):active { box-shadow: var(--or-lacq-sh-down); }
.or-btn.ghost:not(:disabled):active { transform: translateY(1px); box-shadow: inset 0 0 0 1.5px rgb(234 220 188 / .4); }
@media (prefers-reduced-motion: reduce) {
  .or-btn, .or-round, .or-tool-b, .or-zoom, .or-opt { transition-property: box-shadow; }
  .or-btn:not(:disabled):hover, .or-round:hover, .or-tool-b:not(:disabled):hover, .or-zoom:hover, .or-opt:hover,
  .or-btn:not(:disabled):active, .or-round:active, .or-tool-b:not(:disabled):active, .or-zoom:active, .or-opt:active { transform: none; }
}
.or-sw {
  display: inline-block; width: var(--s, 18px); height: var(--s, 18px); border-radius: 50%; flex: none; vertical-align: middle; box-sizing: border-box;
  background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / .85) 0, rgb(255 255 255 / 0) 42%), radial-gradient(circle at 60% 70%, rgb(0 0 0 / .28), rgb(0 0 0 / 0) 60%), var(--c);
  border: 1.5px solid rgb(0 0 0 / .45); box-shadow: 0 1px 2px rgb(0 0 0 / .45);
}
.or-sw.clear { background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / .9) 0, rgb(255 255 255 / 0) 45%), repeating-linear-gradient(45deg, #d7dee8 0 3px, #8c97a8 3px 5px); }
.or-round.guide .or-sw { border-width: 1px; }

/* ---- volet : le guide des couleurs, une fiche de papier ---- */
.or-drawer-wrap { position: absolute; inset: 0; z-index: 25; display: none; background: rgb(8 4 2 / .6); }
.or-drawer-wrap.open { display: block; }
.or-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(390px, 92vw); overflow-y: auto; padding: calc(16px + env(safe-area-inset-top)) 18px 22px; display: grid; gap: 10px; align-content: start;
  color: #3a2410; background: var(--or-paper, #f5ecd6) center / 192px; border-left: 1px solid transparent; box-shadow: -6px 0 0 var(--or-edge), -14px 0 34px rgb(0 0 0 / .55), inset 10px 0 18px rgb(120 80 30 / .22); animation: or-slide .24s ease-out;
}
@keyframes or-slide { from { transform: translateX(100%); } }
.or-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.or-drawer h2 { font: 800 1.15rem var(--or-display); letter-spacing: .08em; text-transform: uppercase; color: #5a3010; }
.or-drawer h3 { font: 700 .76rem var(--or-display); text-transform: uppercase; letter-spacing: .14em; color: #8a5a1c; margin-top: 6px; padding-bottom: 3px; border-bottom: 1.5px solid rgb(138 90 28 / .4); }
.or-drawer .or-muted { color: #6a4a28; }
.or-drawer .or-round { background: linear-gradient(#fff6dc, #e8d3a4); color: #4a2a10; border-color: #9a7430; box-shadow: 0 2px 5px rgb(0 0 0 / .3); }
.or-guide { list-style: none; display: grid; gap: 5px; }
.or-guide-row { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 10px; background: rgb(255 255 255 / .5); box-shadow: inset 0 0 0 1px rgb(138 90 28 / .25); font-size: .9rem; }
.or-guide-in { display: flex; align-items: center; gap: 4px; min-width: 100px; color: #6a4a28; }
.or-guide-in i, .or-guide-in em { font-style: normal; font-size: .8rem; }
.or-guide-row .arrow { font-style: normal; color: #9a7430; }
.or-guide-row b { font-weight: 800; color: #2e1a08; }

/* ---- l'écran de table : le guide des couleurs en grand, deux fiches de papier (celle du haut retournée) ---- */
.or.or-tb {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(10px, 2vmin, 24px); padding: clamp(10px, 2.4vmin, 28px);
  font-size: clamp(11px, min(2.1vh, 2.3vw), 26px);
}
.or-tb-sheet {
  min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .5em; padding: .9em 1.3em 1em; border-radius: 14px;
  color: #3a2410; background: var(--or-paper, #f5ecd6) center / 192px;
  box-shadow: inset 0 0 0 1px rgb(138 90 28 / .3), inset 0 0 28px rgb(120 80 30 / .22), 0 4px 0 var(--or-edge), 0 18px 40px rgb(0 0 0 / .55);
}
.or-tb-sheet.flip { transform: rotate(180deg); }
.or-tb-sheet h2 { font: 800 1.35em/1 var(--or-display); letter-spacing: .08em; text-transform: uppercase; color: #5a3010; text-align: center; }
.or-tb-sheet .or-muted { color: #6a4a28; font-size: .78em; text-align: center; text-wrap: balance; }
.or-tb-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4em; }
.or-tb-cols > div { min-height: 0; display: flex; flex-direction: column; gap: .35em; }
.or-tb-sheet h3 { font: 700 .7em var(--or-display); text-transform: uppercase; letter-spacing: .14em; color: #8a5a1c; padding-bottom: .25em; border-bottom: 1.5px solid rgb(138 90 28 / .4); }
.or-tb-sheet .or-guide { flex: 1; min-height: 0; grid-auto-rows: 1fr; gap: .22em; }
.or-tb-sheet .or-guide-row { gap: .45em; padding: 0 .55em; border-radius: .45em; font-size: 1em; min-height: 0; }
.or-tb-sheet .or-guide-in { gap: .18em; min-width: 6.4em; }
.or-tb-sheet .or-guide-in i, .or-tb-sheet .or-guide-in em { font-size: .8em; }
.or-tb-sheet .or-sw { width: 1.15em; height: 1.15em; border-width: max(1.5px, .08em); }
.or-tb-sheet .or-guide-row > .or-sw { width: 1.3em; height: 1.3em; }
.or-tb-sheet .or-guide-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- fenêtres et fin ---- */
.or-sheet-wrap, .or-overlay, .or-modal-wrap { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 12px; background: rgb(8 4 2 / .8); }
.or-sheet-wrap.open, .or-overlay.open, .or-modal-wrap.open { display: flex; }
.or-sheet, .or-over-card, .or-modal {
  width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; display: grid; gap: 10px; padding: 18px; border-radius: 20px;
  background: linear-gradient(rgb(255 244 226 / .06), rgb(0 0 0 / .16)), var(--or-board, #2f2823) center / 256px; border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgb(255 244 226 / .14), inset 0 0 0 8px rgb(0 0 0 / 0), inset 0 0 0 9px rgb(232 214 178 / .12), 0 6px 0 var(--or-edge), 0 24px 50px rgb(0 0 0 / .65);
}
.or-modal { max-width: 640px; height: 100%; max-height: 780px; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; }
.or-sheet h2, .or-over-card h1, .or-modal h2 { font: 800 1.35rem/1.1 var(--or-display); letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--or-gold); text-shadow: 0 2px 0 rgb(0 0 0 / .6); }
.or-over-card { text-align: center; max-width: 740px; }
.or-over-card h1 { font-size: 1.9rem; }
.or-overlay.win .or-over-card { border-color: var(--or-gold); box-shadow: 0 18px 50px rgb(0 0 0 / .65), 0 0 40px rgb(243 197 92 / .35), inset 0 0 0 1.5px rgb(255 226 176 / .4), inset 0 0 30px rgb(0 0 0 / .45); }
.or-journal { display: grid; gap: 4px; list-style: none; font-size: .82rem; color: var(--or-text-2); text-align: left; }
.or-journal li { padding: 4px 0; border-bottom: 1px solid rgb(255 226 176 / .1); }
.or-reveal { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.or-reveal figure { display: grid; gap: 6px; flex: 1 1 260px; max-width: 330px; }
.or-reveal figcaption { font: 700 .78rem var(--or-display); letter-spacing: .1em; text-transform: uppercase; color: var(--or-text-2); }
.or-reveal .or-scene { width: 100%; height: auto; }

/* ---- la page « cacher ses gemmes » : la mine et le bac tiennent dans l'écran ---- */
.or-placepage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.or-modal .or-scene-wrap { min-height: 0; }
/* proposer sa solution : l'ardoise (en lecture seule) à côté de la mine à remplir ; l'une au-dessus de l'autre sur téléphone */
.or-propose { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.or-propose .or-pane { min-width: 0; min-height: 0; }
.or-modal .or-propose .or-pane h2 { font: 700 .78rem/1 var(--or-display); letter-spacing: .14em; text-align: left; text-shadow: 0 1px 0 rgb(0 0 0 / .6); }
.or-propose-slate { flex: 2 1 0; }
.or-propose-mine { flex: 3 1 0; }
.or-propose-slate .or-slate { cursor: default; pointer-events: none; }
@media (min-width: 760px) and (min-aspect-ratio: 1 / 1) {
  .or-modal:has(.or-propose-slate) { max-width: 1120px; }
  .or-propose { flex-direction: row; align-items: stretch; }
  .or-propose-slate, .or-propose-mine { flex: 1 1 0; }
}

/* ---- grand écran ---- */
@media (min-width: 900px) {
  .or-center { max-width: 880px; }
}

/* ---- carnet de règles ---- */
.rb-art.g-orapa .or-scene.demo { width: min(360px, 100%); height: auto; }
.rb-art.g-orapa .or-gem-icon { margin: 2px; }

/* ---- la boîte, à l'accueil : le devant de la vraie boîte (redressé à plat), cadré sur le titre et la mine ---- */
.pl-box[data-game="orapa"] { background: #1c2148; padding: 0; }
.pl-box[data-game="orapa"] .pl-box-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }

/* l'ardoise en grand : elle prend toute la place, la mine se range */
.or-zoom {
  margin-left: auto; margin-bottom: 3px; min-height: 30px; padding: 2px 12px; border-radius: 9px; border: 1px solid transparent; color: var(--or-cream); font: 600 .74rem var(--or-ui);
  letter-spacing: 0; text-transform: none; text-shadow: none; cursor: pointer; background: var(--or-tile-bg); box-shadow: var(--or-tile-sh);
  transition-property: transform, box-shadow; transition-duration: 150ms; transition-timing-function: var(--or-press);
}
.or .or-zoom { font-family: var(--or-ui); white-space: nowrap; flex: none; }
.or-zoom[aria-pressed="true"] { background: var(--or-lacq-bg); color: #2a1800; box-shadow: var(--or-lacq-sh); }
.or-pane.big .or-scene-wrap { flex: 1 1 0; }
