/* Arcalink play.html - design tokens (owner B6): the colours and numbers every other stylesheet uses, the shared
   base rules (page, stage, chips, buttons), the bevel classes and the number font. Loaded first.
   Art plan: drafts/arcalink-art-direction.md 1-4 (colours), 3-1 (numbers), 3-2 (number font).
   Part 1 = the CURRENT look (used today). Part 2 = the NEW palette of the art plan (HUD, sheet, buttons, chips use it). */

@font-face { font-family: "Arca Num"; src: url("../fonts/cinzel-bold-num.woff2?v=2c5085fecc") format("woff2"); font-weight: 700; font-style: normal; font-display: block; }

:root {
  /* ---- part 1: current look (change these only together with the screenshots) */
  --gold: #ffd866; --cyan: #7fe3ff; --mana: #ffcf6a; --panel: rgba(14,20,36,.94); --line: rgba(127,227,255,.35);
  --bg: #0c1018; --field: #1d2a1c; --text: #eef2ff;
  --el-fire: #ff8a3d; --el-thunder: #b79cff; --el-ice: #8fd8ff; --relay: #f0a0ff; --up: #8ff0b0;

  /* ---- part 2: art plan 1-4 (in use by the HUD / sheet / buttons since B6) - UI ground and frames */
  --ar-night: #080b16;          /* outside the stage, loading, modal curtain (70 %) */
  --ar-page: #111730;           /* panels, chips (96 %) */
  --ar-page-hi: #1b2344;        /* rows, pressable faces, inner step */
  --ar-ink: #0a0c18;            /* icon outline, text outline, shadow */
  --ar-brass: #b88a44; --ar-brass-hi: #f0cf85; --ar-brass-lo: #6e4f24;
  --ar-steel: #aab8d8; --ar-steel-hi: #eef3ff; --ar-steel-lo: #56617f;
  --ar-text: #f2efe6; --ar-text-sub: #a9b0c8; --ar-text-off: #5c6480;
  /* meaning colours: main / light (core) / dark */
  --ar-mana: #3fd0ff; --ar-mana-hi: #c8f6ff; --ar-mana-lo: #12607f;
  --ar-mana-x: #ffe9a8; --ar-mana-x-hi: #ffffff;                  /* dense mana */
  --ar-coin: #ffc83d; --ar-coin-hi: #fff2b0; --ar-coin-lo: #a86a12;
  --ar-gold: #e9b84a; --ar-gold-hi: #fff0a0; --ar-gold-lo: #7a5416; /* gold card tier only */
  --ar-forb: #ff2a55; --ar-forb-hi: #fff0f3; --ar-forb-lo: #4a0618; --ar-forb-bg: #0a0206;
  --ar-fire: #ff6a1f; --ar-fire-hi: #ffd45a; --ar-fire-lo: #7a1e08;
  --ar-thunder: #9a7bff; --ar-thunder-hi: #fff7b8; --ar-thunder-lo: #2e1f7a;
  --ar-ice: #bfeaff; --ar-ice-hi: #ffffff; --ar-ice-lo: #2f6f9a;
  --ar-relay: #ff8ae0; --ar-relay-hi: #ffe0f8; --ar-relay-lo: #7a2a66;
  --ar-hp: #5fd68a; --ar-danger: #ff4b3a; --ar-up: #8ff0b0;
  --ar-enemy: #b5402a; --ar-enemy-eye: #ff5a3a;
  /* gem families (art plan 4-3): stone colour per family */
  --ar-gem-green: #35d39a; --ar-gem-red: #d8434f; --ar-gem-blue: #3f8cff; --ar-pit: #0b0f20;
  /* numbers (3-1) */
  --ar-u: 4px;                                                      /* spacing unit */
  --ar-fr-s: 4px; --ar-fr-m: 8px; --ar-fr-l: 12px;                  /* bevel (cut corner) lengths */
  --ar-border: 1.5px; --ar-hit: 44px;                               /* frame width, smallest touch target */
  --ar-num: "Arca Num", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;                      /* number face (load it before showing a screen that uses it) */
}

/* bevelled corners (art plan 3-1): clip-path only, no border-radius. */
.fr-s, .fr-m, .fr-l { --fr: var(--ar-fr-m); clip-path: polygon(var(--fr) 0, calc(100% - var(--fr)) 0, 100% var(--fr), 100% calc(100% - var(--fr)), calc(100% - var(--fr)) 100%, var(--fr) 100%, 0 calc(100% - var(--fr)), 0 var(--fr)); }
.fr-s { --fr: var(--ar-fr-s); } .fr-l { --fr: var(--ar-fr-l); }

/* ---- framed part (3-1, 3-3): the element paints the 1.5px brass ring, ::before the page fill 1.5px inside, both cut at the corners.
   --fr bevel, --fill fill, --ring ring, --bw ring width. ::after is free for the "can buy / can insert" plate (z -2: it tints only the ring). */
.chip, .btn, .pnl, .bk, .gcell, .slot, .shopc, .gdet, #hint, #pv, #toast span {
  --fr: var(--ar-fr-m); --bw: var(--ar-border); --fill: var(--ar-page); --ring: linear-gradient(180deg, var(--ar-brass-hi), var(--ar-brass-lo));
  position: relative; isolation: isolate; background: var(--ring);
  clip-path: polygon(var(--fr) 0, calc(100% - var(--fr)) 0, 100% var(--fr), 100% calc(100% - var(--fr)), calc(100% - var(--fr)) 100%, var(--fr) 100%, 0 calc(100% - var(--fr)), 0 var(--fr)); }
.chip::before, .btn::before, .pnl::before, .bk::before, .gcell::before, .slot::before, .shopc::before, .gdet::before, #hint::before, #pv::before, #toast span::before {
  content: ""; position: absolute; inset: var(--bw); z-index: -1; background: var(--fill); --f2: calc(var(--fr) - var(--bw) * .586);
  clip-path: polygon(var(--f2) 0, calc(100% - var(--f2)) 0, 100% var(--f2), 100% calc(100% - var(--f2)), calc(100% - var(--f2)) 100%, var(--f2) 100%, 0 calc(100% - var(--f2)), 0 var(--f2)); }
.chip, #hint, #pv, #toast span, .bk, .gcell, .slot { --fr: var(--ar-fr-s); }
.chip, #hint, #pv, #toast span { --bw: 1px; }

/* ---- shared base rules */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ar-night); overflow: hidden; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none;
  font: 13px/1.45 system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif; font-weight: 500; color: var(--ar-text); }
button { font: inherit; color: inherit; }
#stage { position: fixed; top: 0; bottom: 0; left: 50%; width: min(100vw, calc(100dvh * 0.5625)); transform: translateX(-50%); overflow: hidden; background: var(--field); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ov { position: absolute; left: 0; right: 0; pointer-events: none; }
.ov > * { pointer-events: auto; }

/* number face: Cinzel has no tabular digits, so every number box gets a minimum width and right alignment (3-2) */
.num { font-family: var(--ar-num); font-weight: 700; letter-spacing: .02em; display: inline-block; text-align: right; min-width: 0; white-space: nowrap; font-feature-settings: "lnum"; }
.num.w3 { min-width: 3.2em; } .num.w2 { min-width: 2.2em; } .num.w4 { min-width: 4.2em; } .num.w1 { min-width: 1.2em; }

.chip { --fill: var(--ar-page); min-height: 32px; padding: 3px 8px; display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ar-text); }
.chip small { font-weight: 500; color: var(--ar-text-sub); font-size: 11px; }

.btn { --fill: var(--ar-page-hi); --ring: linear-gradient(180deg, var(--ar-steel-hi), var(--ar-steel) 40%, var(--ar-steel-lo));
  appearance: none; border: 0; min-height: 48px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 15px; color: var(--ar-text); cursor: pointer; text-align: center; transition: transform 80ms; }
.btn:active { transform: scale(.96); }
.btn:active::before { background-image: linear-gradient(rgba(255,255,255,.12), rgba(255,255,255,.12)), var(--fill); }
.btn.small { min-height: 44px; padding: 6px 12px; font-size: 14px; }
.btn.primary { --fill: linear-gradient(180deg, var(--ar-mana-x), #d9a030); --ring: linear-gradient(180deg, #fff6d0, var(--ar-brass-hi) 40%, var(--ar-brass)); min-height: 52px; color: var(--ar-ink); font-size: 17px; font-weight: 900;
  clip-path: polygon(var(--fr) 0, calc(100% - var(--fr)) 0, 100% var(--fr), 100% calc(50% - 7px), calc(100% - 4px) 50%, 100% calc(50% + 7px), 100% calc(100% - var(--fr)), calc(100% - var(--fr)) 100%, var(--fr) 100%, 0 calc(100% - var(--fr)), 0 calc(50% + 7px), 4px 50%, 0 calc(50% - 7px), 0 var(--fr)); }
.btn.primary::before { clip-path: polygon(var(--f2) 0, calc(100% - var(--f2)) 0, 100% var(--f2), 100% calc(50% - 6px), calc(100% - 2.5px) 50%, 100% calc(50% + 6px), 100% calc(100% - var(--f2)), calc(100% - var(--f2)) 100%, var(--f2) 100%, 0 calc(100% - var(--f2)), 0 calc(50% + 6px), 2.5px 50%, 0 calc(50% - 6px), 0 var(--f2)); }
.btn.danger { --fill: #4a0f14; --ring: color-mix(in srgb, var(--ar-danger) 60%, transparent); }
.btn[disabled], .btn.dis { --fill: var(--ar-page); --ring: color-mix(in srgb, var(--ar-text-off) 40%, transparent); color: var(--ar-text-off); pointer-events: none; }
/* "can do it" emphasis (3-3): a mana plate under the fill that tints the ring, opacity only. Replaces the old box-shadow halo of arca-fx.css. */
#stage .btn.glow::after, #stage .slot.ok::after { content: ""; position: absolute; inset: 0; z-index: -2; border-radius: 0; box-shadow: none; background: var(--ar-mana); clip-path: inherit; animation: arPulse 1.2s ease-in-out infinite; }
.btn.glow { --ring: linear-gradient(180deg, var(--ar-brass-hi), var(--ar-brass)); }
@keyframes arPulse { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* money / cost: coin picture + number face (cost 15px, coin colour; lacking = danger) */
.price { color: var(--ar-coin); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.price .num { font-size: 15px; min-width: 2em; }
.price.lack { color: var(--ar-danger); }
.btn.dis .price:not(.lack) { color: inherit; }
.coin { width: 16px; height: 16px; flex: none; display: block; }
.ai { display: block; width: 100%; height: 100%; overflow: visible; }
.hide { display: none !important; }

/* diamond points (wave dots, upgrade pips, tier dots): filled = .on, otherwise an empty frame */
.dia { --dc: var(--ar-brass); width: 8px; height: 8px; flex: none; position: relative; background: var(--dc); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); display: block; }
.dia::after { content: ""; position: absolute; inset: 1.5px; background: var(--ar-page); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.dia.on::after { display: none; }
.dia.on { --dc: var(--ar-brass-hi); }

/* ---------- wide windows (PC): the portrait stage no longer sits alone on black (11-27 review). A pre-darkened, scaled copy of the title picture with ONE static blur
   (a layer that never animates, so it is rastered once), a vignette over it, and a thin brass edge + soft shadow on the stage. Hidden on phones. The side ad rails (frontend/site-ads.css, z 3) sit above it. */
#pcbg, #pcbg::after { display: none; }
@media (min-aspect-ratio: 10/16) {
  #stage { z-index: 1; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ar-brass) 55%, transparent), 0 0 70px 10px rgba(4,6,14,.75); }
  #pcbg { display: block; position: fixed; inset: -48px; z-index: 0; pointer-events: none; opacity: 0; transform: translateZ(0);
    background: linear-gradient(rgba(8,11,22,.58), rgba(8,11,22,.78)), url("../assets/arca/title.webp?v=e8b17eb2c2") center 30% / cover no-repeat; filter: blur(20px) saturate(.85); }
  body.bgok #pcbg { opacity: 1; }
  #pcbg::after { display: block; content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 75% at 50% 50%, transparent 40%, rgba(5,7,16,.7) 100%); }
}

/* (12-01 QA) Japanese text wraps at phrase boundaries everywhere (Chrome/Edge: auto-phrase; others fall back to normal). Fixes 「跳ねま/す」「運び/手」-type splits in relics, detours, gems, sheets and pop-ups */
body { word-break: auto-phrase; line-break: strict; }
