[hidden] { display: none !important; }
.card.pk .card-front {
  padding: 2.6cqi;
  background: linear-gradient(150deg, #f4f1e6 0%, #c9c2ae 45%, #8d8672 100%);
  box-shadow: 0 .4em 1.2em rgba(0, 0, 0, .45);
}
.card.pk:not(.r-commune) .card-front { background: linear-gradient(150deg, color-mix(in srgb, var(--rc) 55%, #fff) 0%, var(--rc) 45%, color-mix(in srgb, var(--rc) 55%, #000) 100%); }
.pk-frame {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 2.4cqi; color: #17181c;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--ty) 42%, #fff) 0%, color-mix(in srgb, var(--ty) 30%, #f3efe4) 55%, color-mix(in srgb, var(--ty) 50%, #ddd5c2) 100%);
}
.card.pk.t-obscurite .pk-frame { background: linear-gradient(180deg, #4d5b7c, #35405a 60%, #262e42); color: #eef1f8; }
.card.pk.t-obscurite .pk-mech, .card.pk.t-obscurite .pk-foot span, .card.pk.t-obscurite .pk-bottom { color: rgba(238, 241, 248, .7); }
.card.pk-trainer .pk-frame { background: linear-gradient(180deg, #e9eef4, #d4dde8 60%, #c3cfdd); color: #17181c; }
.pk-head { display: flex; align-items: center; gap: .3em; padding: .55em .7em .35em; }
.pk-name { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 1.12em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.ex-badge { display: inline-block; margin-left: .25em; font-style: italic; font-weight: 900; font-size: .85em; padding: 0 .25em; border-radius: .2em; color: #3b2a00; background: linear-gradient(180deg, #ffe47a, #f2b13a 60%, #c98612); }
.pk-hp { font-family: var(--display); font-weight: 800; font-size: 1.15em; white-space: nowrap; }
.pk-hp small { font-size: .55em; margin-right: .15em; font-weight: 700; }
.pk-head.trainer { flex-direction: column; align-items: flex-start; gap: .1em; padding-bottom: .3em; }
.pk-kind { align-self: flex-end; margin-top: -.15em; font-size: .62em; font-weight: 800; font-style: italic; color: #2c67c9; text-transform: uppercase; letter-spacing: .06em; }
.pk-dresseur .pk-kind { color: #b0432a; }
.pk-art { position: relative; margin: 0 .55em; aspect-ratio: 16 / 10.5; overflow: hidden; border-radius: .2em; background: #0b0e14; box-shadow: 0 0 0 .14em #d8d8d8, 0 0 0 .26em #8b8b8b, 0 .2em .5em rgba(0, 0, 0, .35); flex: none; }
.pk-art .art-img, .pk-art .art-svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-attacks, .pk-effects { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: .3em; padding: .45em .65em .2em; overflow: hidden; }
.pk-atk-head { display: flex; align-items: center; gap: .35em; }
.pk-cost { display: flex; gap: .08em; flex: none; }
.pk-atk-name { flex: 1; font-weight: 800; font-size: .92em; line-height: 1.05; }
.pk-dmg { font-family: var(--display); font-weight: 800; font-size: 1.2em; min-width: 1.6em; text-align: right; }
.pk-text { margin: .1em 0 0; font-size: .56em; line-height: 1.22; }
.pk-mech { margin: .08em 0 0; font-size: .52em; line-height: 1.18; font-weight: 700; color: #3c3f47; }
.pk-eff-name { font-weight: 800; font-size: .95em; text-align: center; }
.pk-eff .pk-text, .pk-eff .pk-mech { text-align: center; }
.pk-rule { margin-top: .15em; font-size: .48em; text-align: center; padding: .25em .4em; border-radius: .6em; background: rgba(255, 255, 255, .55); color: #3c3f47; }
.pk-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: .2em; margin: 0 .55em; padding: .2em 0; border-top: .08em solid rgba(0, 0, 0, .25); flex: none; }
.pk-foot > div { display: flex; align-items: center; gap: .15em; font-size: .6em; min-width: 0; }
.pk-foot span { color: #3c3f47; font-size: .85em; margin-right: .1em; white-space: nowrap; }
.pk-foot b { font-size: .95em; }
.pk-bottom { display: flex; justify-content: space-between; align-items: center; gap: .3em; padding: .15em .7em .35em; font-size: .46em; color: #4a4d55; flex: none; }
.pk-rar { font-weight: 800; color: color-mix(in srgb, var(--rc) 70%, #000); text-transform: uppercase; letter-spacing: .06em; }
.ti { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ty) 60%, #fff), var(--ty) 60%, color-mix(in srgb, var(--ty) 70%, #000)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.ti svg { width: 64%; height: 64%; }
.ti-incolore { color: #6b6455; }
.ti-electrique { color: #5b4300; }
.card .ti { width: 1.25em !important; height: 1.25em !important; }
.card .pk-type { width: 1.5em !important; height: 1.5em !important; }
.card .pk-foot .ti { width: 1.1em !important; height: 1.1em !important; }
.ti-free { font-size: .7em; font-weight: 800; padding: 0 .3em; }

.mini {
  position: relative; width: 92px; aspect-ratio: 5 / 7; border-radius: 10px; overflow: hidden; cursor: pointer; flex: none;
  background: #0d1016; border: 2px solid color-mix(in srgb, var(--rc) 70%, #222); box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  transition: transform .15s, box-shadow .15s, opacity .4s;
}
.mini-active { width: 138px; border-width: 3px; }
.mini.is-ex { border-color: #f2b13a; }
.mini-art { position: absolute; inset: 0; }
.mini-art img, .mini-art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .7) 0%, transparent 28%, transparent 52%, rgba(0, 0, 0, .9) 100%); pointer-events: none; }
.mini-top { position: absolute; z-index: 2; top: 4px; left: 6px; right: 5px; display: flex; align-items: center; gap: 4px; }
.mini-name { flex: 1; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 12px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.mini-active .mini-name { font-size: 15px; }
.mini .ex-badge { font-size: 10px; }
.mini-status { position: absolute; z-index: 2; top: 24px; left: 5px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.st { font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.st-burn { background: #e8533f; }
.st-slow { background: #8a6bd6; }
.st-para { background: #f2c230; color: #3b2a00; }
.mini-bottom { position: absolute; z-index: 2; left: 5px; right: 5px; bottom: 5px; display: flex; flex-direction: column; gap: 3px; }
.mini-energy { display: flex; flex-wrap: wrap; gap: 2px; min-height: 12px; }
.mini-hp { display: flex; align-items: baseline; gap: 4px; }
.hpbar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; align-self: center; }
.hpbar i { display: block; height: 100%; background: #45c47c; transform-origin: left; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.hpbar i.mid { background: #f0b43c; }
.hpbar i.low { background: #ef5a50; }
.mini-hp b { font-family: var(--display); font-size: 15px; }
.mini-active .mini-hp b { font-size: 19px; }
.mini-hp small { font-size: 10px; color: rgba(255, 255, 255, .6); }
.mini-empty { background: rgba(255, 255, 255, .02); border: 2px dashed var(--line-2); box-shadow: none; cursor: default; }
.mini-empty::after { display: none; }
.mini.hit { animation: hit .4s; }
.mini.healed { animation: healed .7s; }
.mini.charged { animation: charged .45s; }
@keyframes charged { 40% { transform: scale(1.06); } }
.mini.ko { opacity: 0; transform: translateY(26px) rotate(-6deg) scale(.85); }
.mini.summon { animation: summon .45s cubic-bezier(.3, 1.5, .5, 1); }
.mini.targetable { cursor: crosshair; box-shadow: 0 0 0 3px #6fe3ff, 0 6px 16px rgba(0, 0, 0, .45); animation: target 1s ease-in-out infinite; }
.match[class*="mode-"] .mini:not(.targetable):not(.mini-empty) { opacity: .5; }

.arena {
  grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr auto 1fr auto;
  grid-template-areas: "oinfo oactive obench" "center center center" "minfo mactive mbench" "hand hand hand";
  align-items: center; padding: 10px 18px 0;
}
.arena > #side-opp { grid-area: oinfo; }
.arena > .opp-bench { grid-area: obench; }
.arena > .active-zone.opp { grid-area: oactive; }
.arena > .center-line { grid-area: center; }
.arena > .active-zone.me { grid-area: mactive; }
.arena > .my-bench { grid-area: mbench; }
.arena > #side-me { grid-area: minfo; }
.arena > .hand { grid-area: hand; }
.active-zone { position: relative; z-index: 2; display: flex; justify-content: center; padding: 6px 28px; }
.bench { position: relative; z-index: 2; display: flex; gap: 10px; justify-content: flex-start; padding: 0 6px; }
.side-bar { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 0 14px; text-align: right; }
.side-bar .who { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.side-bar .counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--muted); }
.side-bar .counts span { background: var(--surface); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; }
.points { display: flex; gap: 6px; }
.points i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.points i.on { background: radial-gradient(circle at 35% 30%, #ffe47a, #f2b13a 60%, #b07a10); border-color: #f2b13a; }
.boss-tag, .boost-tag, .lock-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 5px; }
.boss-tag { background: #ef5a50; color: #fff; }
.boost-tag { background: #f2b13a; color: #2a1d00; }
.side-bar .counts .lock-tag { background: rgba(239, 90, 80, .18); color: #ff8a80; border-color: rgba(239, 90, 80, .4); }
.center-line { position: relative; z-index: 1; height: 1px; margin: 4px 40px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.center-line span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #0b0d12; padding: 2px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 700; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.arena .hand { height: 132px; display: flex; justify-content: center; align-items: flex-start; padding-top: 8px; overflow: visible; }
.hand-card { all: unset; position: relative; margin: 0 -10px; cursor: pointer; transform: translateY(14px) rotate(calc(var(--i) * 3deg)); transform-origin: 50% 130%; transition: transform .15s; }
.hand-card:focus-visible { outline: 2px solid var(--accent); }
.hand-card:active { transform: translateY(6px) rotate(calc(var(--i) * 3deg)); }
.hand-card .card { --cw: 104px; }
.my-turn .hand-card .card-front { box-shadow: 0 0 0 2px rgba(111, 227, 255, .55), 0 .4em 1.2em rgba(0, 0, 0, .45); }
.mode-hint { position: absolute; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(10, 12, 16, .92); border: 1px solid var(--line-2); padding: 8px 16px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.link-btn { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; margin-left: 6px; }
.energy-box { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.energy-orb { all: unset; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--surface-3); border: 2px solid var(--line-2); flex: none; }
.energy-orb .ti { width: 40px !important; height: 40px !important; }
.energy-orb.ready { border-color: var(--ty); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ty) 25%, transparent); animation: orb 1.6s ease-in-out infinite; }
.energy-orb:disabled { cursor: default; opacity: .5; }
@keyframes orb { 50% { transform: scale(1.06); } }
.energy-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.energy-info b { font-size: 14px; }
.energy-info small { font-size: 12px; color: var(--muted); }
.atk-list { display: flex; flex-direction: column; gap: 8px; }
.atk-btn { all: unset; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; background: var(--surface); border: 1px solid var(--line-2); }
.atk-btn:not(:disabled):hover { border-color: var(--accent); background: var(--surface-2); }
.atk-btn:disabled { opacity: .5; cursor: not-allowed; }
.atk-btn.weak:not(:disabled) { border-color: rgba(240, 180, 60, .6); }
.atk-cost { display: flex; gap: 2px; }
.atk-name { font-weight: 700; font-size: 14px; }
.atk-dmg { font-family: var(--display); font-weight: 800; font-size: 20px; }
.atk-btn small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: -4px; }
.atk-btn.weak small { color: var(--gold); }
.side-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.side-actions .btn-end { height: 46px; font-size: 17px; }
.float { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; font-family: var(--display); font-weight: 800; font-size: 32px; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); will-change: transform, opacity; }
.float-fx { font-size: 20px; color: #fff3c4; }
.fly-energy { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; will-change: transform; }
.played-reveal, .coin-flip, .turn-banner { left: 50%; }
.inspect { position: fixed; inset: 0; z-index: 250; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(4, 5, 8, .82); animation: fadeIn .15s; }
.inspect-card .card { --cw: min(300px, 80vw); }
.inspect-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 520px; }
.inspect-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 24px; cursor: pointer; }

.op { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s; overflow: hidden; user-select: none; touch-action: none; }
.op.in { opacity: 1; }
.op-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #1a1f2b 0%, #07080b 75%); }
.op-tint { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, var(--flash, var(--best)) 0%, transparent 65%); opacity: 0; pointer-events: none; }
.op.tease .op-tint { opacity: .18; transition: opacity .4s; }
.op.flash .op-tint { animation: opflash .8s ease-out forwards; }
@keyframes opflash { 0% { opacity: 0; } 15% { opacity: .55; } 100% { opacity: .12; } }
.op-rays { position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--flash, var(--best)) 40%, transparent) 0 5deg, transparent 5deg 15deg); opacity: 0; transition: opacity .4s; pointer-events: none; will-change: transform; animation: spin 24s linear infinite; }
.op.rays-on .op-rays { opacity: .35; }
.op-head { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 16px 22px; }
.op-title { font-family: var(--display); font-size: 21px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.op-daily { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.op-count { margin-left: auto; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--muted); }
.op-stage { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.op-pack .pack { width: min(250px, 58vw); cursor: grab; will-change: transform; animation: floaty 3s ease-in-out infinite; }
.op-pack .pack.tearing { animation: packShake .6s ease-in-out; }
@keyframes packShake { 20% { transform: rotate(-2deg) scale(1.02); } 40% { transform: rotate(2deg) scale(1.03); } 60% { transform: rotate(-2deg) scale(1.04); } 80% { transform: rotate(1deg) scale(1.05); } }
.op-pack .pack.torn .pack-tear { transition: transform .45s cubic-bezier(.3, .6, .4, 1), opacity .45s; transform: translate(140px, -170px) rotate(-30deg) !important; opacity: 0; }
.op-pack .pack.torn { animation: none; transition: transform .5s cubic-bezier(.5, 0, .7, .4) .2s, opacity .4s .3s; transform: translateY(60vh); opacity: 0; }
.op-hint { color: var(--muted); font-size: 15px; transition: opacity .2s; }
.op-hint.gone { opacity: 0; }
.op-stack { position: relative; z-index: 3; width: min(300px, 72vw); aspect-ratio: 63 / 88; }
.op-card { position: absolute; inset: 0; will-change: transform; transform: translate3d(0, 40vh, 0) scale(.85); opacity: 0; transition: transform .45s cubic-bezier(.2, .9, .3, 1.1) var(--d), opacity .3s var(--d); cursor: pointer; }
.op-stack.dealt .op-card { transform: translate3d(0, 0, 0); opacity: 1; }
.op-stack.dealt .op-card:not(.is-top) { transform: translate3d(0, 8px, 0) scale(.97); }
.op-card .card { --cw: 100%; }
.op-card .card-inner { transition: transform .55s cubic-bezier(.3, 1.2, .5, 1); }
.op-card .cf-foil { display: none; }
.op-glow { position: absolute; inset: -8%; border-radius: 22px; background: radial-gradient(circle, var(--rc) 0%, transparent 68%); opacity: 0; pointer-events: none; }
.op-card.sealed .op-glow { animation: sealGlow 1.3s ease-in-out infinite; }
.op-card.big.sealed .op-glow { inset: -18%; }
@keyframes sealGlow { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
.op-card.reveal-big { animation: bigPop .7s cubic-bezier(.3, 1.5, .5, 1); }
.op-card.reveal-big .op-glow { opacity: .55; }
@keyframes bigPop { 0% { scale: .92; } 50% { scale: 1.08; } 100% { scale: 1; } }
.op-card .new-badge { top: -12px; transform: translateX(-50%) scale(1); }
.op-card.sealed .new-badge { opacity: 0; }
.op-summary { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 70px 20px 30px; max-width: 1100px; width: 100%; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.op-summary.show { opacity: 1; transform: none; }
.op-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.op-mini { position: relative; width: clamp(130px, 15vw, 190px); animation: deal .4s cubic-bezier(.2, .9, .3, 1.1) backwards; animation-delay: var(--d); }
.op-mini .card { --cw: 100%; }
.op-mini .new-badge { transform: translateX(-50%) scale(1); }
.op-rar { display: block; text-align: center; margin-top: 8px; font-family: var(--display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.op-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 15px; }
.op-info b { color: var(--text); }
.op-info .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.op-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.row.between { justify-content: space-between; }
.input.sm { height: 32px; font-size: 13px; padding: 0 9px; }
.input.sm.num { width: 80px; }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; font-family: inherit; }
.fx-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.cost-edit { display: flex; flex-direction: column; gap: 8px; }
.cost-now { display: flex; gap: 6px; min-height: 30px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.cost-pip, .cost-add-btn { all: unset; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.cost-pip:hover { opacity: .6; }
.cost-add { display: flex; flex-wrap: wrap; gap: 6px; }
.cost-add-btn { padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.cost-add-btn:hover { border-color: var(--accent); }
.cost-add-btn:disabled { opacity: .35; cursor: not-allowed; }
.ex-check { align-self: end; height: 38px; }
.gen-preview .card { --cw: 340px; }
.energy-pick { display: flex; flex-direction: column; gap: 8px; }
.energy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.energy-chip { all: unset; cursor: pointer; padding: 3px; border-radius: 50%; border: 2px solid transparent; opacity: .35; transition: opacity .15s, border-color .15s; }
.energy-chip.on { opacity: 1; border-color: var(--text); }
.deck-compo { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.compo-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.compo-row b { color: var(--text); }
.deck-count span { color: var(--muted); font-size: 13px; }
.dr-cost { width: 30px; display: grid; place-items: center; }
.boss-note { margin: -14px 0 24px; }
.deck-types .ti { margin-right: 2px; }

@media (max-width: 1100px) {
  .mini { width: 74px; }
  .mini-active { width: 112px; }
  .bench { gap: 6px; }
}
@media (max-width: 860px) {
  .arena { grid-template-columns: 1fr; grid-template-areas: "oinfo" "obench" "oactive" "center" "mactive" "mbench" "minfo" "hand"; grid-template-rows: none; overflow-y: auto; padding: 8px; }
  .side-bar { align-items: center; text-align: center; }
  .bench { justify-content: center; }
  .arena .hand { overflow-x: auto; justify-content: flex-start; }
  .hand-card .card { --cw: 88px; }
}

.card.pk-trainer .pk-art { aspect-ratio: 16 / 9; }
.card.pk-trainer .pk-effects { gap: .2em; padding-top: .3em; }
.pk-eff-name { font-size: .88em; }

/* Beginner help: turn checklist, energy counter, playable hand cards */
.guide { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.guide-head { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; cursor: pointer; font-size: 14px; }
.guide-head span { font-size: 12px; color: var(--muted); }
.guide ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 6px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.guide li { position: relative; padding-left: 18px; }
.guide li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.guide li.now { color: var(--text); }
.guide li.now::before { border-color: var(--accent); background: var(--accent); }
.guide li.done { text-decoration: line-through; opacity: .6; }
.guide li.wait::before { display: none; }
.energy-dots { display: flex; gap: 4px; margin: 2px 0; }
.energy-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.energy-dots i.on { background: var(--accent); border-color: var(--accent); }
.atk-btn.ready { border-color: var(--accent); }
.hand-card.playable .card-front { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: .6em; }
.match-side .row-between { display: flex; justify-content: space-between; gap: 8px; }

.howto h2 { margin: 0 0 8px; }
.howto h3 { margin: 18px 0 6px; font-size: 16px; }
.howto-goal { margin: 0 0 12px; color: var(--muted); }
.howto-steps, .howto-tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.45; }
.howto-weak { margin-top: 14px; }
.howto-weak summary { cursor: pointer; color: var(--accent); }
.howto-weak ul { columns: 2; margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }

@media (max-width: 860px) {
  .guide { display: none; }
  .match-side .row-between { grid-column: 1 / -1; justify-content: center; gap: 18px; }
  .match-side .row-between .btn { height: 24px; font-size: 12px; }
}

/* Desktop/tablet windows that are not full screen: the side panel scrolls instead of
   cutting off "Fin du tour", and cards shrink with the window height. */
@media (min-width: 861px) {
  .match-side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .match-side > * { flex-shrink: 0; }
  .match-side > .guide { order: 1; }
  .match-side > .log { order: 2; flex: 1 0 70px; }
  .match-side > .row-between { order: 3; }
  .arena { overflow-y: auto; }
  body.in-match #view { height: calc(100dvh - 60px); }
  /* "Fin du tour" stays on screen even when the panel has to scroll. */
  .match-side > .side-actions { position: sticky; top: -16px; bottom: -16px; z-index: 2; margin: 0 -16px; padding: 8px 16px; background: var(--bg-2); }
}
@media (min-width: 861px) and (max-height: 820px) {
  .match .mini-active { width: clamp(78px, calc((100vh - 300px) / 2.9), 138px); }
  .match .mini:not(.mini-active) { width: clamp(56px, calc((100vh - 300px) / 4.3), 92px); }
  .arena .hand { height: clamp(96px, calc(100vh - 500px), 132px); padding-top: 4px; }
  .hand-card .card { --cw: clamp(72px, calc((100vh - 500px) * .78), 104px) !important; }
  .hand-card { transform: translateY(6px) rotate(calc(var(--i) * 3deg)); }
  .active-zone { padding: 2px 20px; }
  .match-side { gap: 8px; padding: 10px; }
  .turn-box, .energy-box { padding: 8px 10px; }
  .energy-orb { width: 44px; height: 44px; }
  .energy-orb .ti { width: 32px !important; height: 32px !important; }
  .atk-btn { padding: 7px 10px; }
  .side-actions .btn-end { height: 40px; }
  .match-side > .side-actions { top: -10px; bottom: -10px; margin: 0 -10px; padding: 6px 10px; }
}

/* Marie Maths: equation dialog + confusion status */
.st-conf { background: #3fa9c9; }
.quiz-overlay { position: fixed; inset: 0; z-index: 420; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 9, .78); animation: fadeIn .15s; }
.quiz-box { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 26px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.quiz-q { color: var(--muted); font-size: 14px; }
.quiz-eq { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quiz-in { width: 160px; text-align: center; font-size: 22px; }
.quiz-box .row { display: flex; gap: 10px; }
@media (max-width: 420px) { .quiz-eq { font-size: 24px; } }

/* Coin flip (coin_bonus / gamble_ko) */
.coin-flip { position: absolute; z-index: 46; left: calc(50% - 135px); top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; transition: opacity .25s; }
.coin-flip.out { opacity: 0; }
.coin-flip-title { font-family: var(--display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .08em; color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); }
.coin-flip .coin { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: #d9a93a; border: 5px solid #9a6f14; color: #3d2a04; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .06em; box-shadow: 0 8px 20px rgba(0, 0, 0, .55); animation: coinSpin .85s cubic-bezier(.3, .7, .4, 1); }
.coin-flip .coin.tails { background: #c3c7cf; border-color: #737882; color: #23262c; }
.coin-flip .coin.heads, .coin-flip .coin.tails { animation: coinLand .25s ease-out; }
.coin-txt { min-height: 28px; font-family: var(--display); font-weight: 800; font-size: 24px; color: #fff3c4; text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); white-space: nowrap; }
@keyframes coinSpin { 0% { transform: translateY(50px) rotateX(0) scale(.5); } 55% { transform: translateY(-40px) rotateX(1800deg) scale(1.1); } 100% { transform: rotateX(2520deg); } }
@keyframes coinLand { 0% { transform: scale(1.18); } 100% { transform: none; } }
