/* Open Table game client styles (the v1 play sheet, Forge, roster and editors).
   Generated from the v1 stylesheet with every rule scoped under .ot-game, so it can't
   leak into (or be overridden by) the app shell's own styles. */
@font-face { font-family:"Cinzel"; font-weight:400 500; font-display:swap; src:url("../fonts/cinzel-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Cinzel"; font-weight:600; font-display:swap; src:url("../fonts/cinzel-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Cinzel"; font-weight:700 900; font-display:swap; src:url("../fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"Source Serif 4"; font-weight:400 500; font-display:swap; src:url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Source Serif 4"; font-style:italic; font-weight:400 500; font-display:swap; src:url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family:"Source Serif 4"; font-weight:600; font-display:swap; src:url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Source Serif 4"; font-weight:700 900; font-display:swap; src:url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-weight:400; font-display:swap; src:url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-weight:500 600; font-display:swap; src:url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-weight:700 900; font-display:swap; src:url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); }

  /* ===================== PARCHMENT (global shell: roster / modal / admin) ===================== */
  .ot-game{
    --p-bg:#e9dfc4; --p-bg-2:#f3ead2; --p-panel:#f8f1de; --p-border:#cdb98c; --p-border-soft:#ddcda3;
    --p-ink:#2c2013; --p-ink-dim:#6b5a3e; --p-ink-faint:#9c8c68;
    --p-brand:#7a3b30;
    --gold:#b8862f; --violet:#7a5fa0; --ember:#b5502f;
  }
  .ot-game *{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  .ot-game button, .ot-game a, .ot-game input[type=checkbox], .ot-game select, .ot-game .rcard, .ot-game .admin-row button{
    touch-action: manipulation; /* stops the ~300ms double-tap-to-zoom gesture on
      mobile Safari from occasionally registering as a second click on small,
      closely-packed buttons -- the likely cause of "buttons trigger twice" */
  }
  .ot-game{ background:var(--p-bg); color:var(--p-ink); font-family:"Source Serif 4",Georgia,serif; font-size:15px; line-height:1.45; }
  .ot-game h1,.ot-game h2,.ot-game h3,.ot-game h4{ margin:0; font-family:"Cinzel",serif; font-weight:600; }
  .ot-game a{ color:inherit; }
  .ot-game button{ font-family:inherit; cursor:pointer; }
  .ot-game textarea, .ot-game input{ font-family:inherit; }

  .ot-game .wrap{ max-width:960px; margin:0 auto; padding:18px 16px 60px; position:relative; z-index:1; }

  .ot-game .topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
  .ot-game .brand{ font-family:"Cinzel"; font-size:16px; letter-spacing:.08em; text-transform:uppercase; color:var(--p-brand); }
  .ot-game .brand span{ color:var(--p-ink-faint); font-family:"JetBrains Mono"; font-size:10px; text-transform:none; letter-spacing:0; display:block; margin-top:2px; }
  .ot-game .topbar-actions{ display:flex; gap:8px; align-items:center; }
  .ot-game .back, .ot-game .admin-link{
    font-size:12px; color:var(--p-brand); background:var(--p-panel); border:1px solid var(--p-border); border-radius:999px; padding:6px 12px;
    text-decoration:none; display:inline-block;
  }

  .ot-game .offline-banner{
    display:none; background:#f3ddb0; border:1px solid #c9a75c; color:#5a3f14;
    font-size:12px; padding:7px 12px; border-radius:8px; margin-bottom:14px; text-align:center;
  }
  .ot-game .offline-banner.show{ display:block; }

  /* ---------------- roster ---------------- */
  .ot-game .roster-grid{ display:grid; grid-template-columns:1fr; gap:16px; }
  @media(min-width:640px){ .ot-game .roster-grid{ grid-template-columns:1fr 1fr; } }
  .ot-game .rcard{
    position:relative; overflow:hidden;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--card-accent, var(--gold)) 13%, var(--p-panel)) 0%, var(--p-panel) 62%);
    border:1.5px solid color-mix(in srgb, var(--card-accent-visible, var(--card-accent, var(--p-border))) 55%, var(--p-border));
    border-radius:14px; padding:16px 16px 16px 22px; display:flex; gap:14px; cursor:pointer;
    transition:transform .13s ease, box-shadow .13s ease;
    box-shadow:0 3px 10px rgba(60,40,15,0.09);
  }
  /* colour-coded spine down the left edge -- uses the "visible" variant so a
     pale accent pick (near-white, etc.) still shows up against the card
     instead of washing out; the raw accent is kept for the subtle gradient
     wash above, where a light tone showing lightly is fine. */
  .ot-game .rcard::before{
    content:""; position:absolute; left:0; top:0; bottom:0; width:6px;
    background:var(--card-accent-visible, var(--card-accent, var(--gold)));
  }
  .ot-game .rcard:hover{
    transform:translateY(-3px);
    box-shadow:0 10px 22px color-mix(in srgb, var(--card-accent, var(--gold)) 28%, rgba(60,40,15,0.18));
  }
  .ot-game .rcard .thumb{
    width:66px; height:66px; border-radius:50%; object-fit:cover; object-position:50% 20%; flex:none;
    border:2.5px solid var(--card-accent-visible, var(--card-accent, var(--gold))); background:var(--p-bg-2);
    box-shadow:0 0 0 4px color-mix(in srgb, var(--card-accent, var(--gold)) 16%, transparent);
  }
  .ot-game .rcard .thumb.placeholder{ display:flex; align-items:center; justify-content:center; font-family:"Cinzel"; font-size:24px; font-weight:700; color:var(--card-accent-visible, var(--card-accent, var(--gold))); }
  .ot-game .rcard .rc-name{ font-family:"Cinzel"; font-size:16px; font-weight:700; color:var(--p-ink); }
  .ot-game .rcard .rc-sub{
    display:inline-block; margin-top:4px; padding:2px 8px; border-radius:999px;
    background:color-mix(in srgb, var(--card-accent, var(--gold)) 20%, transparent);
    border:1px solid color-mix(in srgb, var(--card-accent-visible, var(--card-accent, var(--gold))) 45%, transparent);
    font-size:9.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
    color:var(--card-accent-visible, var(--card-accent, var(--p-brand)));
  }
  .ot-game .rc-edition{ opacity:.75; font-weight:600; }
  .ot-game .rcard .rc-blurb{ font-size:12px; color:var(--p-ink-dim); margin-top:7px; line-height:1.5; }
  .ot-game .rcard .rc-body{ min-width:0; }

  .ot-game .empty, .ot-game .loading{ text-align:center; padding:50px 20px; color:var(--p-ink-faint); font-size:13px; }

  /* ---------------- modal (character bio) ---------------- */
  .ot-game .modal-backdrop{
    position:fixed; inset:0; background:rgba(30,20,10,0.55); z-index:80;
    display:flex; align-items:flex-end; justify-content:center;
    opacity:0; pointer-events:none; transition:opacity .18s ease;
  }
  .ot-game .modal-backdrop.open{ opacity:1; pointer-events:auto; }
  @media(min-width:640px){ .ot-game .modal-backdrop{ align-items:center; } }

  .ot-game .modal-card{
    background:var(--p-panel); width:100%; max-width:520px; max-height:92vh; overflow-y:auto;
    border-radius:16px 16px 0 0; border:1px solid var(--p-border);
    transform:translateY(30px); transition:transform .2s ease;
    position:relative;
  }
  .ot-game .modal-backdrop.open .modal-card{ transform:translateY(0); }
  @media(min-width:640px){ .ot-game .modal-card{ border-radius:16px; } }

  .ot-game .modal-head{
    background:linear-gradient(135deg, color-mix(in srgb, var(--m-accent, var(--gold)) 22%, var(--p-panel)), var(--p-panel));
    padding:20px 20px 16px; border-bottom:1px solid var(--p-border-soft);
    display:flex; gap:14px; align-items:center; border-radius:16px 16px 0 0;
  }
  .ot-game .modal-close{
    position:absolute; top:12px; right:12px; width:38px; height:38px; border-radius:50%;
    background:var(--p-bg); border:1px solid var(--p-border); font-size:18px; color:var(--p-ink-dim);
    display:flex; align-items:center; justify-content:center; line-height:1;
  }
  .ot-game .modal-head .portrait{ width:74px; height:74px; border-radius:12px; object-fit:cover; object-position:50% 20%; border:2px solid var(--m-accent-visible, var(--m-accent, var(--gold))); flex:none; background:var(--p-bg-2); }
  .ot-game .modal-head h1{ font-size:20px; color:var(--p-ink); }
  .ot-game .modal-head .tag{ font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--m-accent-visible, var(--m-accent, var(--p-brand))); margin-top:2px; }
  .ot-game .modal-head .meta{ font-size:11px; color:var(--p-ink-dim); margin-top:2px; }

  .ot-game .modal-body{ padding:18px 20px 22px; }
  .ot-game .blurb-box{ font-size:14px; line-height:1.6; color:var(--p-ink-dim); margin-bottom:16px; }

  .ot-game .quicklook{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:18px; }
  .ot-game .qchip{ background:var(--p-bg-2); border:1px solid var(--p-border-soft); border-radius:8px; padding:8px 4px; text-align:center; }
  .ot-game .qchip .n{ font-family:"JetBrains Mono"; font-weight:700; font-size:16px; color:var(--m-accent-visible, var(--m-accent, var(--p-brand))); }
  .ot-game .qchip .l{ font-size:8px; letter-spacing:.05em; text-transform:uppercase; color:var(--p-ink-faint); }

  .ot-game .checkout-btn{
    width:100%; padding:14px; border-radius:10px; border:none; background:var(--m-accent, var(--p-brand)); color:var(--m-btn-text, #fff);
    font-family:"Cinzel"; font-weight:700; font-size:14px; letter-spacing:.04em; text-transform:uppercase;
  }
  /* Play button + joined level dropdown, styled as one split control. */
  .ot-game .checkout-split{ display:flex; align-items:stretch; }
  .ot-game .checkout-split .checkout-btn{ flex:1; border-radius:10px 0 0 10px; }
  .ot-game .checkout-level-wrap{ position:relative; display:flex; }
  .ot-game .checkout-level-wrap::after{
    content:"▾"; position:absolute; right:12px; top:50%; transform:translateY(-50%);
    color:var(--m-btn-text, #fff); font-size:13px; pointer-events:none;
  }
  .ot-game .checkout-level{
    -webkit-appearance:none; appearance:none; cursor:pointer; height:100%;
    padding:0 30px 0 14px; border:none; border-left:1px solid color-mix(in srgb, var(--m-btn-text, #fff) 35%, transparent);
    border-radius:0 10px 10px 0; background:var(--m-accent, var(--p-brand)); color:var(--m-btn-text, #fff);
    font-family:"Cinzel"; font-weight:700; font-size:13px; letter-spacing:.04em;
  }
  .ot-game .checkout-level option{ color:#222; background:#fff; }
  .ot-game .checkout-split.secondary{ margin-top:8px; }
  .ot-game .checkout-split.secondary .checkout-btn-secondary{ flex:1; margin-top:0; border-radius:10px 0 0 10px; }
  .ot-game .checkout-level-wrap.secondary::after{ color:var(--p-ink-dim); }
  .ot-game .checkout-level-wrap.secondary .checkout-level{
    background:transparent; color:var(--p-ink-dim); border:1px solid var(--p-border); border-left:none; font-size:12px;
  }
  .ot-game .checkout-btn-secondary{
    width:100%; padding:11px; border-radius:10px; margin-top:8px; border:1px solid var(--p-border);
    background:transparent; color:var(--p-ink-dim); font-size:12.5px;
  }
  .ot-game .checkout-note{ font-size:11px; color:var(--p-ink-faint); text-align:center; margin-top:8px; }

  /* "continue playing" -- remembered active sessions on this device */
  .ot-game .continue-section{ margin-bottom:18px; }
  .ot-game .continue-label{
    font-family:"Cinzel"; font-size:11px; letter-spacing:.08em; text-transform:uppercase;
    color:var(--p-brand); margin-bottom:8px;
  }
  .ot-game .continue-grid{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; -webkit-overflow-scrolling:touch; }
  .ot-game .continue-card{
    flex:none; width:84px; display:flex; flex-direction:column; align-items:center; gap:6px;
    background:var(--p-panel); border:1.5px solid var(--card-accent-visible, var(--card-accent, var(--p-border))); border-radius:12px;
    padding:10px 8px; cursor:pointer; text-align:center;
  }
  .ot-game .continue-card .thumb{ border-radius:50%; object-fit:cover; object-position:50% 20%; border:2px solid var(--card-accent-visible, var(--card-accent, var(--gold))); background:var(--p-bg-2); }
  .ot-game .continue-card .thumb.placeholder{ display:flex; align-items:center; justify-content:center; font-family:"Cinzel"; font-weight:700; color:var(--card-accent-visible, var(--card-accent, var(--gold))); }
  .ot-game .continue-card .cc-name{ font-size:10.5px; font-weight:600; color:var(--p-ink); line-height:1.2; }

  /* ===================== DARK PLAY SHEET (per-character theme) ===================== */
  .ot-game .playsheet{
    --bg:#12160e; --surface:#1b2415; --surface-2:#212b1a; --border:#3a4629; --border-soft:#2a3420;
    --accent:#8fbd5a; --accent-bright:#bfe38c; --glow:#a6f0c0;
    --ink:#f0e9d6; --ink-dim:#b6bca4; --ink-faint:#848a71;
    --p-gold:#dbb35a; --p-violet:#b39bd6; --p-ember:#c96a45;
    background:var(--bg); color:var(--ink);
    margin:-18px -16px 0; padding:0 0 30px; border-radius:0 0 14px 14px; overflow:hidden;
  }
  @media(min-width:640px){ .ot-game .playsheet{ border-radius:16px; margin:0; } }

  /* banner + identity (mirrors the standalone sheet) */
  .ot-game .playsheet .banner{
    position:relative; height:210px; background-size:cover; background-position:center 25%;
  }
  .ot-game .playsheet .banner-inner{ padding:18px 18px 0; display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
  .ot-game .brand-eyebrow{ font-family:"JetBrains Mono"; font-size:11px; letter-spacing:.13em; text-transform:uppercase; color:var(--glow); opacity:.9; }
  .ot-game .edition-tag{
    font-family:"JetBrains Mono"; font-size:9px; letter-spacing:.06em; text-transform:uppercase;
    color:var(--ink-faint); background:rgba(0,0,0,0.3); border:1px solid var(--border-soft);
    border-radius:999px; padding:2px 8px; margin-left:8px; vertical-align:middle; white-space:nowrap;
  }
  .ot-game .help-toggle{
    background:rgba(14,19,12,0.5); border:1px solid color-mix(in srgb, var(--accent-bright) 40%, transparent);
    color:var(--accent-bright); font-family:"JetBrains Mono"; font-size:11px; padding:7px 11px; border-radius:999px;
    backdrop-filter:blur(3px); flex:none;
  }
  .ot-game .playsheet .identity{ padding:0 18px; display:flex; align-items:flex-end; gap:18px; margin-top:-72px; position:relative; }
  .ot-game .playsheet .portrait{
    width:126px; height:126px; flex:none; border-radius:50%; position:relative;
    background:radial-gradient(circle at 50% 20%, var(--surface-2), var(--bg) 70%);
    border:2.5px solid var(--border);
    box-shadow:0 0 0 5px var(--bg), 0 10px 24px rgba(0,0,0,0.5), 0 0 32px color-mix(in srgb, var(--accent) 20%, transparent);
  }
  .ot-game .playsheet .portrait img{ width:100%; height:100%; object-fit:cover; object-position:50% 18%; border-radius:50%; }
  .ot-game .portrait-empty{ width:100%; height:100%; border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:"Cinzel"; font-size:40px; color:var(--accent); }
  /* Wild Shape overlay badge: half-overlaps the character's own portrait as
     a visual cue for which form they're currently in. Needs .portrait to NOT
     clip via overflow:hidden (handled by putting the circular clip on the
     image/placeholder directly above instead), so this can hang over the edge. */
  .ot-game .wildshape-overlay{
    position:absolute; bottom:-6px; right:-6px; width:58px; height:58px; border-radius:50%;
    overflow:hidden; border:3px solid var(--bg); background:var(--surface-2);
    box-shadow:0 3px 10px rgba(0,0,0,0.55);
    display:flex; align-items:center; justify-content:center;
  }
  .ot-game .wildshape-overlay img{ width:100%; height:100%; object-fit:cover; object-position:50% 20%; }
  .ot-game .wo-fallback{ font-size:24px; line-height:1; }
  .ot-game .id-text{ padding-bottom:7px; min-width:0; }
  .ot-game .id-text h1{ font-family:"Cinzel"; font-size:clamp(23px,6.5vw,33px); color:var(--ink); text-shadow:0 2px 10px rgba(0,0,0,0.6); }
  .ot-game .id-sub{ font-size:13.5px; color:var(--ink-dim); margin-top:4px; }
  .ot-game .id-sub b{ color:var(--accent-bright); font-weight:600; }
  .ot-game .id-sub .sep{ color:var(--ink-faint); margin:0 5px; }

  /* intro panel */
  .ot-game .playsheet .intro{
    margin:16px 18px 0; background:var(--surface); border:1px solid var(--border-soft); border-radius:12px;
    padding:14px 16px; display:none;
  }
  .ot-game .playsheet .intro.open{ display:block; }
  .ot-game .playsheet .intro h3{ font-family:"Cinzel"; font-size:12px; letter-spacing:.05em; text-transform:uppercase; color:var(--accent-bright); margin-bottom:8px; }
  .ot-game .playsheet .intro ul{ margin:0; padding-left:17px; font-size:12.5px; line-height:1.6; color:var(--ink-dim); }
  .ot-game .playsheet .intro li{ margin-bottom:5px; }
  .ot-game .playsheet .intro b{ color:var(--ink); }

  /* sections */
  .ot-game .playsheet section{ margin:18px 18px 0; }
  .ot-game .sec-head{ display:flex; align-items:baseline; gap:8px; margin-bottom:9px; }
  .ot-game .sec-head h2{ font-family:"Cinzel"; font-size:12.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--p-gold); }
  .ot-game .sec-note{ font-size:10.5px; color:var(--ink-faint); }
  .ot-game .p-card{ background:var(--surface); border:1px solid var(--border-soft); border-radius:12px; padding:13px 15px; }

  .ot-game .help-btn{
    display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%;
    background:transparent; border:1px solid color-mix(in srgb, var(--p-violet) 60%, transparent); color:var(--p-violet);
    font-family:"JetBrains Mono"; font-size:9px; font-weight:700; line-height:1; padding:0; flex:none; vertical-align:middle;
  }

  /* vitals */
  .ot-game .vitals{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
  @media(min-width:520px){ .ot-game .vitals{ grid-template-columns:repeat(6,1fr); } }
  .ot-game .vital{ background:var(--surface-2); border:1px solid var(--border-soft); border-radius:9px; padding:9px 3px; text-align:center; }
  /* AC tile is tappable to adjust -- a dashed accent border hints at that
     without shouting, and a ✎ marker shows while it's been adjusted. */
  .ot-game .vital.ac-editable{ cursor:pointer; border:1px dashed color-mix(in srgb, var(--accent) 55%, var(--border-soft)); }
  .ot-game .vital.ac-editable:active{ transform:translateY(1px); }
  .ot-game .ac-adj-tag{ font-size:.5em; color:var(--accent-bright); margin-left:3px; vertical-align:super; }
  .ot-game .vital .num{ font-family:"JetBrains Mono"; font-size:17px; font-weight:700; color:var(--ink); }
  .ot-game .vital .lbl{ font-size:8px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-faint); margin-top:3px; display:flex; align-items:center; justify-content:center; gap:3px; }
  .ot-game .dv-badge{ font-size:7px; color:var(--accent-bright); margin-top:2px; text-transform:none; letter-spacing:0; }
  .ot-game .vital.accent .num{ color:var(--accent-bright); }

  .ot-game .hp-row{ margin-top:11px; display:flex; align-items:center; gap:12px; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:9px; padding:11px 13px; }
  .ot-game .hp-main{ flex:1; min-width:0; }
  .ot-game .hp-main .lbl{ font-size:8.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint); display:flex; gap:4px; align-items:center; }
  .ot-game .hp-track{ height:9px; border-radius:6px; background:var(--bg); border:1px solid var(--border-soft); overflow:hidden; margin-top:6px; }
  .ot-game .hp-fill{ height:100%; background:linear-gradient(90deg, var(--p-ember), var(--p-gold)); transition:width .25s ease; }
  .ot-game .hp-nums{ font-family:"JetBrains Mono"; font-size:11.5px; color:var(--ink-dim); margin-top:5px; }
  .ot-game .hp-nums b{ color:var(--ink); font-size:15px; }
  .ot-game .hp-btns{ display:flex; gap:10px; flex:none; }
  .ot-game .hp-btns button{ width:48px; height:48px; border-radius:10px; border:1.5px solid var(--border); background:var(--surface); color:var(--glow); font-family:"JetBrains Mono"; font-size:22px; font-weight:700; }
  .ot-game .hp-btns button.dmg{ color:#e0876a; border-color:color-mix(in srgb, #e0876a 45%, var(--border)); }
  .ot-game .hp-btns button.heal{ color:var(--accent-bright); border-color:color-mix(in srgb, var(--accent-bright) 45%, var(--border)); }
  .ot-game .hp-btns button.hp-adjust{ width:auto; padding:0 18px; font-family:"Cinzel"; font-size:13px; letter-spacing:.05em; color:var(--accent-bright); border-color:color-mix(in srgb, var(--accent-bright) 45%, var(--border)); }

  .ot-game .death-row{ display:flex; align-items:center; gap:14px; margin-top:11px; flex-wrap:wrap; }
  .ot-game .death-label{ font-size:10.5px; color:var(--ink-faint); display:flex; align-items:center; gap:4px; }
  .ot-game .death-group{ display:flex; align-items:center; gap:8px; font-size:10.5px; color:var(--ink-faint); }
  .ot-game .rest-btns{ display:flex; gap:8px; margin-left:auto; }
  .ot-game .rest-btn{
    padding:8px 13px; border-radius:9px; border:1px solid var(--border); background:var(--surface-2);
    font-family:"Cinzel"; font-weight:700; font-size:10.5px; letter-spacing:.03em; text-transform:uppercase;
  }
  .ot-game .rest-btn.short{ color:var(--glow); border-color:color-mix(in srgb, var(--glow) 40%, var(--border)); }
  .ot-game .rest-btn.long{ color:var(--accent-bright); border-color:color-mix(in srgb, var(--accent-bright) 40%, var(--border)); }
  .ot-game .pip{ width:24px; height:24px; border-radius:50%; border:1.6px solid var(--border); background:transparent; padding:0; }
  .ot-game .pip.success{ border-color:var(--accent); } .ot-game .pip.success.filled{ background:var(--accent); }
  .ot-game .pip.fail{ border-color:var(--p-ember); } .ot-game .pip.fail.filled{ background:var(--p-ember); }

  /* wild shape mode */
  .ot-game .wildshape-banner{ border-color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, var(--surface)); }
  .ot-game .ws-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
  .ot-game .ws-label{ font-family:"JetBrains Mono"; font-size:10px; letter-spacing:.1em; color:var(--accent-bright); }
  .ot-game .ws-name{ margin:2px 0 0; }
  .ot-game .ws-changeback{
    padding:12px 16px; border-radius:10px; border:none; background:var(--accent); color:#111;
    font-family:"Cinzel"; font-weight:700; font-size:13px; letter-spacing:.03em; white-space:nowrap;
  }
  /* Rage -- reuses the Wild Shape banner layout, recoloured in a fiery
     orange so it reads as its own thing rather than "wild shaped". */
  .ot-game .rage-banner{ border-color:#e0703a; background:color-mix(in srgb, #e0703a 12%, var(--surface)); }
  .ot-game .rage-banner .ws-label{ color:#f08a50; }
  .ot-game .rage-banner .ws-changeback{ background:#e0703a; }
  .ot-game .rage-ready{ border-color:color-mix(in srgb, #e0703a 45%, var(--border-soft)); }
  .ot-game .rage-btn{ background:#e0703a; }
  .ot-game .rage-btn:disabled{ opacity:.4; cursor:not-allowed; }
  .ot-game .rage-effects{ margin:10px 0 0; padding-left:18px; font-size:12.5px; line-height:1.7; color:var(--ink-dim); }
  .ot-game .ability-card.yours-card{ border-color:color-mix(in srgb, var(--accent) 45%, var(--border-soft)); }
  .ot-game .yours-badge, .ot-game .form-badge{
    display:inline-block; font-family:"JetBrains Mono"; font-size:7.5px; letter-spacing:.05em; text-transform:uppercase;
    padding:2px 6px; border-radius:999px; margin-left:4px; vertical-align:middle; font-weight:700;
  }
  .ot-game .yours-badge{ background:color-mix(in srgb, var(--accent) 30%, transparent); color:var(--accent-bright); border:1px solid color-mix(in srgb, var(--accent) 55%, transparent); }
  .ot-game .form-badge{ background:var(--surface-2); color:var(--ink-faint); border:1px solid var(--border-soft); }

  /* ability cards */
  .ot-game .abilities{ display:grid; grid-template-columns:1fr; gap:9px; }
  @media(min-width:560px){ .ot-game .abilities{ grid-template-columns:1fr 1fr; } }
  .ot-game .ability-card{ background:var(--surface); border:1px solid var(--border-soft); border-radius:12px; overflow:hidden; }
  .ot-game .ability-top{ display:flex; align-items:center; gap:12px; padding:11px 14px; background:var(--surface-2); }
  .ot-game .ability-score{
    width:38px; height:38px; border-radius:9px; background:var(--bg); border:1px solid var(--border);
    display:flex; align-items:center; justify-content:center; font-family:"JetBrains Mono"; font-weight:700; font-size:16px; flex:none;
  }
  .ot-game .ability-names{ flex:1; font-family:"Cinzel"; font-size:12px; letter-spacing:.04em; text-transform:uppercase; color:var(--ink); }
  .ot-game .ability-mod{ font-family:"JetBrains Mono"; font-weight:700; font-size:18px; color:var(--accent-bright); min-width:38px; text-align:right; }
  .ot-game .save-line{ display:flex; align-items:center; gap:7px; padding:8px 14px; font-size:11.5px; color:var(--ink-dim); border-top:1px dashed var(--border-soft); }
  .ot-game .save-line .sval{ font-family:"JetBrains Mono"; color:var(--ink); margin-left:auto; font-weight:600; }
  .ot-game .skills{ padding:2px 14px 8px; }
  .ot-game .skill-line{ display:flex; align-items:center; gap:7px; padding:5px 0; font-size:11.5px; color:var(--ink-dim); border-top:1px dashed var(--border-soft); }
  .ot-game .skill-line:first-child{ border-top:none; }
  .ot-game .dot{ width:7px; height:7px; border-radius:50%; border:1.3px solid var(--border); flex:none; }
  .ot-game .dot.on{ background:var(--p-gold); border-color:var(--p-gold); box-shadow:0 0 5px color-mix(in srgb, var(--p-gold) 55%, transparent); }
  .ot-game .dot.half{ border-color:var(--p-gold); background:linear-gradient(90deg, var(--p-gold) 50%, transparent 50%); }
  .ot-game .skill-line .sval{ font-family:"JetBrains Mono"; color:var(--ink); margin-left:auto; font-weight:600; }
  .ot-game .adv-badge{
    font-family:"JetBrains Mono"; font-size:8px; font-weight:700; letter-spacing:.03em;
    padding:2px 6px; border-radius:999px; border:1px solid; background:none;
  }
  .ot-game .adv-badge.adv{ color:var(--accent-bright); border-color:color-mix(in srgb, var(--accent-bright) 55%, transparent); }
  .ot-game .adv-badge.disadv{ color:#e0876a; border-color:color-mix(in srgb, #e0876a 55%, transparent); }

  /* attacks */
  .ot-game .atk-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px dashed var(--border-soft); }
  .ot-game .atk-row:first-child{ border-top:none; }
  .ot-game .atk-info{ flex:1; min-width:0; }
  .ot-game .atk-name{ color:var(--ink); font-weight:600; font-size:13px; }
  .ot-game .magic-badge{ font-size:9px; font-weight:700; color:var(--p-violet); letter-spacing:.02em; }
  .ot-game .atk-sub{ color:var(--ink-faint); font-size:10px; margin-top:2px; }
  .ot-game .atk-sub.atk-note{ color:var(--ink-dim); font-style:italic; margin-top:3px; }
  .ot-game .atk-chips{ display:flex; gap:8px; flex:none; margin-left:auto; }
  .ot-game .atk-chip{
    background:var(--surface-2); border:1px solid var(--border-soft); border-radius:8px;
    padding:6px 11px; text-align:center; min-width:56px;
  }
  .ot-game .atk-chip .ac-val{ font-family:"JetBrains Mono"; font-weight:700; font-size:14px; color:var(--accent-bright); white-space:nowrap; }
  .ot-game .atk-chip .ac-lbl{ font-size:7.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); margin-top:1px; }
  /* Phones: spell rows stack -- name, then tags on one line, then the
     description, then the to-hit/damage boxes -- so long names and tags
     don't squeeze the description into a narrow column. */
  @media(max-width:519px){
    .ot-game .spell-row{ flex-direction:column; align-items:stretch; gap:8px; }
    .ot-game .spell-row .atk-name{ display:flex; flex-wrap:wrap; align-items:center; column-gap:6px; }
    .ot-game .spell-row .spell-tags{ order:3; flex-basis:100%; display:flex; flex-wrap:wrap; gap:5px; margin:5px 0 4px; }
    .ot-game .spell-row .spell-tags:empty{ display:none; }
    .ot-game .spell-row .spell-tags .upcast-tag{ margin-left:0; }
    .ot-game .spell-row .exp-chevron{ order:2; }
    .ot-game .spell-row .atk-chips{ margin-left:0; }
  }

  /* resource trackers */
  .ot-game .resource{
    display:flex; align-items:center; justify-content:space-between; gap:9px;
    padding:10px 12px; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:9px; margin-bottom:9px;
  }
  .ot-game .resource .r-name{ font-size:12px; color:var(--ink); font-weight:600; }
  .ot-game .resource .r-reset{ font-size:10px; color:var(--ink-faint); display:block; font-weight:400; margin-top:2px; }
  .ot-game .pip-row{ display:flex; gap:8px; flex-wrap:wrap; flex:none; }
  .ot-game .charge{
    width:32px; height:32px; border-radius:7px; border:1.6px solid var(--p-violet); background:var(--p-violet);
    padding:0; display:inline-flex; align-items:center; justify-content:center;
    font-family:"JetBrains Mono"; font-weight:700; font-size:15px; color:transparent;
    box-shadow:0 0 8px color-mix(in srgb, var(--p-violet) 45%, transparent);
  }
  /* "used" shows an actual cross rather than relying on subtle fill/no-fill,
     matching how you'd cross a used slot off on paper */
  .ot-game .charge.used{ background:transparent; box-shadow:none; border-color:var(--border); color:var(--ink-faint); }

  /* features */
  .ot-game .feature{ border-top:1px dashed var(--border-soft); padding:10px 0; }
  .ot-game .feature:first-child{ border-top:none; padding-top:0; }
  .ot-game .feature h4{ font-family:"Source Serif 4"; font-weight:600; font-size:12.5px; color:var(--p-gold); margin-bottom:3px; }
  .ot-game .feature p{ margin:0; font-size:11.5px; line-height:1.55; color:var(--ink-dim); }

  /* spells */
  .ot-game .dc-row{ display:flex; gap:7px; margin-bottom:11px; }
  .ot-game .dc-chip{ flex:1; text-align:center; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:9px; padding:9px 3px; }
  .ot-game .dc-chip .v{ font-family:"JetBrains Mono"; font-weight:700; font-size:16px; color:var(--glow); }
  .ot-game .dc-chip .l{ font-size:8px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-faint); margin-top:2px; display:flex; align-items:center; justify-content:center; gap:3px; }
  .ot-game .spell-tier{ margin-top:12px; }
  .ot-game .tier-head{ margin-bottom:5px; }
  .ot-game .tname{ font-family:"Cinzel"; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--p-violet); }

  /* equipment */
  .ot-game .two-col{ display:grid; grid-template-columns:1fr; gap:14px; }
  @media(min-width:560px){ .ot-game .two-col{ grid-template-columns:1fr 1fr; } }
  .ot-game .plist{ list-style:none; margin:0; padding:0; font-size:11.5px; color:var(--ink-dim); }
  .ot-game .plist li{ padding:5px 0; border-top:1px dashed var(--border-soft); }
  .ot-game .plist li:first-child{ border-top:none; }
  .ot-game .prof-group{ margin-bottom:11px; }
  .ot-game .prof-group:last-child{ margin-bottom:0; }
  .ot-game .prof-group .pg-label{ font-family:"JetBrains Mono"; font-size:8.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:3px; }
  .ot-game .prof-group .pg-val{ font-size:11.5px; color:var(--ink-dim); line-height:1.5; }
  .ot-game .coins{ display:flex; gap:6px; margin-top:9px; cursor:pointer; }
  .ot-game .currency-row{ display:flex; align-items:center; gap:8px; margin-bottom:10px; }
  .ot-game .currency-row .cur-label{ width:30px; font-family:"JetBrains Mono"; font-weight:700; color:var(--gold); font-size:12.5px; flex:none; }
  .ot-game .currency-row .cur-current{ width:58px; font-size:9.5px; color:var(--ink-faint); flex:none; }
  .ot-game .currency-row .stepper-row{ flex:1; margin-bottom:0; }
  .ot-game .coin{ flex:1; text-align:center; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:7px; padding:6px 3px; }
  .ot-game .coin .cv{ font-family:"JetBrains Mono"; font-weight:700; font-size:12.5px; color:var(--p-gold); }
  .ot-game .coin .cl{ font-size:8px; color:var(--ink-faint); letter-spacing:.04em; }

  .ot-game .notesArea{ width:100%; min-height:80px; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:8px; color:var(--ink); font-family:inherit; font-size:12.5px; padding:9px; resize:vertical; }
  .ot-game .sync-tag{ font-size:10px; color:var(--ink-faint); text-align:center; margin-top:12px; }
  .ot-game .sync-tag.pending{ color:var(--p-gold); }
  .ot-game .sync-tag.err{ color:#e08a6a; }

  /* dark-themed popups: damage/heal, beast stat blocks -- inherit the
     play sheet's own accent theme via inline CSS vars (see applyPlayTheme) */
  .ot-game .dark-modal-card{
    background:var(--bg); border:1px solid var(--border); border-radius:16px; color:var(--ink);
    padding:18px 18px 20px; max-width:480px; width:100%; position:relative;
    max-height:88vh; overflow-y:auto;
  }
  .ot-game .dark-modal-card h2{ font-size:16px; color:var(--ink); margin-bottom:2px; }
  .ot-game .dark-modal-card .dm-sub{ font-size:11px; color:var(--accent-bright); text-transform:uppercase; letter-spacing:.05em; margin-bottom:14px; }
  .ot-game .dark-modal-card label{ display:block; font-size:11px; color:var(--ink-faint); margin-bottom:4px; }
  .ot-game .dark-modal-card input[type=number], .ot-game .dark-modal-card select{
    width:100%; padding:9px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface-2);
    color:var(--ink); font-size:15px; margin-bottom:12px;
  }
  /* Native spinner arrows are tiny and easy to miss on a phone -- replaced
     by the full-size stepper buttons in .stepper-row instead. */
  .ot-game input[type=number]::-webkit-outer-spin-button,
  .ot-game input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
  .ot-game input[type=number]{ -moz-appearance:textfield; }
  .ot-game .stepper-row{ display:flex; align-items:center; gap:8px; margin-bottom:12px; }
  .ot-game .stepper-row input[type=number]{ margin-bottom:0; text-align:center; flex:1; font-weight:700; font-size:18px; }
  .ot-game .stepper-btn{
    width:46px; height:46px; border-radius:10px; border:1.5px solid var(--border); background:var(--surface-2);
    color:var(--glow); font-family:"JetBrains Mono"; font-size:22px; font-weight:700; flex:none; line-height:1;
  }
  .ot-game .defense-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
  .ot-game .defense-tag{ font-size:10.5px; padding:3px 9px; border-radius:999px; border:1px solid var(--border); background:var(--surface-2); color:var(--ink-dim); }
  .ot-game .defense-tag.resist{ color:var(--accent-bright); border-color:color-mix(in srgb, var(--accent-bright) 50%, var(--border)); }
  .ot-game .defense-tag.vuln{ color:#e0876a; border-color:color-mix(in srgb, #e0876a 50%, var(--border)); }
  .ot-game .defense-tag.immune{ color:var(--p-violet, var(--glow)); border-color:color-mix(in srgb, var(--glow) 50%, var(--border)); }
  .ot-game .dm-computed{
    background:var(--surface-2); border:1px solid var(--border-soft); border-radius:10px; padding:11px 13px; margin-bottom:14px;
    font-size:13px; color:var(--ink-dim);
  }
  .ot-game .dm-computed b{ color:var(--ink); font-family:"JetBrains Mono"; font-size:17px; }
  .ot-game .dm-actions{ display:flex; gap:8px; }
  .ot-game .dm-actions button{ flex:1; padding:12px; border-radius:9px; border:none; font-family:"Cinzel"; font-weight:700; font-size:13px; letter-spacing:.03em; }
  .ot-game .dm-apply{ background:var(--accent); color:#111; }
  .ot-game .dm-apply.dmg{ background:#c96a45; color:#fff; }
  .ot-game .dm-cancel{ background:var(--surface-2); color:var(--ink-dim); border:1px solid var(--border) !important; }
  .ot-game .dm-apply:disabled{ opacity:.45; cursor:default; }
  .ot-game .dm-note{ color:var(--ink-faint); font-size:11.5px; }

  /* ---- Wheel picker ("spinner"): scroll-snapping list, touch-first ---- */
  .ot-game .seg{ display:flex; gap:3px; padding:3px; margin-bottom:12px; background:var(--surface-2); border:1px solid var(--border); border-radius:11px; }
  .ot-game .seg-btn{ flex:1; min-height:42px; padding:8px 6px; border:none; border-radius:8px; background:transparent; color:var(--ink-dim); font-family:"Cinzel"; font-weight:700; font-size:12.5px; letter-spacing:.03em; }
  .ot-game .seg-btn.on{ background:var(--accent); color:#111; }
  .ot-game #hpMode .seg-btn.on[data-v=damage]{ background:#c96a45; color:#fff; }
  .ot-game .wheel-row{ display:flex; gap:10px; margin-bottom:6px; }
  .ot-game .wheel-col-amount{ flex:0 0 38%; min-width:0; }
  .ot-game .wheel-col-type{ flex:1; min-width:0; }
  .ot-game .wheel{ position:relative; overflow:hidden; border-radius:12px; background:var(--surface-2); border:1px solid var(--border); }
  .ot-game .wheel-track{
    height:100%; overflow-y:auto; scroll-snap-type:y mandatory; overscroll-behavior:contain;
    touch-action:pan-y; -webkit-overflow-scrolling:touch; scrollbar-width:none; outline:none;
    -webkit-mask-image:linear-gradient(to bottom, transparent 0, #000 32%, #000 68%, transparent 100%);
            mask-image:linear-gradient(to bottom, transparent 0, #000 32%, #000 68%, transparent 100%);
  }
  .ot-game .wheel-track::-webkit-scrollbar{ display:none; }
  .ot-game .wheel-track:focus-visible{ box-shadow:inset 0 0 0 2px var(--accent-bright); border-radius:12px; }
  .ot-game .wheel-item{
    height:40px; line-height:40px; padding:0 6px; text-align:center; scroll-snap-align:center; scroll-snap-stop:normal;
    font-family:"JetBrains Mono"; font-size:16px; color:var(--ink-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    user-select:none; -webkit-user-select:none; cursor:pointer; transition:color .12s, font-size .12s;
  }
  .ot-game .wheel-item.sel{ color:var(--ink); font-size:22px; font-weight:700; }
  .ot-game .wheel-text .wheel-item{ font-family:inherit; font-size:13.5px; }
  .ot-game .wheel-text .wheel-item.sel{ font-size:15.5px; }
  .ot-game .wheel-item.resist{ color:color-mix(in srgb, var(--accent-bright) 75%, var(--ink-faint)); }
  .ot-game .wheel-item.vuln{ color:#e0876a; }
  .ot-game .wheel-item.immune{ color:var(--glow); }
  .ot-game .wheel-tag{ font-size:9px; text-transform:uppercase; letter-spacing:.05em; margin-left:5px; padding:1px 5px; border-radius:999px; border:1px solid currentColor; vertical-align:2px; }
  .ot-game .wheel-lens{
    position:absolute; left:5px; right:5px; top:50%; height:40px; transform:translateY(-50%); pointer-events:none; border-radius:8px;
    background:color-mix(in srgb, var(--accent) 13%, transparent); border:1px solid color-mix(in srgb, var(--accent-bright) 40%, var(--border));
  }
  .ot-game .dark-modal-card input.wheel-input{
    position:absolute; left:5px; right:5px; top:50%; transform:translateY(-50%); z-index:2; width:auto; height:40px; margin:0;
    padding:0 6px; text-align:center; font-family:"JetBrains Mono"; font-size:20px; font-weight:700; border-color:var(--accent-bright);
  }
  .ot-game .wheel-hint{ text-align:center; font-size:10.5px !important; color:var(--ink-faint); margin:0 0 10px !important; }
  .ot-game .coin-wheels{ display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:6px; margin-bottom:6px; }
  .ot-game .coin-label{ text-align:center; font-family:"JetBrains Mono"; font-weight:700; font-size:12px; color:var(--gold); margin-bottom:4px; }
  .ot-game .coin-have{ text-align:center; font-size:10px; color:var(--ink-faint); margin-top:4px; }
  .ot-game .coin-col .wheel-item{ font-size:14px; padding:0 2px; }
  .ot-game .coin-col .wheel-item.sel{ font-size:19px; }
  .ot-game .coin-col .wheel-lens{ left:3px; right:3px; }
  .ot-game .dark-modal-card .coin-col input.wheel-input{ left:3px; right:3px; font-size:17px; padding:0 2px; }
  .ot-game .dark-modal-close{
    position:absolute; top:12px; right:12px; width:38px; height:38px; border-radius:50%;
    background:var(--surface-2); border:1px solid var(--border); color:var(--ink-faint); font-size:17px; line-height:1;
  }

  /* full-description markdown -- reused by the in-place expand panels below
     (spells & features), not a popup anymore. Falls back to the parchment
     palette when these vars aren't defined (e.g. the public spell library,
     which isn't wrapped in the dark playsheet theme), so this same CSS
     works correctly in both contexts without needing a duplicate set. */
  .ot-game .md-content{ font-size:13px; line-height:1.65; color:var(--ink-dim, var(--p-ink-dim)); text-align:left; }
  .ot-game .md-content p{ margin:0 0 11px; }
  .ot-game .md-content p:last-child{ margin-bottom:0; }
  .ot-game .md-content strong{ color:var(--ink, var(--p-ink)); font-weight:700; }
  .ot-game .md-content em{ font-style:italic; }
  .ot-game .md-content ul, .ot-game .md-content ol{ margin:0 0 11px; padding-left:20px; }
  .ot-game .md-content li{ margin-bottom:4px; }
  .ot-game .md-content blockquote{
    margin:0 0 11px; padding:9px 13px; border-left:3px solid var(--accent, var(--p-brand)); background:var(--surface-2, var(--p-bg-2));
    border-radius:0 8px 8px 0; color:var(--ink-dim, var(--p-ink-dim)); font-style:italic;
  }
  .ot-game .md-content table{ width:100%; border-collapse:collapse; margin:0 0 11px; font-size:12px; }
  .ot-game .md-content th, .ot-game .md-content td{ border:1px solid var(--border-soft, var(--p-border-soft)); padding:6px 8px; text-align:left; }
  .ot-game .md-content th{ background:var(--surface-2, var(--p-bg-2)); color:var(--ink, var(--p-ink)); font-weight:700; }

  /* spells/features that have a full description -- small chevron affordance,
     and a slightly different active-state so tapping feels responsive. Same
     dark/light fallback pattern as .md-content above. */
  .ot-game .expandable{ cursor:pointer; }
  .ot-game .expandable:active{ background:var(--surface-2, var(--p-bg-2)); }
  .ot-game .exp-chevron{
    display:inline-block; color:var(--ink-faint, var(--p-ink-faint)); font-size:11px; margin-left:6px; flex:none;
    transition:transform 0.25s ease;
  }
  .ot-game .exp-chevron.open{ transform:rotate(90deg); color:var(--accent-bright, var(--p-brand)); }

  /* upcast tag -- a spell filed in a higher slot than its own base level,
     nudging players to check the full description for anything that
     doesn't scale as simple extra dice (Magic Missile's extra dart etc.) */
  .ot-game .upcast-tag{
    display:inline-block; font-family:"JetBrains Mono"; font-size:8px; font-weight:700; letter-spacing:.02em;
    color:var(--gold); border:1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius:999px;
    padding:2px 6px; margin-left:6px; vertical-align:middle;
  }

  /* Forge ability score rows (Determine Ability Scores step) -- name +
     optional spellcasting tag, a short functional description, then the
     control/background-bonus/final-score line. No prior styling existed
     here at all (plain unstyled divs), so this is a fresh layout. */
  .ot-game .score-grid{ display:flex; flex-direction:column; gap:14px; }
  .ot-game .score-row{ padding-bottom:12px; border-bottom:1px dashed var(--p-border-soft); }
  .ot-game .score-row:last-child{ border-bottom:none; padding-bottom:0; }
  .ot-game .score-row .sr-head{ display:flex; align-items:center; margin-bottom:2px; }
  .ot-game .score-row .sr-name{ font-family:"Cinzel"; font-weight:700; font-size:13px; color:var(--p-ink); }
  .ot-game .score-row .sr-desc{ font-size:11px; color:var(--p-ink-faint); margin-bottom:8px; line-height:1.4; }
  .ot-game .score-row .sr-controls{ display:flex; align-items:center; gap:10px; }
  .ot-game .score-row .sr-control{ flex:1; }
  .ot-game .score-row .sr-control select{ width:100%; }
  .ot-game .score-row .sr-bonus{ font-size:11px; color:var(--p-brand); min-width:40px; text-align:right; }
  .ot-game .score-row .sr-final{ font-size:13px; font-weight:700; color:var(--p-ink); min-width:60px; text-align:right; }

  /* Standard Array / Roll for Scores dropdowns -- matching .forge-cta-btn's
     look (same gradient, border, and Cinzel weight) instead of a bare
     browser-default select sitting oddly next to those buttons. appearance:none
     strips the native control entirely, including its own dropdown arrow, so
     a custom chevron is drawn back in via background-image (an inline SVG,
     since a <select> can't reliably take a ::after pseudo-element for this
     across browsers) rather than left with no affordance that it's a dropdown. */
  .ot-game .score-row .sr-control select{
    width:100%; -webkit-appearance:none; appearance:none; cursor:pointer;
    padding:11px 34px 11px 16px; border-radius:11px; border:1.5px solid var(--p-brand);
    background:linear-gradient(135deg, color-mix(in srgb, var(--p-brand) 14%, var(--p-panel)), var(--p-panel))
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a3b30' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    color:var(--p-brand); font-family:"Cinzel"; font-weight:700; font-size:14px; letter-spacing:.02em;
    box-shadow:0 3px 10px rgba(60,40,15,0.12);
  }
  .ot-game .score-row .sr-control select:focus{ outline:none; box-shadow:0 0 0 2px color-mix(in srgb, var(--p-brand) 35%, transparent); }

  /* Point Buy's +/- stepper -- unique to the Forge, no existing button
     styling to clash with (the play sheet's own HP/damage steppers use
     completely different class names). A disabled state that's actually
     visible matters here specifically: hitting Point Buy's rules-mandated
     cap of 15 looks identical to running out of points otherwise, so the
     two need to read differently at a glance. */
  .ot-game .stepper{ display:inline-flex; align-items:center; gap:8px; }
  .ot-game .stepper .btn.ghost.sm{
    width:28px; height:28px; border-radius:7px; border:1px solid var(--p-border);
    background:var(--p-panel); color:var(--p-ink); font-size:15px; line-height:1;
  }
  .ot-game .stepper .btn.ghost.sm:disabled{ opacity:.35; cursor:not-allowed; background:var(--p-bg-2); }
  .ot-game .stepper .stepper-val{ min-width:22px; text-align:center; font-size:14px; font-weight:700; color:var(--p-ink); }
  .ot-game .stepper .stepper-note{ font-size:10px; color:var(--p-ink-faint); font-style:italic; margin-left:2px; white-space:nowrap; }

  /* the in-place expand panel itself -- height-animated via JS (measuring
     scrollHeight) rather than a fixed max-height, so it looks right whether
     the full description is one line or a whole table. Collapsed by default
     (max-height:0), and pushes the rest of the page down as it opens since
     it's a normal block in the document flow, not an overlay. */
  .ot-game .expand-panel{ max-height:0; overflow:hidden; transition:max-height 0.3s ease; }
  .ot-game .expand-panel .expand-content{ padding:10px 2px 4px; border-top:1px dashed var(--border-soft); margin-top:2px; }

  /* beast stat block */
  .ot-game .beast-stat h3{ font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--gold); margin:12px 0 6px; border-bottom:1px solid var(--border-soft); padding-bottom:4px; }
  .ot-game .beast-stat h3:first-of-type{ margin-top:0; }
  .ot-game .beast-abilities{ display:grid; grid-template-columns:repeat(6,1fr); gap:5px; }
  .ot-game .beast-abilities div{ text-align:center; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:7px; padding:6px 2px; }
  .ot-game .beast-abilities .ba-abbr{ font-size:8px; color:var(--ink-faint); text-transform:uppercase; }
  .ot-game .beast-abilities .ba-val{ font-family:"JetBrains Mono"; font-weight:700; font-size:13px; }
  .ot-game .beast-meta{ font-size:11.5px; color:var(--ink-dim); line-height:1.6; }
  .ot-game .beast-trait{ font-size:12px; margin-bottom:8px; line-height:1.5; }
  .ot-game .beast-trait b{ color:var(--ink); }
  .ot-game .beast-action{ font-size:12px; margin-bottom:8px; line-height:1.5; }
  .ot-game .beast-action .ba-name{ color:var(--ink); font-weight:700; }
  .ot-game .beast-action .ba-nums{ font-family:"JetBrains Mono"; color:var(--accent-bright); font-size:11px; }

  /* wild shape forms -- compact name-only grid so a large linked roster
     stays scannable at 2-4 columns instead of a long vertical list */
  .ot-game .forms-filter{
    width:100%; margin-bottom:10px; padding:9px 11px; border-radius:8px;
    border:1px solid var(--border); background:var(--surface-2); color:var(--ink); font-size:13px;
  }
  .ot-game .forms-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(80px, 1fr)); gap:8px; }
  .ot-game .form-pill{
    display:flex; align-items:center; justify-content:center; text-align:center;
    min-height:50px; padding:8px 6px; border-radius:9px; font-family:inherit;
    background:var(--surface-2); border:1px solid var(--border-soft); color:var(--ink);
    font-size:11.5px; font-weight:600; line-height:1.25;
  }
  .ot-game .form-pill:active{ background:var(--surface); border-color:var(--accent); }

  /* ===================== ADMIN ===================== */
  .ot-game .admin-login{ max-width:340px; margin:60px auto; background:var(--p-panel); border:1px solid var(--p-border); border-radius:12px; padding:24px; text-align:center; }
  .ot-game .admin-login input{ width:100%; padding:10px; border:1px solid var(--p-border); border-radius:8px; margin:14px 0; font-size:14px; }
  .ot-game .admin-login button{ width:100%; padding:11px; border-radius:8px; border:none; background:var(--p-brand); color:#fff; font-weight:700; font-family:"Cinzel"; letter-spacing:.03em; }
  .ot-game .admin-err{ color:var(--ember); font-size:12px; margin-top:6px; }

  .ot-game .admin-roster{ display:flex; flex-direction:column; gap:8px; }
  .ot-game .admin-row{
    display:flex; align-items:center; gap:12px; background:var(--p-panel); border:1px solid var(--card-accent-visible, var(--card-accent, var(--p-border)));
    border-radius:10px; padding:10px 12px;
  }
  .ot-game .admin-row .thumb{ width:40px; height:40px; border-radius:50%; object-fit:cover; border:2px solid var(--card-accent-visible, var(--card-accent, var(--gold))); background:var(--p-bg-2); flex:none; }
  .ot-game .admin-row .an{ font-weight:700; font-size:13.5px; }
  .ot-game .admin-row .as{ font-size:11px; color:var(--p-ink-faint); }
  .ot-game .admin-row .aactions{ margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
  .ot-game .admin-row button{ font-size:11.5px; padding:6px 10px; border-radius:6px; border:1px solid var(--p-border); background:var(--p-bg-2); color:var(--p-ink); }
  .ot-game .admin-row button.danger{ color:var(--ember); border-color:var(--ember); }
  .ot-game .chip-grid.prereq-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); gap:6px; }
  .ot-game .chip-grid.prereq-grid .pick-card{ margin:0; align-items:center; }
  .ot-game .chip-grid.prereq-grid .pick-card input{ margin-top:0; }
  .ot-game .admin-row .as.prereq-line{ color:var(--p-brand); font-style:italic; margin-top:1px; }
  .ot-game .prereq-warn{ display:inline-block; font-size:11px; color:var(--ember); font-weight:600; margin-top:2px; }
  .ot-game .src-tag{ display:inline-block; font-family:"JetBrains Mono"; font-size:9px; font-weight:700; letter-spacing:.03em; padding:1px 6px; border-radius:4px; background:var(--p-bg-2); border:1px solid var(--p-border); color:var(--p-ink-faint); vertical-align:2px; margin-left:4px; cursor:help; }
  .ot-game .ft-level-tag{ display:inline-block; font-family:"JetBrains Mono"; font-size:9.5px; font-weight:700; padding:1px 6px; border-radius:999px; border:1px solid var(--p-brand); color:var(--p-brand); vertical-align:1px; }
  .ot-game .admin-row button.lvl-variant-btn{ border-style:dashed; color:var(--p-ink-faint); }
  .ot-game .admin-row button.lvl-variant-btn.has{ border-style:solid; border-color:var(--p-brand); color:var(--p-brand); font-weight:700; }
  .ot-game .lvl-variant-banner{ display:flex; gap:12px; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; background:var(--p-panel); border:1px solid var(--p-brand); border-left-width:4px; border-radius:10px; padding:12px 14px; margin-bottom:14px; font-size:12.5px; line-height:1.5; color:var(--p-ink); }
  .ot-game .lvl-variant-banner > div:first-child{ flex:1 1 280px; }
  .ot-game .lvl-variant-banner-actions{ display:flex; gap:6px; flex-wrap:wrap; }
  .ot-game .lvl-variant-banner-actions button{ font-size:11.5px; padding:6px 10px; border-radius:6px; border:1px solid var(--p-border); background:var(--p-bg-2); color:var(--p-ink); }
  .ot-game .lvl-variant-banner-actions button.danger{ color:var(--ember); border-color:var(--ember); }
  .ot-game .lvl-variant-empty{ max-width:480px; margin:40px auto; background:var(--p-panel); border:1px solid var(--p-border); border-radius:12px; padding:24px; text-align:center; }
  .ot-game .lvl-variant-empty h2{ font-size:17px; margin-bottom:10px; }
  .ot-game .lvl-variant-empty p{ font-size:13px; color:var(--p-ink-faint); line-height:1.55; margin-bottom:10px; }
  .ot-game .lvl-variant-create{ display:block; width:100%; margin-top:14px; padding:13px; border-radius:9px; border:none; background:var(--p-brand); color:#fff; font-family:"Cinzel"; font-weight:700; font-size:14px; letter-spacing:.03em; }
  .ot-game .lvl-variant-cancel{ display:block; width:100%; margin-top:8px; padding:10px; border-radius:9px; border:1px solid var(--p-border); background:transparent; color:var(--p-ink); font-size:12.5px; }
  .ot-game #af-level:disabled{ opacity:.6; cursor:not-allowed; }
  .ot-game .admin-new-btn{
    padding:11px; border-radius:9px; border:1.5px dashed var(--p-brand); background:transparent; color:var(--p-brand);
    font-family:"Cinzel"; font-weight:700; font-size:12.5px; letter-spacing:.03em; text-transform:uppercase; margin-bottom:14px;
  }
  .ot-game .admin-hub-grid{ display:grid; grid-template-columns:1fr; gap:12px; }
  @media(min-width:520px){ .ot-game .admin-hub-grid{ grid-template-columns:1fr 1fr; } }
  .ot-game .admin-hub-card{
    text-align:left; padding:18px 16px; border-radius:12px; border:1px solid var(--p-border);
    background:var(--p-panel); box-shadow:0 2px 8px rgba(60,40,15,0.08);
  }
  .ot-game .admin-hub-card:active{ border-color:var(--p-brand); }
  .ot-game .admin-hub-card .ahc-icon{ font-size:22px; margin-bottom:6px; }
  .ot-game .admin-hub-card .ahc-label{ font-family:"Cinzel"; font-weight:700; font-size:13.5px; color:var(--p-ink); }
  .ot-game .admin-hub-card .ahc-sub{ font-size:11px; color:var(--p-ink-faint); margin-top:4px; line-height:1.4; }
  /* spell library list toolbar -- "+ New Spell" on the left, level filter
     and name search right-aligned as a pair (filter first, search last,
     furthest right), wrapping onto their own row on narrow phones rather
     than squashing. */
  .ot-game .spell-list-toolbar{
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    flex-wrap:wrap; margin-bottom:14px;
  }
  .ot-game .spell-list-filters{ display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; }
  .ot-game .spell-list-filters select{ width:auto; min-width:112px; }
  .ot-game .spell-list-filters input[type=text]{ width:auto; min-width:150px; }

  /* admin editor form */
  .ot-game .aform fieldset{ border:1px solid var(--p-border-soft); border-radius:10px; margin:0 0 14px; padding:12px 14px 14px; background:var(--p-panel); }
  .ot-game .aform legend{ font-family:"Cinzel"; font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--p-brand); padding:0 6px; }
  .ot-game .aform .frow{ display:flex; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
  .ot-game .aform .frow > div{ flex:1; min-width:80px; }
  .ot-game .aform label{ display:block; font-size:10.5px; color:var(--p-ink-faint); margin-bottom:2px; }
  .ot-game .aform input[type=text], .ot-game .aform input[type=number], .ot-game .aform input[type=color], .ot-game .aform textarea, .ot-game .aform select{
    width:100%; padding:6px 7px; border:1px solid var(--p-border); border-radius:6px; font-size:13.5px; background:#fff; color:var(--p-ink);
  }
  .ot-game .aform textarea{ resize:vertical; min-height:38px; }
  .ot-game .aform input[type=color]{ padding:2px; height:32px; }
  .ot-game .aform .chk{ display:flex; align-items:center; gap:5px; font-size:11.5px; color:var(--p-ink-dim); margin-top:3px; }
  .ot-game .adv-cycle-btn{
    min-width:56px; height:26px; padding:0 8px; border-radius:999px; border:1.5px dashed var(--p-brand);
    background:#fff; font-size:9.5px; font-weight:700; letter-spacing:.03em; color:var(--p-brand); flex:none;
  }
  .ot-game .adv-cycle-btn.adv{ border-style:solid; background:#2f7a2f; border-color:#2f7a2f; color:#fff; }
  .ot-game .adv-cycle-btn.disadv{ border-style:solid; background:#a13a3a; border-color:#a13a3a; color:#fff; }
  .ot-game .class-swatch-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
  .ot-game .class-swatch{
    padding:7px 12px; border-radius:999px; border:none; font-size:11px; font-weight:700;
    letter-spacing:.02em; cursor:pointer; box-shadow:0 1px 3px rgba(0,0,0,0.2);
  }
  .ot-game .class-swatch:active{ transform:scale(0.95); }
  /* spell library lookup in the character editor */
  .ot-game .spell-search-input{ margin-bottom:0; }
  .ot-game .spell-search-results{ display:flex; flex-direction:column; gap:4px; margin-top:6px; }
  .ot-game .spell-search-result{
    text-align:left; padding:8px 10px; border-radius:7px; border:1px solid var(--p-border-soft);
    background:#fff; font-size:12.5px; color:var(--p-ink);
  }
  .ot-game .spell-search-result:active{ background:var(--p-bg-2); }
  .ot-game .spell-linked-badge{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:9px 11px; border-radius:8px; background:var(--p-bg-2); border:1px solid var(--p-border-soft);
  }
  .ot-game .spell-linked-badge b{ color:var(--p-ink); font-size:13px; }
  .ot-game .aform .chk input{ width:auto; }
  .ot-game .item-card{ border:1px dashed var(--p-border); border-radius:8px; padding:9px 10px; margin-bottom:8px; position:relative; background:var(--p-bg-2); }
  .ot-game .item-card .rm{
    position:absolute; top:6px; right:6px; width:18px; height:18px; border-radius:50%;
    border:1px solid var(--p-border); background:#fff; font-size:11px; line-height:1; color:var(--ember); padding:0;
  }
  .ot-game .reorder-btns{ display:flex; gap:6px; margin-bottom:9px; }
  .ot-game .reorder-btn{
    width:38px; height:30px; border-radius:7px; border:1px solid var(--p-border); background:#fff;
    color:var(--p-brand); font-size:12px; line-height:1; padding:0;
  }
  .ot-game .reorder-btn:disabled{ opacity:.3; }
  .ot-game .addbtn{ width:100%; padding:7px; border:1px dashed var(--p-brand); border-radius:7px; background:#fff; color:var(--p-brand); font-size:12px; font-weight:600; }
  .ot-game .sublevel{ border-left:2px solid var(--p-border); padding-left:10px; margin-top:6px; }
  .ot-game .small-note{ font-size:10.5px; color:var(--p-ink-faint); margin:-4px 0 8px; }
  .ot-game .save-bar{ position:sticky; bottom:0; background:var(--p-bg); border-top:1px solid var(--p-border); padding:12px 0; display:flex; gap:8px; margin-top:6px; }
  .ot-game .save-bar button{ flex:1; padding:12px; border-radius:9px; border:none; font-family:"Cinzel"; font-weight:700; font-size:13px; letter-spacing:.03em; }
  .ot-game .save-bar .save-btn{ background:var(--p-brand); color:#fff; }
  .ot-game .save-bar .cancel-btn{ background:var(--p-bg-2); color:var(--p-ink-dim); border:1px solid var(--p-border); }
  .ot-game .save-status{ text-align:center; font-size:11.5px; color:var(--p-ink-faint); margin-top:6px; }
  /* ===================== CHARACTER FORGE (public, parchment theme) ===================== */
  .ot-game .forge-cta-row{ display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
  .ot-game .forge-cta-btn{
    display:inline-block; padding:13px 22px; border-radius:11px; border:1.5px solid var(--p-brand);
    background:linear-gradient(135deg, color-mix(in srgb, var(--p-brand) 14%, var(--p-panel)), var(--p-panel));
    color:var(--p-brand); font-family:"Cinzel"; font-weight:700; font-size:13px; letter-spacing:.02em;
    box-shadow:0 3px 10px rgba(60,40,15,0.12);
  }
  .ot-game .forge-cta-btn.secondary{
    border-color:var(--p-border); background:var(--p-panel); color:var(--p-ink-dim); box-shadow:none;
  }
  .ot-game .forge-cta-btn:active{ transform:translateY(1px); }
  .ot-game .forge-cta-btn:disabled{ opacity:.45; cursor:not-allowed; }
  .ot-game .forge-cta-btn:disabled:active{ transform:none; }
  .ot-game .forge-wrap{ max-width:720px; margin:0 auto; }
  .ot-game .forge-progress{ display:flex; gap:4px; margin-bottom:18px; flex-wrap:wrap; }
  .ot-game .forge-progress .fp-dot{
    flex:1; min-width:18px; height:5px; border-radius:999px; background:var(--p-border-soft);
  }
  .ot-game .forge-progress .fp-dot.done{ background:var(--p-brand); }
  .ot-game .forge-progress .fp-dot.current{ background:var(--gold); }
  .ot-game .step-head{ margin-bottom:6px; }
  .ot-game .step-label{ display:block; font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--p-brand); margin-bottom:2px; }
  .ot-game .step-head h2{ font-family:"Cinzel"; font-size:19px; color:var(--p-ink); }
  .ot-game .lede{ font-size:13px; color:var(--p-ink-dim); margin-bottom:16px; line-height:1.5; }
  .ot-game .muted{ color:var(--p-ink-faint); }
  .ot-game .small{ font-size:11.5px; }
  .ot-game .mono{ font-family:"JetBrains Mono"; }

  .ot-game .card-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:8px; margin-bottom:14px; }
  .ot-game .card-grid.align{ grid-template-columns:repeat(auto-fill, minmax(170px,1fr)); }
  .ot-game .card-grid.subclass{ grid-template-columns:repeat(auto-fill, minmax(200px,1fr)); }
  .ot-game .opt-card{
    text-align:left; border:1px solid var(--p-border); background:var(--p-panel); border-radius:9px;
    padding:10px 12px; cursor:pointer; transition:border-color .12s ease, background .12s ease;
  }
  .ot-game .opt-card:active{ border-color:var(--p-brand); }
  .ot-game .opt-card.sel{ border-color:var(--p-brand); background:color-mix(in srgb, var(--p-brand) 10%, var(--p-panel)); }
  .ot-game .opt-name{ font-weight:700; font-size:13.5px; color:var(--p-ink); }
  .ot-game .opt-sub{ font-size:11px; color:var(--p-ink-faint); margin-top:3px; }

  .ot-game .detail-block{ background:var(--p-bg-2); border:1px solid var(--p-border-soft); border-radius:10px; padding:14px; margin-top:8px; }
  .ot-game .stat-strip{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
  .ot-game .stat-chip{ background:var(--p-panel); border:1px solid var(--p-border-soft); border-radius:8px; padding:7px 11px; text-align:center; flex:1; min-width:84px; }
  .ot-game .stat-chip .sc-label{ font-size:8.5px; letter-spacing:.05em; text-transform:uppercase; color:var(--p-ink-faint); }
  .ot-game .stat-chip .sc-val{ font-weight:700; font-size:13px; color:var(--p-ink); margin-top:2px; }

  .ot-game .section-title{ margin:16px 0 8px; }
  .ot-game .section-title h3{ font-family:"Cinzel"; font-size:13.5px; color:var(--p-brand); }
  .ot-game .section-title p{ font-size:11.5px; color:var(--p-ink-faint); margin-top:2px; }

  .ot-game .chip-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(190px,1fr)); gap:8px; }
  .ot-game .pick-list{ display:flex; flex-direction:column; gap:8px; }
  .ot-game .pick-card{
    display:flex; gap:10px; align-items:flex-start; border:1px solid var(--p-border); background:var(--p-panel);
    border-radius:9px; padding:10px 12px; cursor:pointer;
  }
  .ot-game .pick-card.sel{ border-color:var(--p-brand); background:color-mix(in srgb, var(--p-brand) 10%, var(--p-panel)); }
  .ot-game .pick-card.small{ padding:8px 10px; }
  .ot-game .pick-card.disabled{ opacity:.4; cursor:not-allowed; }
  .ot-game .pick-card input{ margin-top:3px; accent-color:var(--p-brand); flex-shrink:0; }
  .ot-game .pick-label{ font-weight:600; font-size:12.5px; color:var(--p-ink); }
  .ot-game .pick-sub{ font-size:11px; color:var(--p-ink-faint); margin-top:2px; }

  .ot-game .feature-list{ display:flex; flex-direction:column; gap:9px; }
  .ot-game .feature-row{ border-top:1px dashed var(--p-border-soft); padding-top:8px; }
  .ot-game .feature-row:first-child{ border-top:none; padding-top:0; }
  .ot-game .feature-row .fr-name{ font-weight:700; font-size:12.5px; color:var(--p-ink); }
  .ot-game .feature-row .fr-desc{ font-size:11.5px; color:var(--p-ink-dim); margin-top:2px; line-height:1.5; }

  .ot-game .detail-form{ display:flex; flex-direction:column; gap:14px; }
  .ot-game .field{ display:flex; flex-direction:column; gap:5px; }
  .ot-game .field-label{ font-size:11.5px; font-weight:600; color:var(--p-ink-dim); }
  .ot-game .field textarea, .ot-game .field input[type=text]{
    border:1px solid var(--p-border); border-radius:8px; padding:9px 11px;
    background:var(--p-panel); color:var(--p-ink); resize:vertical; font-size:13px;
  }

  .ot-game .forge-actions{ display:flex; justify-content:space-between; gap:10px; margin-top:22px; }
  .ot-game .forge-actions button{ flex:1; }

  /* final summary sheet */
  .ot-game .sheet{ background:var(--p-panel); border:1px solid var(--p-border); border-radius:12px; padding:18px; }
  .ot-game .sheet-header h2{ font-family:"Cinzel"; font-size:20px; color:var(--p-ink); }
  .ot-game .sheet-stats{ display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 4px; }
  .ot-game .sheet-stat{ background:var(--p-bg-2); border:1px solid var(--p-border-soft); border-radius:8px; padding:8px 10px; text-align:center; flex:1; min-width:76px; }
  .ot-game .sheet-stat .ss-val{ font-weight:700; font-size:15px; color:var(--p-ink); }
  .ot-game .sheet-stat .ss-label{ font-size:8px; letter-spacing:.05em; text-transform:uppercase; color:var(--p-ink-faint); margin-top:2px; }
  .ot-game .sheet-scores{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0; }
  .ot-game .sheet-score{ background:var(--p-bg-2); border:1px solid var(--p-border-soft); border-radius:8px; padding:8px; text-align:center; }
  .ot-game .sheet-score .ssc-label{ font-size:9px; color:var(--p-ink-faint); }
  .ot-game .sheet-score .ssc-val{ font-weight:700; font-size:16px; color:var(--p-ink); margin:2px 0; }
  .ot-game .sheet-score .ssc-mod{ font-size:11px; color:var(--p-brand); }
  .ot-game .sheet-cols{ display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:14px; }
  @media(min-width:520px){ .ot-game .sheet-cols{ grid-template-columns:1fr 1fr; } }
  .ot-game .sheet-col h4{ font-family:"Cinzel"; font-size:12px; color:var(--p-brand); margin-bottom:6px; }
  .ot-game .prof-row{ display:flex; justify-content:space-between; padding:4px 0; font-size:12px; color:var(--p-ink-faint); border-top:1px dotted var(--p-border-soft); }
  .ot-game .prof-row:first-of-type{ border-top:none; }
  .ot-game .prof-row.prof{ color:var(--p-ink); font-weight:600; }
  .ot-game .prof-row.exp{ color:var(--p-brand); }
  .ot-game .prof-row.half{ color:var(--p-ink-dim); font-style:italic; }
  .ot-game .sheet-block{ margin-bottom:14px; }
  .ot-game .sheet-block h4{ font-family:"Cinzel"; font-size:12px; color:var(--p-brand); margin-bottom:6px; }

  /* printed sheet: hide all site chrome, show just the result */
  @media print{
    .ot-game *{ visibility:hidden; }
    .ot-game #forgePrintArea, .ot-game #forgePrintArea *{ visibility:visible; }
    .ot-game #forgePrintArea{ position:absolute; left:0; top:0; width:100%; }
    .ot-game .forge-actions, .ot-game .forge-progress{ display:none !important; }
  }


/* ---------------- v2 integration ---------------- */
.content:has(> .ot-game), .content:has(> .flashes + .ot-game){ background:#e9dfc4; }
.ot-game{ border-radius:10px; }
.ot-game .wrap{ padding:4px 0 60px; }
.ot-game .ot-subbar{ display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; margin:0 0 14px; min-height:0; }
.ot-game .ot-subbar:empty{ display:none; }
.ot-game .ot-subbar .back{ cursor:pointer; }
.ot-game .scope-tag{ display:inline-block; font-family:"JetBrains Mono"; font-size:9px; font-weight:700; padding:1px 6px; border-radius:4px; vertical-align:2px; margin-left:4px; }
.ot-game .scope-tag.club{ background:#efe1f7; color:#5b3d80; border:1px solid #c8b2e0; }
.ot-game .scope-tag.core{ background:var(--p-bg-2); color:var(--p-ink-faint); border:1px solid var(--p-border); }
.ot-game .my-actions{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.ot-game .my-empty{ text-align:center; padding:28px 16px; background:var(--p-panel); border:1px dashed var(--p-border); border-radius:12px; color:var(--p-ink-dim); font-size:14px; line-height:1.6; }
.ot-game .my-empty b{ color:var(--p-ink); }
.ot-game .ot-note{ font-size:12px; color:var(--p-ink-dim); background:var(--p-panel); border:1px solid var(--p-border-soft); border-radius:8px; padding:9px 12px; margin:0 0 12px; line-height:1.5; }
.ot-game .adopt-btn{ display:block; width:100%; margin-top:8px; padding:10px; border-radius:9px; border:1.5px dashed var(--p-brand); background:transparent; color:var(--p-brand); font-family:"Cinzel"; font-weight:700; font-size:12.5px; letter-spacing:.03em; }

/* ===================== CHARACTER FORGE v2.03 ===================== */
.ot-game .fg .sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.ot-game .fg-namebar{ display:flex; gap:8px; align-items:stretch; margin-bottom:8px; position:sticky; top:0; z-index:5; background:var(--p-bg); padding:6px 0; }
.ot-game .fg-namebar input{ flex:1; min-width:0; font-family:"Cinzel"; font-size:18px; font-weight:700; color:var(--p-ink); background:var(--p-panel); border:1.5px solid var(--p-border); border-radius:10px; padding:10px 12px; }
.ot-game .fg-namebar input:focus{ outline:none; border-color:var(--p-brand); }
.ot-game .fg-dice{ border:1.5px solid var(--p-border); background:var(--p-panel); border-radius:10px; font-size:20px; min-width:48px; padding:0 10px; }
.ot-game .fg-dice.sm{ font-size:14px; min-width:32px; height:32px; padding:0 6px; border-radius:8px; }
.ot-game .fg-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.ot-game .fg-chip{ font-size:11.5px; padding:3px 10px; border-radius:999px; background:var(--p-panel); border:1px solid var(--p-border-soft); color:var(--p-ink-dim); }
.ot-game .fg-tabs{ display:flex; gap:6px; overflow-x:auto; padding-bottom:6px; margin-bottom:16px; scrollbar-width:thin; }
.ot-game .fg-tab{ flex:none; display:flex; align-items:center; gap:6px; border:1px solid var(--p-border-soft); background:var(--p-panel); color:var(--p-ink-dim); border-radius:999px; padding:6px 12px 6px 6px; font-size:12.5px; white-space:nowrap; }
.ot-game .fg-tab span{ display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--p-bg-2); font-size:11px; font-weight:700; }
.ot-game .fg-tab.done span{ background:var(--p-brand); color:#fff; }
.ot-game .fg-tab.cur{ border-color:var(--p-brand); color:var(--p-ink); font-weight:700; }
.ot-game .fg-tab.cur span{ background:var(--gold); color:#fff; }
.ot-game .fg-issues{ font-size:12px; color:var(--p-ink-dim); margin-top:14px; line-height:1.5; }
.ot-game .fg-issues:empty{ display:none; }
.ot-game .fg-issues-box{ background:color-mix(in srgb, var(--gold) 12%, var(--p-panel)); border:1px solid var(--gold); border-radius:10px; padding:10px 14px; margin-bottom:14px; font-size:13px; }
.ot-game .fg-issues-box ul{ margin:6px 0 4px 18px; }
.ot-game .fg-foot{ text-align:center; margin-top:16px; }
.ot-game .linkish{ background:none; border:none; padding:0; color:var(--p-brand); text-decoration:underline; font-size:inherit; }
.ot-game .fg-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.ot-game .fg-listbtn{ display:block; width:100%; text-align:left; border:1px solid var(--p-border); background:var(--p-panel); border-radius:10px; padding:11px 14px; color:var(--p-ink); }
.ot-game .fg-listbtn.sel{ border-color:var(--p-brand); border-width:2px; padding:10px 13px; background:color-mix(in srgb, var(--p-brand) 9%, var(--p-panel)); }
.ot-game .fg-lb-top{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.ot-game .fg-lb-name{ font-family:"Cinzel"; font-weight:700; font-size:14.5px; color:var(--p-ink); }
.ot-game .fg-lb-meta{ margin-left:auto; font-size:11px; color:var(--p-ink-faint); }
.ot-game .fg-lb-sub{ display:block; font-size:12px; color:var(--p-ink-dim); margin-top:3px; line-height:1.45; }
.ot-game .fg-section{ margin:18px 0; }
.ot-game .fg-section h3{ font-family:"Cinzel"; font-size:14px; color:var(--p-brand); margin-bottom:8px; }
.ot-game .fg-classcard p{ margin:6px 0; }
.ot-game .fg-level{ border-left:3px solid var(--p-border-soft); padding:2px 0 4px 12px; margin:14px 0; }
.ot-game .fg-level-num{ font-family:"Cinzel"; font-weight:700; font-size:12.5px; color:var(--p-ink-faint); text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.ot-game .fg-choice{ margin-top:12px; }
.ot-game .fg-choice-head{ font-size:13px; margin-bottom:6px; color:var(--p-ink); }
.ot-game .fg-ok{ color:#3c7a3b; font-weight:700; }
.ot-game .fg-need{ font-size:11px; font-weight:700; color:#fff; background:var(--gold); border-radius:999px; padding:1px 8px; }
.ot-game button.pick-card{ width:100%; text-align:left; color:inherit; font:inherit; }
.ot-game .pick-card .pick-label, .ot-game .pick-card .pick-sub{ display:block; }
.ot-game .fg-box{ flex:none; display:inline-grid; place-items:center; width:18px; height:18px; border-radius:5px; border:1.5px solid var(--p-border); background:var(--p-bg-2); color:#fff; font-size:12px; font-weight:700; margin-top:1px; }
.ot-game .pick-card.sel .fg-box{ background:var(--p-brand); border-color:var(--p-brand); }
.ot-game .fg-seg{ display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 10px; }
.ot-game .seg{ border:1px solid var(--p-border); background:var(--p-panel); color:var(--p-ink-dim); border-radius:8px; padding:7px 12px; font-size:13px; min-width:38px; }
.ot-game .seg.on{ background:var(--p-brand); border-color:var(--p-brand); color:#fff; font-weight:700; }
.ot-game .seg:disabled{ opacity:.4; }
.ot-game .fg-edtabs .seg{ flex:1; }
.ot-game .fg-row{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:13px; margin:6px 0; }
.ot-game .fg select, .ot-game .fg input[type=number], .ot-game .fg-search{ border:1px solid var(--p-border); border-radius:8px; padding:7px 9px; background:var(--p-panel); color:var(--p-ink); font-size:13px; }
.ot-game .fg-hprolls{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:12.5px; }
.ot-game .fg-hprolls label{ display:flex; align-items:center; gap:4px; }
.ot-game .fg-hprolls input{ width:56px; }
.ot-game .fg-sources{ display:flex; flex-direction:column; gap:8px; }
.ot-game .fg-source{ display:flex; gap:12px; align-items:flex-start; text-align:left; width:100%; border:1px solid var(--p-border); background:var(--p-panel); border-radius:10px; padding:11px 14px; color:var(--p-ink); opacity:.65; }
.ot-game .fg-source.on{ opacity:1; border-color:var(--p-brand); }
.ot-game .fg-toggle{ flex:none; width:38px; height:22px; border-radius:999px; background:var(--p-border-soft); position:relative; margin-top:2px; }
.ot-game .fg-toggle::after{ content:""; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:#fff; transition:left .15s; }
.ot-game .fg-source.on .fg-toggle{ background:var(--p-brand); }
.ot-game .fg-source.on .fg-toggle::after{ left:19px; }
.ot-game .fg-scores{ width:100%; border-collapse:collapse; font-size:13px; margin-top:8px; }
.ot-game .fg-scores th, .ot-game .fg-scores td{ padding:7px 4px; border-bottom:1px solid var(--p-border-soft); text-align:center; }
.ot-game .fg-scores th:first-child{ text-align:left; }
.ot-game .fg-scores thead th{ font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--p-ink-faint); font-weight:600; }
.ot-game .fg-stepper{ display:inline-flex; align-items:center; gap:8px; }
.ot-game .fg-stepper .seg{ padding:4px 10px; }
.ot-game .forge-cta-btn.sm{ padding:7px 12px; font-size:12px; }
.ot-game .fg-gold{ float:right; font-family:"JetBrains Mono"; font-size:12px; color:var(--p-ink); background:color-mix(in srgb, var(--gold) 18%, var(--p-panel)); border-radius:999px; padding:2px 10px; }
.ot-game .fg-search{ width:100%; margin-bottom:8px; }
.ot-game .fg-shoplist{ display:flex; flex-direction:column; max-height:420px; overflow-y:auto; border:1px solid var(--p-border-soft); border-radius:10px; background:var(--p-panel); }
.ot-game .fg-shoprow{ display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--p-border-soft); font-size:13px; }
.ot-game .fg-shoprow:last-child{ border-bottom:none; }
.ot-game .fg-price{ font-family:"JetBrains Mono"; font-size:11.5px; color:var(--p-ink-dim); white-space:nowrap; }
.ot-game .fg-buy{ display:flex; align-items:center; gap:6px; }
.ot-game .fg-buy .seg{ padding:3px 10px; min-width:32px; }
.ot-game .fg-inv{ margin:0 0 0 18px; font-size:13px; line-height:1.6; }
.ot-game .fg-warn{ color:#9a3b1f; }
.ot-game .fg-check{ display:inline-flex; gap:6px; align-items:center; }
.ot-game .fg-actions{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.ot-game .fg-actions .small-note{ text-align:center; margin:0; }
.ot-game .fg-actions .small-note:empty{ display:none; }
@media (max-width:520px){
  .ot-game .fg-scores thead th:nth-child(3), .ot-game .fg-scores thead th:nth-child(4){ font-size:9px; }
  .ot-game .fg-shoprow{ grid-template-columns:1fr auto; }
  .ot-game .fg-shoprow .fg-buy{ grid-column:1 / -1; justify-content:flex-end; }
  .ot-game .fg-lb-meta{ margin-left:0; width:100%; }
}
/* Library pages for Forge data */
.ot-game .fl-head{ display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.ot-game .fl-head .fg-search{ margin:0; flex:1; }
.ot-game a.fg-listbtn, .ot-game a.fl-itemrow{ text-decoration:none; color:inherit; }
.ot-game .fl-row{ margin-bottom:8px; }
.ot-game .fl-group{ font-family:"Cinzel"; font-size:13px; color:var(--p-brand); margin:16px 0 8px; }
.ot-game .fl-title{ font-family:"Cinzel"; font-size:22px; color:var(--p-ink); margin:0 0 6px; }
.ot-game .fl-itemrow{ grid-template-columns:1fr auto; }
.ot-game .fl-json{ font-family:"JetBrains Mono"; font-size:12px; line-height:1.45; }
.ot-game .fl p{ margin:8px 0; }
.ot-game .fg-levelsel{ font-size:15px !important; padding:9px 12px !important; min-width:220px; }
.ot-game .fg-atag{ display:inline-block; margin-left:6px; font-family:"JetBrains Mono"; font-size:9.5px; font-weight:600; letter-spacing:.03em; text-transform:uppercase; padding:1px 6px; border-radius:999px; background:color-mix(in srgb, var(--p-brand) 14%, var(--p-panel)); color:var(--p-brand); vertical-align:middle; }
.ot-game .fg-atag.spell{ background:color-mix(in srgb, var(--violet) 16%, var(--p-panel)); color:var(--violet); }
.ot-game .fg-scores tr.fg-key th{ color:var(--p-brand); }
@media (max-width:520px){ .ot-game .fg-scores th .fg-atag{ display:block; margin:2px 0 0; width:max-content; } }
.ot-game .fg-editbar{ display:flex; gap:10px; align-items:flex-start; justify-content:space-between; background:color-mix(in srgb, var(--violet) 12%, var(--p-panel)); border:1px solid color-mix(in srgb, var(--violet) 45%, var(--p-border)); border-radius:10px; padding:9px 12px; font-size:12.5px; margin-bottom:10px; line-height:1.45; }
.ot-game .fg-editbar .linkish{ flex:none; }
.ot-game .fg-level.fg-new{ border-left-color:var(--gold); }
/* My Characters on phones: name on its own line, buttons wrap underneath (v2.05) */
.ot-game .my-row{ flex-wrap:wrap; }
.ot-game .my-row > div:nth-child(2){ min-width:160px; }
@media (max-width:640px){
  .ot-game .my-row .my-actions{ flex-basis:100%; justify-content:flex-start; padding-left:52px; }
  .ot-game .my-row .my-actions button{ flex:1 1 auto; min-width:max-content; }
}
.ot-game .fg-scorein{ width:72px; text-align:center; font-size:15px !important; }
.ot-game .fg-art{ width:56px; height:56px; border-radius:50%; object-fit:cover; border:2px solid var(--p-border); }
/* v2.06: wide screens. The character list grows to three or four columns; other pages stay a centred column. */
.ot-game .wrap[data-view="premades"]{ max-width:1500px; }
@media(min-width:1100px){ .ot-game .wrap[data-view="premades"] .roster-grid{ grid-template-columns:repeat(auto-fit, minmax(400px, 1fr)); } }
.ot-game .wrap[data-view="premades"] > .ot-note, .ot-game .wrap[data-view="premades"] > .forge-cta-row{ max-width:960px; margin-left:auto; margin-right:auto; }
.ot-game .wrap[data-view="play"]{ max-width:1040px; }
.ot-game .fg-pkgpicks{ margin:-2px 0 6px 28px; display:flex; flex-direction:column; gap:4px; }
.ot-game .fg-hand{ background:color-mix(in srgb, var(--violet) 10%, var(--p-panel)); border:1px solid color-mix(in srgb, var(--violet) 40%, var(--p-border)); border-radius:10px; padding:10px 14px; margin-bottom:14px; font-size:13px; }
.ot-game .fg-hand ul{ margin:6px 0 6px 18px; line-height:1.6; }

/* ===================== v2.15 PRINT / SAVE AS PDF ===================== */
.ot-game .banner-btns{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
#printRoot{ display:none; }
@media print{
  @page{ size:A4; margin:12mm; }
  body.printing-sheet > *:not(#printRoot){ display:none !important; }
  body.printing-sheet{ background:#fff !important; }
  body.printing-sheet #printRoot{ display:block; }
}
.pr-sheet{ font:10.5pt/1.35 Georgia, "Times New Roman", serif; color:#111; background:#fff; }
.pr-sheet h1{ font:700 20pt/1.1 Georgia, serif; margin:0; }
.pr-sheet h3{ font:700 11pt/1.2 Georgia, serif; text-transform:uppercase; letter-spacing:.06em; border-bottom:1.5px solid #333; padding-bottom:2px; margin:0 0 6px; }
.pr-sheet h4{ font:700 10.5pt/1.2 Georgia, serif; margin:8px 0 3px; }
.pr-sheet small{ color:#555; font-size:8.5pt; font-weight:400; }
.pr-sheet ul{ margin:0; padding:0; list-style:none; }
.pr-head{ display:flex; gap:12px; align-items:center; border-bottom:2.5px solid #111; padding-bottom:8px; margin-bottom:8px; }
.pr-head p{ margin:3px 0 0; color:#333; }
.pr-portrait{ width:60px; height:60px; object-fit:cover; border-radius:50%; border:1.5px solid #333; }
.pr-vitals{ display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; margin-bottom:8px; }
.pr-vital, .pr-ab{ border:1.2px solid #333; border-radius:6px; text-align:center; padding:4px 2px; break-inside:avoid; }
.pr-v{ font-size:14pt; font-weight:700; }
.pr-l, .pr-ab-l{ font-size:7.5pt; text-transform:uppercase; letter-spacing:.06em; color:#444; }
.pr-blank .pr-v{ min-height:1.2em; }
.pr-abilities{ display:grid; grid-template-columns:repeat(6, 1fr); gap:6px; margin-bottom:10px; }
.pr-ab-m{ font-size:15pt; font-weight:700; line-height:1.1; }
.pr-ab-s{ font-size:9pt; border:1px solid #999; border-radius:9px; display:inline-block; padding:0 8px; }
.pr-ab-sv{ font-size:8pt; margin-top:2px; }
.pr-cols{ display:grid; grid-template-columns:0.9fr 1.3fr; gap:14px; }
.pr-sec{ margin-bottom:10px; }
.pr-skills li{ display:flex; justify-content:space-between; border-bottom:0.5px dotted #aaa; padding:1px 0; font-size:9.5pt; }
.pr-table{ width:100%; border-collapse:collapse; font-size:9.5pt; }
.pr-table th{ text-align:left; font-size:8pt; text-transform:uppercase; color:#444; border-bottom:1px solid #333; }
.pr-table td{ border-bottom:0.5px dotted #aaa; padding:2px 4px 2px 0; vertical-align:top; }
.pr-sub{ color:#444; font-size:9pt; margin:1px 0 0; }
.pr-line{ margin:4px 0; }
.pr-spells{ break-before:auto; }
.pr-spl{ break-inside:avoid; margin-bottom:6px; }
.pr-spl li{ padding:2px 0; border-bottom:0.5px dotted #bbb; }
.pr-spells .pr-spl{ columns:1; }
.pr-feat{ break-inside:avoid; padding:3px 0; border-bottom:0.5px dotted #bbb; }
.pr-foot{ margin-top:10px; font-size:8pt; color:#777; text-align:right; }

/* ===================== v2.15 SHEET COLOURS ===================== */
.sc-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; margin:12px 0; }
.sc-swatch{ display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 6px; border-radius:10px; border:1.5px solid var(--border, #444); background:transparent; color:inherit; font-size:12px; cursor:pointer; }
.sc-swatch span{ width:44px; height:44px; border-radius:50%; border:2px solid rgba(255,255,255,.35); box-shadow:0 0 0 1px rgba(0,0,0,.4); }
.sc-swatch.on{ border-color:var(--accent-bright, #bfe38c); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent-bright, #bfe38c) 40%, transparent); }
.sc-custom{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:13px; margin-bottom:6px; }
.sc-custom input[type=color]{ width:52px; height:36px; border:0; background:none; padding:0; cursor:pointer; }
/* light backgrounds: soften the bits that assume a dark sheet */
.ot-game .playsheet.sheet-light .help-toggle{ background:rgba(255,255,255,.7); border-color:color-mix(in srgb, var(--accent) 45%, transparent); color:var(--accent-bright); }
.ot-game .playsheet.sheet-light .edition-tag{ background:rgba(255,255,255,.6); }
.ot-game .playsheet.sheet-light .portrait{ box-shadow:0 0 0 5px var(--bg), 0 6px 16px rgba(0,0,0,0.18); }
.dup-opts{ display:grid; gap:10px; margin:14px 0 6px; }
.dup-opt{ text-align:left; display:flex; flex-direction:column; gap:4px; padding:12px 14px; border-radius:10px; border:1.5px solid var(--border, #444); background:var(--surface-2, rgba(255,255,255,.04)); color:var(--ink, inherit); cursor:pointer; }
.dup-opt b{ font-family:"Cinzel"; font-size:14px; color:var(--accent-bright, inherit); }
.dup-opt span{ font-size:12.5px; color:var(--ink-dim, inherit); line-height:1.45; }
.dup-opt:hover{ border-color:var(--accent-bright, #bfe38c); }
.ot-game .playsheet.sheet-light .id-text h1{ text-shadow:0 1px 0 rgba(255,255,255,.6); }
.dm-computed:empty{ display:none; }
.sc-custom .dm-apply{ padding:6px 14px; }
