/* Tapis Vert — Solitaire. Direction A (feutre vert), thèmes bleu nuit et bois. */
:root {
  --ink: #f2e6c9; --muted: #c9d4c9; --gold: #d8b46a; --gold-hi: #e7c985; --gold-lo: #c99b49;
  --bar: rgba(6, 26, 17, .55); --panel: rgba(4, 22, 14, .55); --drawer: #0f2f21; --line: rgba(242, 230, 201, .14);
  --paper: #fbf6ea; --paper-ink: #1b2420; --accent: #1f5c3f; --win: #2f7a55;
  --felt-color: #1f5c3f; --felt-img: url(../images/feutre-vert.webp); --felt-size: 700px;
  --vignette: radial-gradient(130% 85% at 50% 35%, rgba(255,255,255,.07) 0%, rgba(0,0,0,0) 45%, rgba(0,18,10,.45) 100%);
  --btn-bg: rgba(4, 22, 14, .45); --btn-line: rgba(242, 230, 201, .25);
  --serif: Fraunces, Georgia, "Times New Roman", serif; --sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
body.felt-bleu {
  --felt-color: #1d3554; --felt-img: url(../images/feutre-bleu.webp);
  --bar: rgba(5, 12, 28, .55); --panel: rgba(5, 12, 28, .55); --drawer: #0d1a30; --accent: #1d3554; --win: #2e5f8f;
  --vignette: radial-gradient(130% 85% at 50% 35%, rgba(255,255,255,.06) 0%, rgba(0,0,0,0) 45%, rgba(4,10,24,.5) 100%);
  --btn-bg: rgba(5, 12, 28, .5); --muted: #c3cbd8;
}
body.felt-bois {
  --felt-color: #c08a55; --felt-img: url(../images/bois.webp); --felt-size: 800px;
  --bar: rgba(59, 36, 20, .92); --panel: rgba(46, 26, 12, .72); --drawer: #3b2414; --ink: #f6e7cf; --muted: #ead7b8;
  --accent: #23694a; --win: #2f7a55; --line: rgba(246, 231, 207, .2);
  --vignette: radial-gradient(130% 85% at 50% 35%, rgba(255,240,215,.16) 0%, rgba(0,0,0,0) 50%, rgba(60,30,10,.38) 100%);
  --btn-bg: rgba(46, 26, 12, .66); --btn-line: rgba(246, 231, 207, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background-color: var(--felt-color);
  background-image: var(--vignette), var(--felt-img); background-size: 100% 100%, var(--felt-size);
  background-attachment: fixed, fixed; overflow: hidden; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
a { color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Mise en page ---------- */
#app {
  height: 100%; display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "head" "hud" "table" "tools" "ad";
}
header.top {
  grid-area: head; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px;
  background: var(--bar); border-bottom: 1px solid rgba(216, 180, 106, .25);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand b { font-family: var(--serif); font-size: 22px; font-weight: 700; white-space: nowrap; }
.brand .suits { font-size: 14px; color: var(--gold); letter-spacing: .12em; margin-left: 4px; }
.games { display: none; gap: 24px; font-size: 15px; font-weight: 600; }
.games a { text-decoration: none; color: var(--ink); padding: 4px 0; opacity: .92; }
.games a[aria-current] { color: #fff; border-bottom: 2px solid var(--gold); opacity: 1; }
.games a.soon { opacity: .5; cursor: default; }
.games a.soon small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; color: var(--gold); }
.hud-boxes { display: none; gap: 10px; margin-left: auto; font-variant-numeric: tabular-nums; }
.hud-boxes div { display: flex; flex-direction: column; align-items: center; padding: 5px 14px; border-radius: 10px; background: rgba(0,0,0,.25); min-width: 66px; }
.hud-boxes span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hud-boxes b { font-size: 17px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(0,0,0,.2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
header.top .icon-btn { margin-left: auto; }
.hud-line { grid-area: hud; display: flex; justify-content: center; gap: 18px; font-size: 14px; color: var(--muted); padding: 6px 0 2px; font-variant-numeric: tabular-nums; }
.hud-line b { color: var(--ink); }
.hud-line .mode { color: var(--gold); font-weight: 600; }

#table { grid-area: table; position: relative; min-height: 0; touch-action: none; isolation: isolate; z-index: 0; }
#board { position: absolute; inset: 0; }

.toolbar { grid-area: tools; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px 10px; }
.tb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 60px;
  border: 1px solid var(--btn-line); border-radius: 12px; background: var(--btn-bg); color: var(--ink);
  font-size: 12px; font-weight: 600; position: relative; transition: transform .08s;
}
.tb:active { transform: translateY(1px); }
.tb.primary { border: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: #2a1d08; font-weight: 700; box-shadow: 0 3px 0 #8c6326; }
body.felt-bois .tb.primary { background: linear-gradient(180deg, #3f9468, #23694a); color: #fff; box-shadow: 0 3px 0 #164430; }
.tb .pill { background: var(--gold); color: #2a1d08; border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 700; margin-left: 2px; }
.tb:disabled { opacity: .45; cursor: default; }
.tb .lbl-long { display: none; }

.ad { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12px; }
.ad.placeholder { border: 1px solid rgba(242,230,201,.2); background: rgba(0,0,0,.22); border-radius: 6px; }
.ad-bottom { grid-area: ad; width: 320px; max-width: calc(100% - 20px); height: 50px; margin: 2px auto calc(6px + env(safe-area-inset-bottom)); }
.ad-side { display: none; grid-area: side; flex-direction: column; gap: 6px; width: 300px; height: 600px; border-radius: 10px; }
.ad-side span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.ad-side b { font-size: 17px; color: var(--ink); }
body.embed .ad, body.embed .games, body.embed .brand .suits { display: none !important; }
body.noads .ad { display: none !important; }

/* Ordinateur */
@media (min-width: 900px) and (min-height: 600px) {
  #app { grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "head" "table" "tools" "ad"; }
  header.top { height: 64px; padding: 0 28px; gap: 36px; }
  header.top .icon-btn { margin-left: 0; }
  .brand img { width: 40px; height: 40px; border-radius: 9px; }
  .brand b { font-size: 27px; }
  .brand .suits { font-size: 18px; letter-spacing: .15em; }
  .games { display: flex; }
  .hud-boxes { display: flex; }
  .hud-line { display: none; }
  .toolbar { display: flex; justify-content: center; gap: 12px; padding: 10px 16px 18px; }
  .tb { flex-direction: row; height: 48px; padding: 0 20px; font-size: 16px; gap: 8px; }
  .tb .lbl-short { display: none; } .tb .lbl-long { display: inline; }
  .tb.primary { padding: 0 22px; box-shadow: 0 3px 0 #8c6326, 0 8px 18px rgba(0,0,0,.3); }
  .tb .pill { font-size: 13px; padding: 1px 8px; }
  .ad-bottom { width: 728px; height: 90px; }
}
@media (min-width: 1200px) and (min-height: 700px) {
  #app { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "head head" "table side" "tools side"; column-gap: 32px; padding-right: 32px; }
  header.top { margin-right: -32px; }
  .ad-side { display: flex; align-self: center; }
  .ad-bottom { display: none; }
}
/* Téléphone à l'horizontale */
@media (max-height: 520px) and (orientation: landscape) {
  #app { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "head head" "table tools"; }
  header.top { height: 46px; }
  .hud-line { display: none; }
  .hud-boxes { display: flex; } .hud-boxes div { padding: 2px 10px; } .hud-boxes b { font-size: 15px; } .hud-boxes span { font-size: 9px; }
  header.top .icon-btn { margin-left: 0; }
  .toolbar { grid-template-columns: 1fr; grid-auto-rows: 1fr; width: 92px; padding: 6px 8px 6px 0; }
  .tb { height: auto; }
  .ad-bottom { display: none; }
}

/* ---------- Cartes ---------- */
.slot {
  position: absolute; left: 0; top: 0; border-radius: var(--r, 6px); border: 1.5px solid rgba(242, 230, 201, .22);
  background: rgba(0, 0, 0, .12); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); color: rgba(242, 230, 201, .25); pointer-events: auto;
}
body.felt-bois .slot { border-color: rgba(59, 36, 20, .35); background: rgba(70, 35, 10, .14); color: rgba(59, 36, 20, .4); }
.slot svg { width: 42%; height: 42%; opacity: .7; }
.slot.stock { cursor: pointer; }
.card { position: absolute; left: 0; top: 0; will-change: transform; transition: transform .2s cubic-bezier(.2, .75, .3, 1); touch-action: none; }
.card .face {
  width: 100%; height: 100%; border-radius: var(--r, 6px); background-size: 100% 100%; background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 .5px rgba(0, 0, 0, .15);
}
.card.up { cursor: grab; }
.card.dragging { transition: none; }
.card.dragging .face { box-shadow: 0 10px 22px rgba(0, 0, 0, .45), 0 0 0 .5px rgba(0, 0, 0, .2); }
.card.flip .face { animation: flip .26s ease-in-out; }
@keyframes flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.card.shake .face { animation: shake .3s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.card.hint .face, .slot.hint { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 18px rgba(231, 201, 133, .9); animation: glow 1s ease-in-out 2; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 4px rgba(231, 201, 133, .3); } }
.card.sel .face { box-shadow: 0 0 0 3px #7fd1a8, 0 6px 16px rgba(0,0,0,.4); }
.card.playable .face { box-shadow: 0 0 0 2px rgba(231, 201, 133, .85), 0 1px 2px rgba(0,0,0,.45); }
.card.gone { opacity: 0; transition: none; }

/* ---------- Calques ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.veil.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(304px, 86vw); z-index: 60; background: var(--drawer);
  border-left: 1px solid rgba(216, 180, 106, .3); box-shadow: -18px 0 40px rgba(0, 0, 0, .4);
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) 18px; display: flex; flex-direction: column; gap: 6px;
  transform: translateX(105%); transition: transform .25s cubic-bezier(.2, .75, .3, 1); overflow-y: auto;
}
.drawer.on { transform: none; }
.drawer .dh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer .dh b { font-family: var(--serif); font-size: 24px; }
.mi { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent;
  text-decoration: none; font-size: 17px; font-weight: 600; color: var(--ink); text-align: left; width: 100%; }
.mi:hover, .mi.hl { background: rgba(216, 180, 106, .14); }
.mi svg { flex: none; }
.mi .tag { margin-left: auto; font-size: 13px; color: var(--gold-hi); font-weight: 700; }
.dsub { margin: 14px 4px 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.gtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gtile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid rgba(242,230,201,.18); background: rgba(255,255,255,.04); color: var(--ink); text-decoration: none; }
.gtile b { font-size: 16px; } .gtile span { font-size: 12px; color: var(--muted); }
.gtile em { font-style: normal; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.langs { display: flex; flex-wrap: wrap; gap: 6px; }
.langs a { padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(242,230,201,.18); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.langs a:hover { background: rgba(216, 180, 106, .14); }
.langs a[aria-current] { border-color: var(--gold); color: var(--gold-hi); }
.drawer .legal { margin: 14px 4px 4px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.drawer .legal a { color: var(--muted); }

.screen {
  position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background-color: var(--felt-color);
  background-image: var(--vignette), var(--felt-img); background-size: 100% 100%, var(--felt-size);
  transform: translateY(102%); transition: transform .25s cubic-bezier(.2, .75, .3, 1); visibility: hidden;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.screen.on { transform: none; visibility: visible; }
.screen header { height: 52px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 6px; background: var(--bar); border-bottom: 1px solid rgba(216, 180, 106, .25); }
.screen h1 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.screen .icon-btn { background: transparent; }
.screen .body { flex: 1; overflow-y: auto; padding: 12px 14px 24px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 520px; margin: 0 auto; -webkit-user-select: text; user-select: text; }
.card-paper { padding: 16px 18px; border-radius: 16px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.box { padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.box h2 { margin: 2px 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); font-weight: 700; }
.kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6b5a33; font-weight: 700; }
.btn-gold { width: 100%; height: 50px; border: 0; border-radius: 12px; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: #2a1d08; font-size: 17px; font-weight: 700; box-shadow: 0 3px 0 #8c6326; }
.btn-line { flex: 1; height: 46px; border: 2px solid var(--accent); border-radius: 12px; background: transparent; color: var(--accent); font-size: 15px; font-weight: 600; }
.btn-ghost { height: 40px; padding: 0 14px; border: 1px solid var(--btn-line); border-radius: 10px; background: transparent; color: var(--ink); font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 9px 13px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.tile span { font-size: 12px; color: var(--muted); } .tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tile b.gold { color: var(--gold-hi); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 12px; background: var(--panel); }
.seg button { height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--paper); color: var(--paper-ink); }

.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: 16px; text-transform: capitalize; }
.cal-head button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.cal-head button:disabled { opacity: .3; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-grid button, .cal-grid span { height: 38px; border-radius: 9px; border: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; background: transparent; font-variant-numeric: tabular-nums; }
.cal-grid .past { background: rgba(255, 255, 255, .07); color: #d9e2d9; }
.cal-grid .won { background: var(--win); color: #fff; box-shadow: inset 0 0 0 1px rgba(231, 201, 133, .45); }
.cal-grid .today { box-shadow: inset 0 0 0 2px var(--gold-hi); background: rgba(231, 201, 133, .12); color: #fff; }
.cal-grid .won.today { background: var(--win); }
.cal-grid .future { color: rgba(242, 230, 201, .4); cursor: default; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #b08d57, var(--gold-hi)); }
.marks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.marks .got { color: var(--gold-hi); font-weight: 700; }

.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 118px; }
.bars > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bars .p { position: relative; width: 22px; border-radius: 5px 5px 2px 2px; background: rgba(242, 230, 201, .35); min-height: 2px; }
.bars .w { position: absolute; left: 0; bottom: 0; width: 22px; border-radius: 5px 5px 2px 2px; background: var(--gold-hi); }
.bars span { font-size: 12px; color: var(--muted); }

.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; }
.setrow > span { font-size: 15px; font-weight: 500; }
.sw { width: 52px; height: 30px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .22); padding: 3px; display: flex; flex: none; transition: background .15s; }
.sw::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .15s; }
.sw[aria-checked="true"] { background: #2f9a68; }
.sw[aria-checked="true"]::after { transform: translateX(22px); }
.choice { display: flex; gap: 10px; flex-wrap: wrap; }
.choice button { border: 0; border-radius: 12px; padding: 0; background: transparent; }
.choice button[aria-pressed="true"] { box-shadow: 0 0 0 2px #0f2f21, 0 0 0 4px var(--gold-hi); }
.swatch { width: 64px; height: 44px; border-radius: 12px; display: block; background-size: 256px; }
.choice .backs img { width: 44px; height: 64px; display: block; border-radius: 5px; }
.choice .faces { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.choice .faces img { width: 44px; height: 64px; border-radius: 4px; }
.lab { font-size: 14px; color: var(--muted); margin-bottom: 6px; display: block; }
.note { font-size: 13px; color: var(--muted); }
.field { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--ink); padding: 0 14px; font-size: 20px; font-variant-numeric: tabular-nums; }

/* Victoire */
.win {
  position: fixed; left: 50%; top: 50%; z-index: 58; width: min(380px, calc(100vw - 32px)); padding: 24px 22px 20px;
  border-radius: 18px; background: var(--paper); color: var(--paper-ink); text-align: center;
  box-shadow: 0 2px 0 rgba(216, 180, 106, .9), 0 20px 50px rgba(0, 0, 0, .5); display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: translate(-50%, -40%) scale(.96); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s cubic-bezier(.2, .75, .3, 1);
}
.win.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.win h2 { margin: 0; font-family: var(--serif); font-size: 40px; color: var(--accent); line-height: 1; }
.win .kicker { color: #8a7a55; }
.win .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.win .nums div { display: flex; flex-direction: column; padding: 8px 4px; border-radius: 12px; background: #efe6d0; }
.win .nums span { font-size: 12px; color: #6b5a33; text-transform: uppercase; letter-spacing: .08em; }
.win .nums b { font-size: 22px; font-variant-numeric: tabular-nums; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 0; }
.badges span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: #f3e2b5; color: #6a4b12; font-size: 13px; font-weight: 700; }
.win .row { display: flex; gap: 8px; width: 100%; }

/* Messages */
.toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 70; transform: translate(-50%, 20px); opacity: 0;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 12px; background: rgba(10, 20, 14, .92); color: #fff;
  border: 1px solid rgba(216, 180, 106, .4); box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; align-items: center; gap: 10px;
  font-size: 15px; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; border-radius: 8px; padding: 6px 10px; background: var(--gold-hi); color: #2a1d08; font-weight: 700; white-space: nowrap; }
.toast button.alt { background: rgba(255,255,255,.14); color: #fff; }
@media (min-width: 900px) and (min-height: 600px) { .toast { bottom: 110px; } }

.modal {
  position: fixed; left: 50%; top: 50%; z-index: 80; width: min(360px, calc(100vw - 32px)); transform: translate(-50%, -50%) scale(.96);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; display: flex; flex-direction: column; gap: 12px;
}
.modal.on { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.modal h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.modal p { margin: 0; }
.adbreak { position: fixed; inset: 0; z-index: 90; background: #0b1510; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); text-align: center; padding: 20px; }
.adbreak.on { display: flex; }
.adbreak .fake { width: min(336px, 90vw); height: 280px; border: 1px solid rgba(242,230,201,.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.adbreak .fake b { color: var(--ink); font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .card, .drawer, .screen, .win, .toast, .modal { transition-duration: .01s !important; }
  .card.flip .face, .card.hint .face { animation: none; }
}

/* Version CrazyGames : ni promotion d'autres jeux, ni liens sortants */
body.cg .dsub, body.cg .gtiles, body.cg a[href="regles.html"], body.cg .rules-link, body.cg .langs, body.cg .legal, body.embed .dlang, body.embed .langs { display: none !important; }
@media (min-width: 1200px) and (min-height: 700px) {
  body.embed #app, body.noads #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head" "table" "tools"; padding-right: 0; }
  body.embed header.top, body.noads header.top { margin-right: 0; }
}

/* ---------- Pyramide : pastilles sous les piles, bulle du calcul, carte qui va avec la carte choisie ---------- */
body.g-pyramide .card { transform-origin: 0 0; }
.plab { position: absolute; transform: translateX(-50%); padding: 3px 10px; border-radius: 99px; background: rgba(0, 0, 0, .22); color: var(--gold-hi); font: 700 12px var(--sans); white-space: nowrap; pointer-events: none; }
.plab b { color: var(--ink); margin-left: 3px; }
.pair-pill { position: absolute; transform: translateX(-50%) scale(.6); opacity: 0; padding: 6px 15px 7px; border-radius: 99px; background: #fff; color: #23303f; font: 700 17px var(--serif); white-space: nowrap; pointer-events: none; z-index: 900; transition: transform .16s cubic-bezier(.2, .9, .3, 1.4), opacity .12s; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.pair-pill.on { transform: translateX(-50%) scale(1); opacity: 1; }
.pair-pill b { color: #d81f4c; }
.card.pair .face { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 18px rgba(231, 201, 133, .9); }
body.g-pyramide .card .face { transition: transform .14s ease; }
body.g-pyramide .card.sel .face { transform: translateY(-7%); }
@media (prefers-reduced-motion: reduce) { .pair-pill { transition: none; } body.g-pyramide .card .face { transition: none; } }

/* ---------- TriPeaks et Golf : on touche une carte, elle part sur la défausse si elle suit ---------- */
body.g-tripeaks .card, body.g-golf .card { transform-origin: 0 0; }
body.g-tripeaks .card.playable .face, body.g-golf .card.playable .face { box-shadow: 0 0 0 3px rgba(255, 227, 106, .95), 0 0 16px rgba(255, 215, 90, .75); }
/* série en cours (TriPeaks) : pastille dorée, « +40 » qui s'envole — transform et opacity seulement */
.streak-pill { position: absolute; padding: 7px 16px 8px; border-radius: 99px; background: linear-gradient(#ffe36a, #ffc52e); color: #6b3a00; font: 700 17px var(--serif); box-shadow: 0 3px 0 #c98a00; white-space: nowrap; pointer-events: none; z-index: 900; opacity: 0; transform: scale(.6); transition: transform .18s cubic-bezier(.2, .9, .3, 1.4), opacity .14s; }
.streak-pill.center { transform: translateX(-50%) scale(.6); }
.streak-pill.on { opacity: 1; transform: scale(1); }
.streak-pill.center.on { transform: translateX(-50%) scale(1); }
.streak-pill b { color: #c2185b; margin-left: 5px; }
.plus-float { position: absolute; font: 700 24px var(--serif); color: #ffe36a; text-shadow: 0 2px 0 rgba(60, 10, 60, .5); white-space: nowrap; pointer-events: none; z-index: 901; animation: plus-up .9s ease-out forwards; }
@keyframes plus-up { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 18% { opacity: 1; transform: translateY(-4px) scale(1.12); } 70% { opacity: 1; transform: translateY(-22px) scale(1); } 100% { opacity: 0; transform: translateY(-36px) scale(1); } }
/* drapeau de chaque sommet (TriPeaks) : il passe à l'or quand le sommet est dégagé */
.peak-flag { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .25); display: grid; place-items: center; pointer-events: none; transition: transform .3s cubic-bezier(.2, .9, .3, 1.5); }
.peak-flag svg { width: 16px; height: 16px; fill: #fff; }
.peak-flag.done { background: linear-gradient(#ffe36a, #ffc52e); box-shadow: 0 2px 0 #c98a00; transform: scale(1.15); }
.peak-flag.done svg { fill: #6b3a00; }
/* parcours de 9 trous (Golf) : carte de score à droite des colonnes sur grand écran, réglette ailleurs */
.scorecard { position: absolute; width: 208px; border-radius: 18px; background: #fff; color: #1d4d1f; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); font: 700 13px var(--sans); overflow: hidden; pointer-events: none; }
.scorecard h4 { margin: 0; padding: 9px 14px 8px; background: #1f7426; color: #fff; font: 600 15px var(--serif); display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.scorecard h4 span { color: #ffe36a; }
.scorecard ol { list-style: none; margin: 0; padding: 8px 10px 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.scorecard li { border-radius: 11px; background: #eef8e4; padding: 5px 0 6px; text-align: center; font: 600 17px var(--serif); color: #1d4d1f; }
.scorecard li small { display: block; font: 700 10px var(--sans); color: #5b8a4c; letter-spacing: .04em; }
.scorecard li.now { background: #ffe36a; color: #6b3a00; } .scorecard li.now small { color: #9a6a00; }
.scorecard li.todo { color: #b6cfa6; } .scorecard li.best { background: #d2f1b8; }
.course-strip { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, .25); font: 700 12px var(--sans); color: var(--gold-hi); white-space: nowrap; pointer-events: none; }
.course-strip i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.course-strip i.ok { background: #fff; } .course-strip i.now { background: #ffe36a; }
.course-strip b { color: #fff; margin: 0 4px; }
.scorecard[hidden], .course-strip[hidden] { display: none; }
/* fin de parcours : les 9 scores et le total */
.course-sum { list-style: none; margin: 2px 0; padding: 0; display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.course-sum li { border-radius: 9px; background: #eef4e6; padding: 4px 0 5px; text-align: center; color: #23303f; }
.course-sum small { display: block; font-size: 10px; color: #6b7a5c; } .course-sum b { font: 700 15px var(--serif); }
.course-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 18px; } .course-total b { font: 700 24px var(--serif); }
/* menu des jeux dans l'en-tête : huit noms, il se resserre puis laisse la place sur les écrans moyens (les jeux restent dans le menu ☰) */
@media (max-width: 1499px) { .brand .suits { display: none; } }
@media (min-width: 900px) and (max-width: 1279px) { .games { display: none !important; } }
@media (min-width: 1280px) { .games { gap: clamp(13px, 1.5vw, 24px); white-space: nowrap; } }
@media (prefers-reduced-motion: reduce) { .streak-pill, .peak-flag { transition: none; } .plus-float { display: none; } }
