/* The Arena (practice games against the computer), its board, and the Learn
   to Play guide with its guide video. */

/* ------------------------------------------------------------ the pages */
.ar-hero { padding: clamp(24px, 5vw, 56px) 0 18px; max-width: 860px; }
.ar-hero h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 64px); line-height: 1.05; margin: 6px 0 14px; }
.ar-hero h1 span { background: linear-gradient(100deg, var(--accent), #ff7a8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ar-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ar-body { display: grid; gap: 22px; padding-bottom: 60px; }
.ar-panel { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: clamp(16px, 3vw, 28px); backdrop-filter: blur(10px); }
.ar-panel h2 { font-family: var(--display); font-size: clamp(19px, 2.4vw, 24px); margin: 0 0 14px; }
.ar-note { margin: 12px 0 0; }
.ar-lede { margin: 0 0 14px; max-width: 70ch; }

.ar-ranks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ar-rank { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); color: var(--ink); font: inherit; cursor: pointer; position: relative; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s; }
.ar-rank b { font-family: var(--display); font-size: 18px; line-height: 1; }
.ar-rank span { font-size: 13px; font-weight: 700; }
.ar-rank i { font-style: normal; font-size: 13px; opacity: 0.85; }
.ar-rank:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); }
.ar-rank.is-beaten { background: color-mix(in srgb, #3ccf7a 16%, transparent); border-color: color-mix(in srgb, #3ccf7a 45%, transparent); }
.ar-rank.is-next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ar-rank.is-locked { opacity: 0.45; cursor: not-allowed; }
.ar-rank.is-picked { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
@media (max-width: 560px) { .ar-ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ar-rank { grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; gap: 8px; padding: 9px 12px; } }

.ar-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--edge); margin-bottom: 16px; flex-wrap: wrap; }
.ar-tabs button { border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.ar-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.ar-pick { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.ar-pick select { max-width: min(100%, 420px); font: inherit; color: var(--ink); background: var(--surface-solid); border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; }
.ar-set { margin: 0 0 6px; }
.ar-warn { color: #ffb4a6; }
.ar-meter { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; max-width: 520px; }
.ar-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff7a8a); border-radius: inherit; }
.ar-groups h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 8px; color: var(--muted); }
.ar-groups h3 small { font-size: 14px; color: var(--ink); margin-left: 6px; letter-spacing: 0; }
.ar-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.ar-tile { position: relative; }
.ar-tile-card { display: block; width: 100%; padding: 0; border: 0; background: rgba(255, 255, 255, 0.06); border-radius: 7px; aspect-ratio: 63 / 88; overflow: hidden; cursor: zoom-in; position: relative; color: var(--ink); font: inherit; font-size: 12px; }
.ar-tile-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-n { position: absolute; left: 4px; bottom: 4px; background: rgba(10, 8, 24, 0.85); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 999px; }
.ar-swap { position: absolute; top: -6px; right: -6px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--edge); background: var(--surface-solid); color: #7dffb0; font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-soft); transition: transform 0.25s var(--ease); }
.ar-swap:hover { transform: rotate(-120deg) scale(1.1); }
.ar-energy { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.ar-energy li { position: relative; }
.ar-e { display: inline-block; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, var(--e) 30%, transparent); border: 1px solid var(--e); font-weight: 700; }
.ar-go { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.btn-big { font-size: 18px; padding: 13px 26px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ar-game.is-soon { opacity: 0.6; }
.ar-dialog { border: 0; padding: 0; background: none; max-width: min(900px, 94vw); color: var(--ink); }
.ar-dialog::backdrop { background: rgba(5, 3, 15, 0.7); backdrop-filter: blur(4px); }
.ar-dialog .ab-view { background: var(--surface-solid); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 18px; position: relative; }
.ar-dialog form { position: absolute; top: 10px; right: 10px; margin: 0; }

/* ------------------------------------------------------------ the board */
html.ab-open, html.ab-open body { overflow: hidden; }
.ab-stage { position: fixed; inset: 0; z-index: 900; background: radial-gradient(120% 70% at 50% 0%, #2b1f5c 0%, #120d2a 55%, #07060f 100%); color: var(--ink); display: flex; justify-content: center; overflow: auto; overscroll-behavior: contain; }
.ab-stage::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(40% 25% at 50% 52%, rgba(246, 183, 60, 0.12), transparent 70%), repeating-linear-gradient(0deg, transparent 0 46px, rgba(255, 255, 255, 0.025) 46px 47px); }
.ab-board { --bw: min(17vw, calc(10vh * 0.716), 104px); --aw: min(26vw, calc(14vh * 0.716), 150px); --hw: min(17vw, calc(10vh * 0.716), 96px); position: relative; width: min(980px, 100%); min-height: 100%; display: flex; flex-direction: column; gap: 4px; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); }
.ab-board > * { flex: none; }
.ab-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ab-title { font-size: 14px; color: var(--muted); text-align: center; }
.ab-title b { color: var(--ink); }
.ab-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.06); color: var(--ink); font-size: 16px; cursor: pointer; flex: none; }
.ab-side { display: grid; gap: 5px; padding: 6px 8px; border-radius: 18px; border: 1px solid transparent; transition: border-color 0.3s, background 0.3s; }
.ab-side.is-turn { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: rgba(246, 183, 60, 0.05); }
.ab-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.ab-meta strong { color: var(--ink); font-size: 15px; }
.ab-prizes { display: inline-flex; align-items: center; gap: 2px; }
.ab-prizes i { width: 9px; height: 13px; border-radius: 2px; background: var(--card-back, linear-gradient(135deg, #2a62c9, #173a80)); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset; }
.ab-prizes b { margin-left: 4px; color: var(--ink); }
.ab-bench { display: grid; grid-template-columns: repeat(5, var(--bw)); justify-content: center; gap: clamp(4px, 1.4vw, 10px); }
.ab-act-row { display: flex; justify-content: center; }
.ab-slot { position: relative; padding: 0; border: 0; border-radius: 6px; aspect-ratio: 63 / 88; background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset; cursor: pointer; color: var(--ink); font: inherit; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.ab-slot.is-empty { cursor: default; box-shadow: 0 0 0 1px dashed rgba(255, 255, 255, 0.1) inset; border: 1px dashed rgba(255, 255, 255, 0.12); background: none; }
.ab-slot.is-active { width: var(--aw); }
.ab-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.ab-slot.is-target { box-shadow: 0 0 0 3px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent); animation: ab-pulse 1.1s ease-in-out infinite; }
@keyframes ab-pulse { 50% { transform: translateY(-3px) scale(1.03); } }
.ab-hp { position: absolute; left: 4%; right: 4%; bottom: 4%; height: 15px; border-radius: 999px; background: rgba(5, 4, 12, 0.82); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ab-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #36c46f, #8ee36b); transition: width 0.5s var(--ease); }
.ab-hp.is-low i { background: linear-gradient(90deg, #ff4b4b, #ff9a3c); }
.ab-hp b { position: relative; font-size: 11px; line-height: 1; text-shadow: 0 1px 2px #000; }
.ab-en { position: absolute; left: 2px; top: 30%; display: flex; flex-direction: column; gap: 1px; }
.ab-pip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--e); color: #fff; font-size: 9px; font-style: normal; font-weight: 800; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75), 0 1px 3px rgba(0, 0, 0, 0.5); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); vertical-align: middle; }
.ab-slot:not(.is-active) .ab-pip { width: 13px; height: 13px; font-size: 7px; }
.ab-cond { position: absolute; right: 3px; top: 3px; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.ab-cond i { font-style: normal; filter: drop-shadow(0 1px 2px #000); }
.ab-stage-n { position: absolute; right: 4px; top: 40%; font-size: 9px; color: var(--accent); text-shadow: 0 1px 2px #000; }
.ab-burst { position: absolute; left: 50%; top: 35%; transform: translate(-50%, 0); font-family: var(--display); font-weight: 800; font-size: clamp(18px, 4vw, 28px); pointer-events: none; animation: ab-burst 1.1s var(--ease) forwards; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.6); }
.ab-burst.is-damage { color: #ff6a5a; }
.ab-burst.is-heal { color: #7dffb0; }
@keyframes ab-burst { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
.ab-slot.is-hit { animation: ab-hit 0.45s ease; }
@keyframes ab-hit { 20% { transform: translateX(-6px) rotate(-2deg); filter: brightness(1.8); } 45% { transform: translateX(5px) rotate(1deg); } 70% { transform: translateX(-3px); } }
.ab-stage.is-shake .ab-board { animation: ab-shake 0.4s ease; }
@keyframes ab-shake { 25% { transform: translateY(3px); } 50% { transform: translateY(-3px); } 75% { transform: translateY(2px); } }
.ab-feed { min-height: 54px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 2px; padding: 4px 8px; }
.ab-feed p { margin: 0; font-size: 13px; color: var(--muted); }
.ab-feed p.is-new { font-size: 16px; font-weight: 700; color: var(--ink); animation: ab-in 0.35s var(--ease); }
@keyframes ab-in { from { opacity: 0; transform: translateY(6px); } }
.ab-hint { margin: 0; text-align: center; font-size: 13px; line-height: 1.35; color: var(--muted); }
.ab-link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.ab-hand { display: flex; gap: 8px; overflow-x: auto; padding: 8px 4px 4px; scroll-snap-type: x proximity; justify-content: safe center; }
.ab-card { flex: none; width: var(--hw); aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.05); cursor: pointer; scroll-snap-align: center; transition: transform 0.2s var(--ease), box-shadow 0.2s; opacity: 0.6; }
.ab-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.ab-card.can-play { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 80%, transparent), 0 6px 16px rgba(0, 0, 0, 0.4); }
.ab-card:hover { transform: translateY(-6px); }
.ab-acts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.ab-acts .btn { padding: 10px 16px; }
.ab-energy-card { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; border-radius: 6px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--e) 85%, #fff) 0 22%, var(--e) 23% 30%, color-mix(in srgb, var(--e) 40%, #120d2a) 31%); color: #fff; text-align: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) inset; }
.ab-energy-card b { font-family: var(--display); font-size: clamp(16px, 4vw, 26px); text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); }
.ab-energy-card small { font-size: 10px; font-weight: 700; padding: 0 4px; line-height: 1.1; }

.ab-pop { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; padding: 14px; background: rgba(5, 3, 15, 0.6); backdrop-filter: blur(3px); }
.ab-pop[hidden] { display: none; }
.ab-pop-in { position: relative; width: min(760px, 100%); max-height: calc(100vh - 28px); overflow: auto; background: var(--surface-solid); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); animation: ab-in 0.25s var(--ease); }
.ab-pop-x { position: absolute; top: 10px; right: 10px; }
.ab-view { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 18px; align-items: start; }
.ab-big { aspect-ratio: 63 / 88; border-radius: 10px; overflow: hidden; }
.ab-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ab-info h3 { margin: 0 34px 6px 0; font-family: var(--display); font-size: 20px; }
.ab-info p { margin: 6px 0; }
.ab-stats { color: var(--muted); }
.ab-attacks { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.ab-attacks li { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.ab-attacks small { display: block; color: var(--muted); margin-top: 3px; }
.ab-dmg { font-family: var(--display); font-weight: 800; float: right; }
.ab-cost em { font-size: 12px; color: var(--muted); }
.ab-off { color: #ffbf8a; font-style: italic; font-size: 13px; }
.ab-wr { font-size: 13px; color: var(--muted); }
.ab-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ab-choices .btn { justify-content: center; text-align: center; }
@media (max-width: 600px) { .ab-view { grid-template-columns: 1fr; } .ab-big { width: min(220px, 60vw); margin: 0 auto; } }
.ab-end { text-align: center; padding: 10px 4px; }
.ab-end-big { font-family: var(--display); font-size: clamp(28px, 6vw, 44px); margin: 0 0 6px; }
.ab-end.is-win .ab-end-big { background: linear-gradient(100deg, var(--accent), #ff7a8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ab-unlock { font-size: 18px; margin: 14px 0 4px; }
.ab-end .ab-choices { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.ab-help ol { padding-left: 20px; display: grid; gap: 8px; }
@media (max-height: 700px) { .ab-feed { min-height: 40px; } .ab-feed p:not(.is-new) { display: none; } .ab-hint { font-size: 12px; line-height: 1.25; } .ab-hand { padding-top: 4px; } }

/* ------------------------------------------------------------ Learn to play */
.learn-page { padding-bottom: 60px; }
.lp-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.lp-toc a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.lp-toc a:hover { border-color: var(--accent); }
.lp-sec { margin: 54px 0; }
.lp-sec > p { max-width: 75ch; }
.lp-anatomy { display: grid; grid-template-columns: minmax(200px, 330px) 1fr; gap: 26px; align-items: start; margin: 20px 0; }
.lp-anat-card { position: relative; border-radius: 12px; overflow: visible; }
.lp-anat-card img { width: 100%; display: block; border-radius: 12px; box-shadow: var(--shadow); }
.lp-dot { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 800; display: grid; place-items: center; font-size: 14px; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.5); }
.lp-callouts { margin: 0; padding-left: 24px; display: grid; gap: 10px; }
.lp-callouts li::marker { font-weight: 800; color: var(--accent); }
@media (max-width: 700px) { .lp-anatomy { grid-template-columns: 1fr; } .lp-anat-card { max-width: 300px; margin: 0 auto; } }
.lp-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.lp-kind { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--edge); align-items: start; }
.lp-kind img { width: 100%; border-radius: 6px; display: block; }
.lp-kind-ico { font-size: 40px; text-align: center; padding-top: 10px; }
.lp-kind h3 { margin: 0 0 6px; }
.lp-kind p { margin: 0; font-size: 15px; }
.lp-conds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lp-conds > div { padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--edge); }
.lp-conds p { margin: 6px 0 0; font-size: 15px; }
.lp-recipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lp-recipe > div { padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--edge); }
.lp-recipe b { font-family: var(--display); font-size: 30px; color: var(--accent); display: block; }
.lp-recipe span { font-weight: 700; }
.lp-recipe p { margin: 8px 0 0; font-size: 15px; }
.lp-list, .lp-ready { display: grid; gap: 8px; max-width: 78ch; }
.lp-chase { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.lp-chase li { display: grid; gap: 4px; align-content: start; }
.lp-chase img { width: 100%; border-radius: 9px; box-shadow: var(--shadow-soft); transition: transform 0.35s var(--ease); }
.lp-chase li:hover img { transform: translateY(-4px) rotate(-1deg); }
.lp-chase span { font-size: 13px; color: var(--muted); }
.lp-chase p { margin: 2px 0 0; font-size: 14px; }

/* ------------------------------------------------------------ the guide video */
.lp-video { margin: 10px 0 30px; }
.gv { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #07060f; border: 1px solid var(--edge); box-shadow: var(--shadow); }
.gv-screen { position: relative; aspect-ratio: 16 / 9; }
.gv canvas { width: 100%; height: 100%; display: block; }
.gv-cc[hidden] { display: none; }
.gv-cc { margin: 0; min-height: calc(2 * 1.35em + 16px); display: flex; align-items: center; justify-content: center; text-align: center; font-size: clamp(14px, 1.9vw, 19px); line-height: 1.35; padding: 8px 16px; background: #07060f; color: #fff; }
.gv-big { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 32px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.gv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; background: rgba(255, 255, 255, 0.04); }
.gv-bar button { border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.06); color: var(--ink); font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.gv-bar button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.gv-track { flex: 1 1 200px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); position: relative; cursor: pointer; }
.gv-track i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; }
.gv-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gv-chapters { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 12px; }
.gv-chapters button { flex: none; border: 1px solid var(--edge); background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.gv-chapters button.is-on { color: var(--ink); border-color: var(--accent); }
.ar-game .pp-acts .btn-ghost { color: var(--ink); text-shadow: none; }
