/* 萌獸競技場 styles, all scoped under .ca-root so the WordPress theme is untouched. */
/* Layout: tabbed lobby (萌獸 / 強化 / 對戰); creature cards are collectible tiles with a dark art window; fights take over the screen */
.ca-root {
  --bg: #EDF2EF;
  --surface: #FFFFFF;
  --sunk: #E2EAE6;
  --ink: #1B2530;
  --muted: #5A6772;
  --line: #D0DBD6;
  --accent: #C2401E; /* white on it 5.2:1, it on the page 4.6:1 */
  --accent-ink: #FFFFFF;
  --gold: #C98A0C;
  --gold-soft: #FFF1CF;
  --good: #1F8A62;
  --bad: #C94040;
  --card: #1A2229;
  --card-ink: #EEF3F6;
  --arena-bg: #1E2B33;
  --arena-ink: #F2F6F8;
  --f-display: "Baloo 2", "Noto Sans TC", system-ui, sans-serif;
  --f-body: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  .ca-root {
    --bg: #12181D; --surface: #1B232A; --sunk: #232D35; --ink: #E7EDF1; --muted: #9AA8B3;
    --line: #2D3942; --accent: #FF7552; --accent-ink: #1A0E0A; --gold: #F0B53A; --gold-soft: #3A2E14;
    --good: #45C08F; --bad: #F07070; --card: #151C22; color-scheme: dark;
  }
}
.ca-root, .ca-root * { box-sizing: border-box; }
.ca-root [hidden] { display: none !important; }
.ca-root {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 40px;
  min-height: calc(100vh - var(--ca-top, 0px)); min-height: calc(100dvh - var(--ca-top, 0px)); /* down to the bottom of the window */
}
.ca-root button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; margin: 0; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; line-height: inherit; }
.ca-root button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ca-root ::selection { background: var(--accent); color: var(--accent-ink); }
.ca-root input { caret-color: var(--accent); accent-color: var(--accent); }
.ca-root, .ca-root * { scrollbar-color: var(--line) transparent; }
.ca-root a { text-underline-offset: 3px; }
/* one switch for everyone who asks the system for less motion: no animation or transition runs longer than a blink */
@media (prefers-reduced-motion: reduce) { .ca-root *, .ca-root *::before, .ca-root *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.ca-root .ca-app { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.ca-root .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ca-root .brand { display: flex; align-items: center; gap: 10px; }
.ca-root .brand canvas { width: 64px; height: 54px; }
.ca-root .brand h2 { margin: 0; font-weight: 900; font-size: 1.6rem; letter-spacing: .02em; text-wrap: balance; }
.ca-root .brand small { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.ca-root .meters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ca-root .logout { text-decoration: none; padding: 6px 14px; }
.ca-root .board-mode { margin-bottom: 10px; }
.ca-root .meter { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.ca-root .meter .lbl { color: var(--muted); font-size: .8rem; letter-spacing: .06em; }
.ca-root .meter b { font-family: var(--f-display); font-size: 1.15rem; }
.ca-root .meter .max { color: var(--muted); font-size: .85rem; }
.ca-root .meter.stam b { color: var(--accent); }
.ca-root .gate { max-width: 560px; padding-block: 22px; }
.ca-root .gate h3 { font-size: 1.25rem; }
.ca-root .note { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; font-size: .88rem; }

.ca-root .tabs { display: flex; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; }
.ca-root .tabs button { border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.ca-root .tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ca-root .tabs button { white-space: nowrap; }
@media (max-width: 560px) { .ca-root .tabs { width: auto; } .ca-root .tabs button { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: .86rem; } }

.ca-root .lead { color: var(--muted); margin: 0 0 12px; max-width: 68ch; }
.ca-root .grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.ca-root .cc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ca-root .cc.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
/* 我的萌獸: creatures on display pedestals; the opened one becomes the full card across the whole row */
.ca-root #stableGrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: start; }
/* the details float over the page: the usual card size, scrolls inside when tall */
.ca-root .cc-pop { position: fixed; inset: 0; z-index: 60; background: rgba(8,12,16,.62); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ca-pop-in .16s ease-out; }
.ca-root .cc-pop .cc { width: min(380px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: 0 18px 48px rgba(0,0,0,.5); }
@keyframes ca-pop-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ca-root .cc-pop { animation: none; } }
html.ca-pop-open body { overflow: hidden; }
.ca-root .close-cc { margin-left: auto; padding: 4px 12px; }
.ca-root .idline { display: flex; align-items: center; gap: 8px; }
.ca-root .stand { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 4px 4px 10px; border-radius: 16px; transition: transform .15s, background .15s; outline: none; }
.ca-root .stand:hover, .ca-root .stand:focus-visible { background: rgba(255,255,255,.04); transform: translateY(-3px); }
.ca-root .stand:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ca-root .stand canvas.pv { width: 126%; margin-left: -13%; margin-right: -13%; aspect-ratio: 380 / 260; position: relative; z-index: 2; margin-bottom: -30px; cursor: grab; } /* wider than its slot: room for tails, the creature itself the same size */ /* in front of the pedestal, feet on its top */
.ca-root .pedestal { position: relative; width: 54%; height: 40px; }
.ca-root .pedestal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 22px; border-radius: 50%; z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, #6B7782 0%, #4A545D 60%, #3A424A 100%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 2px #8A949E; }
.ca-root .pedestal::after { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 24px; border-radius: 0 0 50% 50% / 0 0 34% 34%;
  background: linear-gradient(90deg, #2E353C, #49525A 45%, #2E353C); box-shadow: 0 10px 18px -8px rgba(0,0,0,.6); }
.ca-root .stand.active .pedestal::before { background: radial-gradient(ellipse at 50% 40%, #FFE9A0 0%, #F2C230 55%, #B8861A 100%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 2px #FFE07A, 0 0 22px 4px rgba(255,200,60,.45); }
.ca-root .stand.active .pedestal::after { background: linear-gradient(90deg, #8A6414, #C9982A 45%, #8A6414); }
/* locked: a blue pedestal */
.ca-root .stand.locked .pedestal::before { background: radial-gradient(ellipse at 50% 40%, #B8DCFF 0%, #4A90D9 55%, #2A5E9A 100%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 0 0 2px #8FC4FF, 0 0 18px 3px rgba(80,150,255,.35); }
.ca-root .stand.locked .pedestal::after { background: linear-gradient(90deg, #1E4170, #3A6FAE 45%, #1E4170); }
.ca-root .stand-name { margin-top: 4px; font-size: 1rem; font-weight: 800; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-root .stand-badge { margin-top: 3px; font-size: .72rem; font-weight: 800; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.ca-root #stableGrid .cc.empty { min-height: 170px; align-self: stretch; } /* as tall as the pedestals beside it */
.ca-root #stableGrid .egg-card { grid-column: span 2; align-self: stretch; padding: 12px 14px; justify-content: flex-start; } /* room for the item names on one line */
@media (max-width: 640px) {
  .ca-root #stableGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ca-root .stand canvas.pv { margin-bottom: -24px; }
  .ca-root .pedestal { height: 32px; }
  .ca-root .pedestal::before { height: 18px; } .ca-root .pedestal::after { top: 9px; height: 19px; }
}
.ca-root .art { position: relative; background: var(--card); }
.ca-root .art canvas { display: block; width: 100%; height: 190px; }
.ca-root .power { position: absolute; top: 10px; left: 10px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1.1rem; color: var(--card-ink); background: radial-gradient(circle, #1A2229 58%, transparent 60%), conic-gradient(#F2A33A calc(var(--pw, .5) * 360deg), rgba(255,255,255,.15) 0); }
.ca-root .badges { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ca-root .badge { font-size: .72rem; font-weight: 700; color: var(--card-ink); background: rgba(255,255,255,.12); border-radius: 999px; padding: 1px 9px; font-variant-numeric: tabular-nums; }
.ca-root .badge.on { background: var(--accent); color: var(--accent-ink); }
/* rare body (晶體): an icy badge with a slow shine passing over it */
.ca-root .badge.rare { color: #06243D; background: linear-gradient(110deg, #8FDCFF 0%, #DDF6FF 45%, #FFFFFF 50%, #DDF6FF 55%, #6FB8FF 100%); background-size: 250% 100%; box-shadow: 0 0 10px rgba(110, 200, 255, .7); animation: ca-shine 2.6s linear infinite; }
.ca-root .badge.rare.gold { color: #3D2600; background: linear-gradient(110deg, #E8A812 0%, #FFE58A 45%, #FFFBE6 50%, #FFE58A 55%, #D99A0E 100%); background-size: 250% 100%; box-shadow: 0 0 10px rgba(255, 196, 60, .7); } /* 黃金 */
.ca-root .badge.rare.lava { color: #FFE8D6; background: linear-gradient(110deg, #3A1A12 0%, #C2401E 45%, #FF9A4A 50%, #C2401E 55%, #3A1A12 100%); background-size: 250% 100%; box-shadow: 0 0 10px rgba(255, 90, 30, .7); } /* 熔岩黑曜石 */
@keyframes ca-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .ca-root .badge.rare { animation: none; } }
.ca-root .cc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ca-root .idline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ca-root .idchip { font-family: var(--f-display); font-weight: 800; font-size: .8rem; border-radius: 999px; padding: 1px 10px; background: var(--sunk); font-variant-numeric: tabular-nums; }
.ca-root .idchip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.ca-root .cc-body h3 { margin: 0; font-size: 1.2rem; font-weight: 900; }
.ca-root .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.ca-root .stats div { background: var(--sunk); border-radius: 8px; padding: 4px 6px; text-align: center; }
.ca-root .stats dt { font-size: .72rem; color: var(--muted); letter-spacing: .06em; }
.ca-root .stats dd { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ca-root .parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .86rem; }
.ca-root .parts li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; }
.ca-root .parts .sub { grid-column: 2; color: var(--muted); font-size: .8rem; }
.ca-root .k { font-family: var(--f-display); font-weight: 800; font-size: .8rem; min-width: 26px; text-align: center; border-radius: 6px; background: var(--ink); color: var(--bg); padding: 0 6px; }
.ca-root .k.pas { background: var(--gold); color: #3A2A08; }
.ca-root .row { display: flex; gap: 8px; flex-wrap: wrap; }
.ca-root .btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.ca-root .btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
/* 放生: the same width in both states, so confirming never moves the button */
.ca-root .cc-body .row { flex-wrap: nowrap; gap: 6px; }
.ca-root .cc-body .row .btn { padding: 8px 11px; white-space: nowrap; flex: 0 1 auto; }
.ca-root .btn.release { min-width: 5.6em; justify-content: center; text-align: center; }
.ca-root .release-note { margin: 6px 0 0; font-size: .8rem; font-weight: 700; color: var(--bad); }
.ca-root .btn.warn { background: var(--bad); color: #fff; }
.ca-root .btn:disabled { opacity: .45; cursor: not-allowed; }
.ca-root .btn.big { padding: 12px 22px; font-size: 1.05rem; }
.ca-root .cc.empty { border-style: dashed; align-items: center; justify-content: center; min-height: 300px; color: var(--muted); background: transparent; font-weight: 700; gap: 4px; }
.ca-root .cc.empty span { font-size: 2.2rem; line-height: 1; }
/* 挑戰模式 */
.ca-root .panel.challenge { margin-bottom: 14px; border: 1px solid #8A2A10; background: linear-gradient(160deg, rgba(255,90,30,.10), transparent 60%), var(--surface); }
.ca-root .ch-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ca-root .ch-card + .ch-card { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ca-root .ch-boss { flex: 0 0 220px; display: flex; flex-direction: column; align-items: center; }
.ca-root .ch-boss canvas { width: 240px; aspect-ratio: 260 / 190; margin-bottom: -26px; position: relative; z-index: 2; }
.ca-root .ch-boss .pedestal { width: 58%; height: 36px; }
.ca-root .stand.lava .pedestal::before, .ca-root .pedestal.lava::before { background: radial-gradient(ellipse at 50% 40%, #FFB060 0%, #E2501A 50%, #5A1A0A 100%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.3), 0 0 0 2px #FF8A3A, 0 0 22px 4px rgba(255,90,30,.5); }
.ca-root .stand.lava .pedestal::after, .ca-root .pedestal.lava::after { background: linear-gradient(90deg, #1E1416, #3A2622 45%, #1E1416); }
.ca-root .ch-info { flex: 1 1 280px; min-width: 0; }
.ca-root .ch-title { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; }
.ca-root .ch-info ul { margin: 6px 0 10px; padding-left: 1.2em; }
.ca-root .ch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ca-root .ch-left { font-weight: 700; }
.ca-root .ch-left.spent { color: var(--muted); }
.ca-root .ch-ticket { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; }
@media (max-width: 640px) { .ca-root .ch-boss { flex-basis: 100%; } }
.ca-root .ai-level { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.ca-root .ai-level .lbl { font-weight: 700; }
.ca-root .cc.empty.spent { opacity: .55; cursor: not-allowed; }

.ca-root .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ca-root .chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.ca-root .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ca-root .forge { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* 進化石強化: the creature in a glass capsule in the middle, three part frames on each side, a line from each part to its frame */
.ca-root .forge-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) minmax(0, 1fr); gap: 10px 36px; align-items: center; }
.ca-root .pcol { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ca-root .capsule { position: relative; z-index: 1; height: 340px; display: flex; flex-direction: column; align-items: stretch; }
.ca-root .capsule .cap { position: relative; z-index: 2; height: 30px; margin: 0 -6px; border-radius: 16px; background: linear-gradient(180deg, #C9D3DC 0%, #8C9AA8 45%, #5E6C7A 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.25); }
.ca-root .capsule .cap::after { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: rgba(0,0,0,.18); }
.ca-root .capsule .cap.top { margin-bottom: -6px; } .ca-root .capsule .cap.bottom { margin-top: -6px; }
.ca-root .capsule .glass { position: relative; flex: 1; border-radius: 22px; overflow: hidden; border: 2px solid rgba(190,230,255,.75); background: linear-gradient(90deg, rgba(160,215,245,.32) 0%, rgba(255,255,255,.08) 42%, rgba(120,190,235,.3) 100%), radial-gradient(ellipse at 50% 85%, rgba(255,255,255,.35), transparent 60%); }
.ca-root .capsule .glass canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ca-root .capsule .glass::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: 12px; width: 12px; border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.12)); pointer-events: none; } /* the glass's reflection, in front of the creature */
.ca-root .links { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ca-root .links path { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .8; transition: stroke-width .12s, opacity .12s; }
.ca-root .links circle { fill: var(--gold); stroke: #fff; stroke-width: 1.5; }
.ca-root .links circle.end { stroke: none; }
.ca-root .links .on, .ca-root .links .glow { opacity: 1; stroke-dasharray: none; stroke-width: 3; }
.ca-root .links circle.on, .ca-root .links circle.glow { r: 6; }
.ca-root .links .glow { animation: ca-link-glow 1.4s ease-out; }
@keyframes ca-link-glow { 0% { stroke: #FFE07A; filter: drop-shadow(0 0 6px #FFD95A); } 100% { filter: none; } }
.ca-root .ptile { display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "pic head" "pic what" "pic pips" "bonus bonus"; gap: 2px 8px; align-items: center; min-width: 0; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 2px dashed var(--line); border-radius: 12px; padding: 6px 8px; cursor: default; transition: transform .12s, border-color .12s, box-shadow .12s; }
.ca-root .ptile canvas { grid-area: pic; width: 60px; height: 60px; display: block; border-radius: 8px; background: var(--sunk); }
.ca-root .ptile-head { grid-area: head; display: flex; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.ca-root .ptile-head .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-root .ptile .what { grid-area: what; color: var(--muted); font-size: .76rem; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-root .ptile .pips { grid-area: pips; }
.ca-root .forge-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.ca-root .forge-top .chips { margin: 0; }
.ca-root .ptile .desc { grid-area: desc; display: none; font-size: .74rem; line-height: 1.4; color: var(--ink); background: var(--sunk); border-radius: 8px; padding: 4px 6px; margin-top: 2px; }
.ca-root .show-desc .ptile { grid-template-areas: "pic head" "pic what" "pic pips" "bonus bonus" "desc desc"; }
.ca-root .show-desc .ptile .desc { display: block; }
.ca-root .ctl-aim { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ca-root .ctl-aim .nm { font-weight: 700; }
.ca-root .sfx-vol { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); margin: 0; }
/* volume sliders drawn by the game itself, so a WordPress theme's input styles (white boxes, padding, borders) can't reach them */
.ca-root input[type="range"] { -webkit-appearance: none; appearance: none; width: 160px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
.ca-root input[type="range"]:focus { outline: none; box-shadow: none; background: transparent; border: 0; }
.ca-root input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
.ca-root input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }
.ca-root input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.ca-root input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }
.ca-root input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.ca-root input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
@media (max-width: 520px) { .ca-root input[type="range"] { width: 120px; } }
.ca-root .ctl-aim .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.ca-root .ptile .bonus { grid-area: bonus; color: var(--muted); font-size: .74rem; line-height: 1.3; margin-top: 2px; }
.ca-root .ptile[data-full="1"] { opacity: .55; }
.ca-root .ptile:has(.evo-tag)[data-full="1"] { opacity: 1; } /* an evolved part is finished, not greyed out */
.ca-root .evo-tag { flex: none; font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold); }
.ca-root .forge.dragging .ptile[data-full="0"], .ca-root .forge.holding .ptile[data-full="0"] { border-color: var(--accent); }
.ca-root .ptile[data-over="ok"] { border-style: solid; border-color: var(--accent); transform: scale(1.04); box-shadow: 0 0 0 3px #FFD95A, 0 0 18px rgba(255,217,90,.7); }
.ca-root .ptile[data-over="no"] { border-style: solid; border-color: var(--bad); }
.ca-root .ptile.sel { border-style: solid; border-color: #F2C230; box-shadow: 0 0 0 2px rgba(242,194,48,.55); } /* picked for double-click enhancing */
.ca-root .ptile.flash { animation: ca-row-glow 1.2s ease-out; }
@media (max-width: 640px) {
  .ca-root .forge-stage { grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr); gap: 8px 12px; }
  .ca-root .capsule { height: 250px; } .ca-root .capsule .cap { height: 22px; }
  .ca-root .pcol { gap: 8px; }
  .ca-root .ptile { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "head" "pips"; justify-items: center; text-align: center; padding: 4px; gap: 2px; }
  .ca-root .ptile canvas { width: 46px; height: 46px; }
  .ca-root .ptile .what, .ca-root .ptile .bonus, .ca-root .ptile-head .k { display: none; }
  .ca-root .show-desc .ptile { grid-template-areas: "pic" "head" "pips" "desc"; }
  .ca-root .ptile .desc { font-size: .68rem; text-align: left; }
  .ca-root .ptile-head { font-size: .74rem; max-width: 100%; }
  .ca-root .pip { width: 9px; height: 9px; }
}
.ca-root .apply-line { min-height: 2.6em; }
/* stones can be dragged: no text selection or long-press menu while holding one */
.ca-root .scroll { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; transition: transform .25s, opacity .15s; }
.ca-root .scroll[data-empty="1"] { cursor: default; }
.ca-root .scroll.pressing { transform: scale(.92); }
@media (max-width: 480px) { .ca-root .scroll .bn { display: none; } .ca-root .scroll .ico { width: 34px; height: 31px; } .ca-root .scroll .rate { font-size: 1.05rem; } } /* phones: shorter stones so the parts stay close; a tap still tells the bonus */
.ca-root .scroll.lifted { opacity: .3; }
.ca-root .stone-ghost { position: fixed; left: 0; top: 0; z-index: 100000; width: 84px; height: 77px; margin: -38px 0 0 -42px; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.ca-root .stone-ghost.touch { margin-top: -96px; } /* above the finger, so it stays visible */
.ca-root .stone-ghost svg { width: 100%; height: 100%; display: block; }
.ca-root .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ca-root .panel h3 { margin: 0; font-size: 1rem; font-weight: 900; }
.ca-root .pips { display: flex; gap: 4px; }
.ca-root .pip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.ca-root .pip.s { background: var(--good); border-color: var(--good); }
.ca-root .pip.f { background: var(--bad); border-color: var(--bad); opacity: .7; }
.ca-root .scrolls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 640px) { .ca-root .scrolls { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ca-root .scroll { border: 2px solid var(--line); background: var(--gold-soft); border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; font-variant-numeric: tabular-nums; }
.ca-root .scroll .st { font-size: .75rem; color: var(--muted); font-weight: 700; }
.ca-root .scroll .rate { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.ca-root .scroll .bn { font-size: .72rem; }
.ca-root .scroll .cnt { font-size: .72rem; font-weight: 700; color: var(--gold); }
.ca-root .scroll[data-empty="1"] { opacity: .45; }
/* stone colours by success rate: 70% green, 50% blue, 10% gold */
.ca-root .scroll[data-rate="70"] { background: #E3F6EC; border-color: #9ED8BD; }
.ca-root .scroll[data-rate="50"] { background: #E3EEFB; border-color: #9DBFEA; }
.ca-root .scroll[data-rate="10"] { background: #FFF1CF; border-color: #E8C56A; }
.ca-root .scroll[data-rate] { color: #1B2530; } /* the tiles stay light in dark mode too, so keep the text dark */
.ca-root .scroll[data-rate] .st { color: #4A5560; }
.ca-root .scroll[data-rate] .cnt { color: #8A5A00; }
.ca-root .scroll .ico { width: 44px; height: 40px; display: block; margin-bottom: 2px; }
.ca-root .scroll-ico.r10 { filter: drop-shadow(0 0 4px rgba(242,178,51,.8)); }
.ca-root .ico-inline { width: 30px; height: 25px; vertical-align: middle; margin-right: 4px; }
/* enhancing: the stone shakes, then bursts into light (success) or cracks and crumbles to ash (failure) */
/* enhancing: a 3D gem flies to the part and spins; success sets off golden fireworks, failure crumbles to grey powder */
.ca-root .fx-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }
/* 強化: a soft light behind the gem the moment it reaches the part; it blooms gold on success and shrinks grey on failure */
.ca-root .fx-aura { position: absolute; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.4);
  background: radial-gradient(circle, rgba(255,255,255,.85) 0%, rgba(255,240,190,.55) 30%, rgba(255,214,110,.18) 55%, rgba(255,214,110,0) 70%); transition: opacity .25s, transform .25s; }
.ca-root .fx-aura.on { opacity: 1; transform: scale(1); animation: ca-aura .55s ease-in-out infinite alternate; }
.ca-root .fx-aura.ok { animation: none; transform: scale(1.9); opacity: 0; transition: transform .6s ease-out, opacity .9s ease-in .2s;
  background: radial-gradient(circle, rgba(255,250,220,1) 0%, rgba(255,214,90,.8) 30%, rgba(255,190,40,.3) 55%, rgba(255,190,40,0) 70%); }
.ca-root .fx-aura.ng { animation: none; transform: scale(.5); opacity: 0; transition: transform .5s ease-in, opacity .6s ease-in .15s;
  background: radial-gradient(circle, rgba(200,204,208,.8) 0%, rgba(140,146,152,.45) 35%, rgba(140,146,152,0) 70%); }
@keyframes ca-aura { from { transform: scale(.88); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .ca-root .fx-aura.on { animation: none; } }
.ca-root .fx-gem { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; }
.ca-root .fx-gem canvas, .ca-root .fx-gem svg { width: 100%; height: 100%; display: block; }
.ca-root .fx-gem.charging { filter: drop-shadow(0 0 10px rgba(255,255,255,.55)); animation: ca-gem-pulse .7s ease-in-out infinite alternate; }
.ca-root .fx-gem.r10.charging { filter: drop-shadow(0 0 16px rgba(255,214,90,.9)); }
.ca-root .fx-gem.ok { filter: drop-shadow(0 0 22px #FFE07A); }
.ca-root .fx-particles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@keyframes ca-gem-pulse { from { filter: drop-shadow(0 0 6px rgba(255,255,255,.35)); } to { filter: drop-shadow(0 0 16px rgba(255,255,255,.85)); } }
@keyframes ca-shake { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes ca-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1.15); } }
@keyframes ca-rays { from { transform: scale(.2) rotate(0); opacity: 1; } to { transform: scale(1.1) rotate(60deg); opacity: 0; } }
@keyframes ca-fly { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3); opacity: 0; } }
@keyframes ca-crumble { 0% { transform: none; filter: none; } 25% { transform: translateX(-6px) rotate(-4deg); filter: grayscale(.6) brightness(.8); } 45% { transform: translateX(6px) rotate(4deg); filter: grayscale(1) brightness(.6); } 100% { transform: translateY(60px) rotate(18deg) scale(.7); opacity: 0; filter: grayscale(1) brightness(.4); } }
@keyframes ca-crack-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes ca-smoke { from { transform: translateY(0) scale(.6); opacity: .9; } to { transform: translateY(-70px) scale(2.2); opacity: 0; } }
@keyframes ca-row-glow { 0% { box-shadow: 0 0 0 3px #FFD95A, 0 0 22px #FFD95A; } 100% { box-shadow: none; } }
/* creature names: a pencil to rename */
.ca-root .name-row { display: flex; align-items: center; gap: 6px; }
.ca-root .name-row h3 { margin: 0; }
.ca-root .name-edit { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.ca-root .name-edit svg { width: 16px; height: 16px; display: block; }
.ca-root .btn.lock { display: inline-flex; align-items: center; gap: 6px; }
.ca-root .btn.lock svg { width: 16px; height: 16px; }
.ca-root .btn.lock.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.ca-root .btn:disabled { opacity: .45; cursor: not-allowed; }
.ca-root .name-edit:hover, .ca-root .name-edit:focus-visible { color: var(--ink); background: var(--sunk); }
.ca-root .name-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ca-root .name-form input { font: inherit; font-weight: 800; font-size: 1.1rem; width: 9em; padding: 4px 8px; border: 2px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--ink); }
.ca-root .name-form .hint { font-size: .75rem; color: var(--muted); }
/* match intro: big names and VS */
.ca-root .vs-intro { position: absolute; left: 0; right: 0; top: 16%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 18px; pointer-events: none; animation: ca-vs 2.6s ease-out forwards; }
.ca-root .vs-intro b { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.3rem, 4.5vw, 2.6rem); color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.3); } /* same lettering as the 3-2-1 / 開始！ countdown */
.ca-root .vs-intro i { font-family: var(--f-display); font-style: italic; font-weight: 900; font-size: clamp(1.6rem, 6vw, 3.4rem); color: #FFD95A; -webkit-text-stroke: 1.5px #8A5A00; }
.ca-root .vs-intro small { flex-basis: 100%; text-align: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
@keyframes ca-vs { 0% { opacity: 0; transform: scale(.6); } 14% { opacity: 1; transform: scale(1.06); } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ca-root .fx-layer *, .ca-root .links .glow, .ca-root .ptile.flash, .ca-root .vs-intro { animation: none !important; } }
.ca-root .scroll[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.ca-root .result { min-height: 1.5em; font-weight: 900; font-size: 1.05rem; }
.ca-root .result.s { color: var(--good); }
.ca-root .result.f { color: var(--bad); }
.ca-root .result.roll { color: var(--muted); }
.ca-root .hint { font-size: .82rem; color: var(--muted); margin: 0; }

.ca-root .modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ca-root .mode h3 { font-size: 1.15rem; }
.ca-root .mode ul { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .88rem; }
.ca-root .status { font-size: .9rem; font-weight: 700; min-height: 1.4em; }
.ca-root .online { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ca-root .controls { margin-top: 14px; }
.ca-root .ctl-rows { display: flex; flex-direction: column; gap: 6px; }
.ca-root .ctl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: center; background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.ca-root .ctl-row .nm { font-weight: 700; min-width: 0; }
.ca-root .ctl-row .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.ca-root .keycap { min-width: 72px; font-family: var(--f-display); font-weight: 800; font-size: 1rem; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 9px; background: var(--surface); padding: 3px 12px; }
.ca-root .ctl-emotes { margin-top: 12px; }
.ca-root .ctl-emotes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ca-root .ctl-emotes-head .nm { font-weight: 700; }
.ca-root .ctl-emotes-head .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.ca-root .emote-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ca-root .emote-key { display: flex; align-items: center; gap: 8px; background: var(--sunk); border-radius: 10px; padding: 6px 8px; }
.ca-root .emote-key .lbl { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-root .emote-key canvas { flex: none; }
.ca-root .emote-key .keycap { min-width: 56px; padding: 2px 8px; }
.ca-root .emote-key .keycap.none { color: var(--muted); font-family: var(--f-body); font-size: .8rem; font-weight: 700; }
.ca-root .keycap.listening { border-color: var(--accent); color: var(--accent); font-family: var(--f-body); font-size: .8rem; font-weight: 700; }
/* The switch states every property a WordPress theme tends to set on label / checkbox, so the theme cannot hide or recolour it. */
.ca-root label.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; font-size: .85rem; font-weight: 700; line-height: 1.3; color: var(--ink); cursor: pointer; white-space: nowrap; text-transform: none; letter-spacing: normal; }
.ca-root .switch input[type="checkbox"] { -webkit-appearance: none; appearance: none; display: inline-block; flex: none; position: relative; width: 40px; min-width: 40px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--line); opacity: 1; visibility: visible; clip: auto; clip-path: none; vertical-align: middle; box-shadow: none; cursor: pointer; transition: background .15s; }
.ca-root .switch input[type="checkbox"]::before { content: none; display: none; }
.ca-root .switch input[type="checkbox"]::after { content: ""; display: block; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; margin: 0; border: 0; border-radius: 50%; background: #fff; transform: none; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ca-root .switch input[type="checkbox"]:checked { background: var(--accent); }
.ca-root .switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.ca-root .switch input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .ca-root .ctl-row { grid-template-columns: minmax(0, 1fr) auto; } .ca-root .ctl-row .switch { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .ca-root .switch input, .ca-root .switch input::after { transition: none; } }
.ca-root .readyline { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ca-root .readyline canvas { width: 180px; height: 120px; flex: none; border-radius: 12px; background: var(--card); }

/* Arena overlay: one committed dark stage look in both themes */
.ca-root #arena { position: fixed; inset: 0; z-index: 50; background: var(--arena-bg); color: var(--arena-ink); display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.ca-root .emote-dock { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 6px; }
.ca-root .emote-btn { font: inherit; font-weight: 800; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 2px solid rgba(255,255,255,.8); background: rgba(20,28,36,.6); color: #fff; cursor: pointer; }
.ca-root .emote-panel { background: rgba(20,28,36,.88); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ca-root .emote-list { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.ca-root .emote-pick { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: #fff; cursor: pointer; }
.ca-root .emote-pick:hover, .ca-root .emote-pick:focus-visible { transform: scale(1.1); }
.ca-root .emote-pick[data-emote="danger"] { background: #1A0606; box-shadow: inset 0 0 0 2px rgba(255,60,60,.7); } /* 危 glows red on dark, like its bubble */
.ca-root .emote-mute { color: #fff; font-size: .75rem; display: flex; gap: 4px; align-items: center; }
.ca-root .hud { width: min(100%, 960px); display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.ca-root .hp { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ca-root .hp.foe { text-align: right; }
.ca-root .hp .nm { font-weight: 900; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-root .hp .nm small { font-weight: 500; opacity: .7; margin-left: 4px; }
.ca-root .bar { height: 14px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.ca-root .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#FF8A63, #E04E2C); border-radius: 999px; transition: width .12s; }
.ca-root .hp.foe .bar i { background: linear-gradient(#9DA1FF, #5A5FE0); margin-left: auto; }
.ca-root .hp .num { font-family: var(--f-display); font-size: .85rem; opacity: .85; font-variant-numeric: tabular-nums; }
/* 2v2（甲）：每邊第二條血條，是隊友／第二隻對手 */
.ca-root .hp2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm num" "bar bar"; gap: 1px 6px; align-items: baseline; margin-top: 4px; }
.ca-root .hp.foe .hp2 { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num nm" "bar bar"; }
.ca-root .hp2 .nm { grid-area: nm; } .ca-root .hp2 .bar { grid-area: bar; } .ca-root .hp2 .num { grid-area: num; }
.ca-root .hp2 .nm { font-size: .8rem; font-weight: 800; }
.ca-root .hp2 .bar { height: 9px; }
.ca-root .hp2 .num { font-size: .72rem; }
.ca-root .hp.me .hp2 .bar i { background: linear-gradient(#FFC36B, #E0902C); }
.ca-root .hp2.out { opacity: .45; }
.ca-root .mode-btns { display: flex; gap: 8px; flex-wrap: wrap; }
/* 2v2 好友組隊 */
.ca-root .duo-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ca-root .duo-row input { font: inherit; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; width: 7.5em; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.ca-root .duo-code { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ca-root .duo-code b { font-family: var(--f-display); font-size: 1.4rem; letter-spacing: .2em; color: var(--accent); }
.ca-root .duo-members { margin: 0 0 10px; padding-left: 1.3em; }
.ca-root .duo-members li { font-weight: 700; }
.ca-root .duo-members li.wait { color: var(--muted); font-weight: 500; }
.ca-root .mode-btns .btn { flex: 1 1 8em; }
.ca-root .timer { font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; min-width: 2.4ch; text-align: center; font-variant-numeric: tabular-nums; }
.ca-root .timer-box { display: flex; flex-direction: column; align-items: center; }
.ca-root .ping { font-size: .72rem; font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.ca-root .ping::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--q, #8BE36B); }
.ca-root .stage { position: relative; width: min(100%, 960px, calc((100vh - 230px) * 960 / 680)); aspect-ratio: 960 / 680; max-width: 100%; }
.ca-root .stage canvas { width: 100%; height: 100%; display: block; border-radius: 16px; touch-action: none; }
.ca-root .stage #cv { position: absolute; inset: 0; } /* 2D effects on top of the 3D picture */
.ca-root .stage #cv3d { background: #2E4A57; }
.ca-root .quality-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.ca-root .quality-row .nm { font-weight: 700; }
.ca-root .quality-row .nm small { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: 8px; }
.ca-root .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ca-root .seg button { border: 0; background: transparent; color: inherit; padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; min-height: 36px; }
.ca-root .seg button + button { border-left: 1px solid var(--line); }
.ca-root .seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.ca-root .center-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 8vw, 4.5rem); color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.ca-root .skillbar { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ca-root .sk { position: relative; width: 86px; height: 74px; border-radius: 14px; border: 2px solid rgba(255,255,255,.22); background: linear-gradient(#34495A, #24333E); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; touch-action: manipulation; }
.ca-root .sk b { font-family: var(--f-display); font-size: 1.4rem; line-height: 1; }
.ca-root .sk span { font-size: .72rem; opacity: .9; }
.ca-root .sk i { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.62) calc(var(--p, 0) * 360deg), transparent 0); pointer-events: none; }
.ca-root .sk em { position: absolute; font-style: normal; font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; text-shadow: 0 1px 2px #000; }
.ca-root .sk .chg { position: absolute; top: 3px; left: 4px; padding: 1px 6px; border-radius: 9px; background: #FFC76A; color: #3A2A10; font-size: .7rem; font-weight: 800; text-decoration: none; line-height: 1.3; }
.ca-root .sk.ready { border-color: #FFC76A; box-shadow: 0 0 12px rgba(255,199,106,.35); }
.ca-root .sk.aiming { border-color: #FFFFFF; transform: translateY(-3px); }
.ca-root .sk.smart::before { content: "智"; position: absolute; top: 3px; right: 4px; font-size: .62rem; font-weight: 900; line-height: 1; padding: 2px 3px; border-radius: 4px; background: #FFC76A; color: #3A2A08; }
.ca-root .sk.stolen { border-color: #FFD95A; background: linear-gradient(#6A5320, #3A2E14); }
.ca-root .sk.blocked::after { content: attr(data-block); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(60,40,90,.7); font-weight: 900; font-size: .9rem; color: #FFE07A; }
/* Touch layout: fixed joystick bottom left, 2x2 skills (Q W / E R) bottom right, filling the space under the arena. */
.ca-root .pad { display: contents; }
.ca-root #arena.touch .pad { display: flex; width: min(100%, 960px); flex: 1 1 auto; min-height: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 0 6px; }
.ca-root #arena.touch .skillbar { display: grid; grid-template-columns: repeat(2, 84px); grid-auto-rows: 76px; gap: 10px; flex: none; }
.ca-root #arena.touch .sk { width: 84px; height: 76px; }
.ca-root .joy { position: relative; flex: none; width: 150px; height: 150px; border-radius: 50%; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0 55%, rgba(255,255,255,.12) 56% 100%); border: 2px solid rgba(255,255,255,.22); }
.ca-root .joy i { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #F7FAFC, #B9C6D0); box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.ca-root .joy.active { border-color: rgba(255,199,106,.7); }
.ca-root .joy.active i { transition: none; }
.ca-root .joy:not(.active) i { transition: transform .12s; }
/* Phone held sideways: joystick | field | skills in three columns, the health bars a thin row on top, so the field gets the whole height */
@media (orientation: landscape) and (max-height: 520px) {
  .ca-root #arena.touch { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "hud hud hud" "joy stage skills"; gap: 6px 10px; align-items: center; justify-items: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 4px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); }
  .ca-root #arena.touch .hud { grid-area: hud; width: 100%; gap: 10px; }
  .ca-root #arena.touch .hp { flex-direction: row; align-items: center; gap: 8px; }
  .ca-root #arena.touch .hp.foe { flex-direction: row-reverse; }
  .ca-root #arena.touch .hp .nm { font-size: .8rem; max-width: 9em; }
  .ca-root #arena.touch .hp .bar { flex: 1 1 auto; height: 9px; }
  .ca-root #arena.touch .hp .num { font-size: .72rem; }
  .ca-root #arena.touch .hp { flex-wrap: wrap; row-gap: 2px; }
  .ca-root #arena.touch .hp2 { flex: 1 0 100%; }
  .ca-root #arena.touch .hp2 .bar { height: 7px; }
  .ca-root #arena.touch .timer { font-size: 1.25rem; }
  .ca-root #arena.touch .stage { grid-area: stage; width: min(calc((100dvh - 52px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 960 / 680), calc(100vw - 2 * 168px)); }
  .ca-root #arena.touch .pad { display: contents; }
  .ca-root #arena.touch .joy { grid-area: joy; width: 132px; height: 132px; }
  .ca-root #arena.touch .skillbar { grid-area: skills; grid-template-columns: repeat(2, 72px); grid-auto-rows: 64px; gap: 8px; }
  .ca-root #arena.touch .sk { width: 72px; height: 64px; }
  .ca-root #arena.touch .arena-foot { position: absolute; left: max(8px, env(safe-area-inset-left, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }
  .ca-root #arena.touch .arena-foot p { display: none; }
  .ca-root #arena.touch .arena-foot .btn.ghost { padding: 4px 10px; font-size: .8rem; }
}
@media (max-width: 380px) { .ca-root .joy { width: 128px; height: 128px; } .ca-root #arena.touch .skillbar { grid-template-columns: repeat(2, 74px); grid-auto-rows: 68px; } .ca-root #arena.touch .sk { width: 74px; height: 68px; } }
.ca-root .arena-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.ca-root .arena-foot p { margin: 0; font-size: .8rem; opacity: .75; }
.ca-root .arena-foot .btn.ghost { color: var(--arena-ink); border-color: rgba(255,255,255,.3); padding: 6px 12px; }

.ca-root #modal { position: fixed; inset: 0; z-index: 60; background: rgba(10,16,20,.6); display: grid; place-items: center; padding: 16px; }
.ca-root .sheet { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 22px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.ca-root .sheet h2 { margin: 0; font-weight: 900; font-size: 2rem; }
.ca-root .sheet p { margin: 0; color: var(--muted); }
.ca-root .reward { background: var(--gold-soft); border-radius: 12px; padding: 10px; font-weight: 700; }
/* 3D preview: drag a card to turn it; the viewer turns any way and zooms. */
.ca-root canvas.pv { cursor: grab; touch-action: pan-y; }
.ca-root canvas.pv.dragging { cursor: grabbing; }
.ca-root #viewer { position: fixed; inset: 0; z-index: 65; background: rgba(10,16,20,.72); display: grid; place-items: center; padding: 16px; }
.ca-root .viewer-sheet { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 16px; width: min(720px, 100%); display: flex; flex-direction: column; gap: 10px; }
.ca-root .viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ca-root .viewer-head h2 { margin: 0; font-size: 1.2rem; font-weight: 900; }
.ca-root #vCv { display: block; width: 100%; height: min(460px, 60vh); border-radius: 12px; background: var(--card); cursor: grab; touch-action: none; }
.ca-root #vCv.dragging { cursor: grabbing; }
.ca-root .viewer-views { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ca-root .viewer-sheet .hint { margin: 0; text-align: center; color: var(--muted); font-size: .85rem; }
/* Sign in / sign up dialog */
.ca-root #authBox { position: fixed; inset: 0; z-index: 66; background: rgba(10,16,20,.72); display: grid; place-items: center; padding: 16px; }
.ca-root .shop { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .ca-root .shop { grid-template-columns: 1fr; } }
.ca-root .shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ca-root .shop-item { display: flex; flex-direction: column; gap: 6px; background: var(--sunk); border-radius: 12px; padding: 10px 12px; }
.ca-root .shop-item .hint { margin: 0; flex: 1; font-size: .8rem; }
.ca-root .shop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ca-root .shop-head .price { font-family: var(--f-display); font-weight: 800; color: var(--gold); white-space: nowrap; }
.ca-root .bag { display: flex; flex-direction: column; gap: 6px; }
.ca-root .shop-item .item-ico { align-self: center; }
.ca-root .shop-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ca-root .orders { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.ca-root .order-row { background: var(--sunk); border-radius: 10px; padding: 6px 10px; }
.ca-root .order-row .hint { margin: 2px 0 0; font-size: .74rem; }
.ca-root .order-top { display: flex; justify-content: space-between; gap: 8px; }
.ca-root .order-top .price { font-weight: 800; color: var(--gold); white-space: nowrap; }
.ca-root .order-row.s-failed .order-top b, .ca-root .order-row.s-mismatch .order-top b { color: var(--bad); }
.ca-root .egg-card { justify-content: center; gap: 8px; border-style: dashed; background: transparent; }
.ca-root .egg-card .hint { margin: 0; }
.ca-root .egg-use { display: flex; align-items: center; gap: 8px; justify-content: flex-start; text-align: left; }
.ca-root .qty { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ca-root .qty .btn { width: 40px; height: 36px; padding: 0; font-size: 1.2rem; line-height: 1; }
.ca-root .qty .n { min-width: 2em; text-align: center; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; }
.ca-root .cart { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 12px 0 4px; border-top: 1px solid var(--line); position: sticky; bottom: 0; z-index: 2; background: var(--surface); } /* stays in view while scrolling the products */
.ca-root .cart-sum { flex: 1 1 12em; font-weight: 700; }
.ca-root .cart .btn.big { min-width: 9em; }
.ca-root .bag-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; background: var(--sunk); border-radius: 10px; padding: 6px 10px; }
.ca-root .bag-row .nm { font-weight: 700; }
.ca-root .bag-row .cnt { font-weight: 700; color: var(--gold); }
.ca-root .auth-sheet { width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.ca-root .auth-tabs { display: flex; gap: 8px; }
.ca-root .auth-google { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ca-root .auth-google #googleBtn { min-height: 44px; width: 100%; display: flex; justify-content: center; }
.ca-root .auth-or { margin: 0; font-size: .8rem; color: var(--muted); }
.ca-root .auth-form { display: flex; flex-direction: column; gap: 12px; }
.ca-root .auth-form label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 700; font-size: .92rem; color: var(--ink); }
.ca-root .auth-form .auth-check input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; display: inline-block; position: static; width: 16px; height: 16px; margin: 0; opacity: 1; visibility: visible; accent-color: var(--accent); }
.ca-root .auth-form input:not([type="checkbox"]) { font: inherit; font-weight: 500; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.ca-root .auth-form input:focus-visible { outline: none; border-color: var(--accent); }
.ca-root .auth-form small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.ca-root .auth-form .auth-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.ca-root .auth-form .auth-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ca-root .auth-form a.hint { color: var(--muted); }
.ca-root .auth-msg { margin: 0; min-height: 1.3em; text-align: center; font-weight: 700; color: var(--accent); }
.ca-root #toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { .ca-root .bar i { transition: none; } }

/* ===== WordPress version additions ===== */
/* Neutralise common theme styles inside the game. */
.ca-root h2, .ca-root h3, .ca-root p, .ca-root ul { margin-top: 0; }
.ca-root h2, .ca-root h3 { color: inherit; font-family: var(--f-body); text-transform: none; letter-spacing: normal; }
.ca-root a { color: var(--accent); font-weight: 700; }
.ca-root input[type="checkbox"] { box-shadow: none; }
.ca-root canvas { max-width: 100%; }
.ca-root .ready-name { font-weight: 900; font-size: 1.15rem; }
.ca-root .table-wrap { overflow-x: auto; }
.ca-root table.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 0; }
.ca-root table.board th, .ca-root table.board td { text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; }
.ca-root table.board th { font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
.ca-root table.board td:first-child { font-family: var(--f-display); font-weight: 800; width: 4em; }
.ca-root table.board tr.me td { background: var(--gold-soft); font-weight: 700; }
.ca-root .board-me { margin-bottom: 8px; }
.ca-root .ca-arena-open { overflow: hidden; }

/* 技能圖鑑 */
.ca-root .book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.ca-root .book-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ca-root .book-card.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ca-root .book-art { background: #26323B; aspect-ratio: 240 / 170; }
.ca-root .book-pv { display: block; width: 100%; height: 100%; }
.ca-root .book-body { padding: 10px 14px 12px; }
.ca-root .book-body p { margin: 4px 0; }
.ca-root .book-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ca-root .book-head h4 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.ca-root .book-tag { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; color: #fff; background: hsl(var(--h, 200), 55%, 42%); }
.ca-root .book-tag.mine { background: var(--accent); color: var(--accent-ink); }
.ca-root .book-evo { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: .82rem; font-weight: 700; color: var(--muted); }
.ca-root .evo-chip { margin-left: auto; }
.ca-root .evo-chip[aria-pressed="true"] { background: #F2C230; border-color: #F2C230; color: #2A1E16; }
.ca-root .book-skill { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
