/* ==========================================================================
   Styl „Tusz i papier ryżowy” (sumi-e) — włączany atrybutem <html data-theme="tusz">.
   Monochromatyczny jak malarstwo tuszem: chłodny papier ryżowy z włóknami,
   czarny tusz, szare laweringi, pociągnięcia pędzla zamiast ramek. Jedynym
   kolorem jest cynobrowa pieczęć-hanko (znak marki, bieżący krok, znaczniki
   nagłówków). Główna akcja to blok tuszu. Kolory stron (--shu, --ai) i kolory
   heksów są wspólne z rendererem planszy — bez zmian.
   ========================================================================== */
html[data-theme="tusz"]{
  color-scheme:light;
  --sumi:#e9e8e3;          /* papier ryżowy — tło */
  --sumi2:#f6f5f1;         /* jaśniejszy arkusz */
  --sumi3:#efeee9;
  --sumi4:#e2e0da;
  --line:#cfccc4;
  --line2:#8d8a83;
  --washi:#161514;
  --washi2:#1b1a18;        /* nagłówki — tusz */
  --ink:#fbfaf7;           /* pola formularzy */
  --text:#22211f;
  --text2:#66635d;
  --gold:#1b1a18;          /* dawne złote podkreślenia → tusz */
  --gold-l:#1b1a18;
  --gold-bg:rgba(27,26,24,.07);
  --moss:#3d3b37;
  --warn:#9a6a12;
  --bad:#a3262f;
  --hover:rgba(27,26,24,.05);
  --shu-l:#a3281d;         /* napisy w kolorach stron — przyciemnione na jasne tło */
  --ai-l:#2b4f82;
  --hanko:#b3261a;         /* cynobrowa pieczęć */
  --serif:"Hiragino Mincho ProN","Yu Mincho","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  /* prawa kolumna: arkusz z kreską pędzla u góry jak panele, dziennik bez ramki */
  --sheet:var(--brush) left top/100% 6px no-repeat,rgba(251,250,247,.82);
  --sheet-line:#cfccc4;
  --sheet-shadow:none;
  --well:rgba(27,26,24,.035);
  --well-line:#dcd9d1;
  --well-shadow:none;
  --stat:#fbfaf7;
  --stat-line:#3a3835;
  --stat-up:#1b1a18;
  --stat-up-v:#fbfaf7;
  --card:#fbfaf7;
  --card-hover:#fff;
  --r:3px;
  --r2:4px;
  --shadow:none;
  /* włókna papieru ryżowego */
  --fibre:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0125 .1' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .22 0 0 0 0 .21 0 0 0 0 .19 0 0 0 .5 -.2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23f)'/%3E%3C/svg%3E");
  /* pociągnięcie pędzla: grube z lewej, suchy, poszarpany koniec z prawej */
  --brush:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath d='M1 5.5C40 2.6 90 3.4 150 4.2S290 3.6 330 5c30 1 52 .6 68 1.8-18 .8-40 1.9-72 2.4-42 .6-110-.8-170 .1S40 10.8 2 9.6C-1 8.4 0 6.4 1 5.5z' fill='%231b1a18'/%3E%3Cpath d='M300 6.2c30-.4 60 0 95 .4M320 8.4c25 .2 45-.1 70-.8' stroke='%231b1a18' stroke-width='.6' fill='none' opacity='.6'/%3E%3C/svg%3E");
}
html[data-theme="tusz"] body{background:var(--fibre),radial-gradient(ellipse at 50% 30%,#f3f2ee,#dddbd4 95%) fixed;background-color:var(--sumi);color:var(--text)}
html[data-theme="tusz"] ::selection{background:rgba(179,38,26,.2)}
html[data-theme="tusz"] *{scrollbar-color:#a8a59e transparent}
html[data-theme="tusz"] ::-webkit-scrollbar-thumb{background:#a8a59e;background-clip:padding-box}
html[data-theme="tusz"] a{color:var(--hanko)}

/* ——— kontrolki: kreska tuszu na papierze, główna akcja to blok tuszu ——— */
html[data-theme="tusz"] button{background:transparent;color:var(--text);border:1px solid #3a3835;border-radius:var(--r);box-shadow:none}
html[data-theme="tusz"] button:hover:not(:disabled){background:rgba(27,26,24,.07);border-color:#1b1a18}
html[data-theme="tusz"] button:active:not(:disabled){background:rgba(27,26,24,.14);box-shadow:none}
html[data-theme="tusz"] button:disabled{opacity:.35}
html[data-theme="tusz"] button.pri{background:#1b1a18;color:#f6f5f1;border-color:#1b1a18;font-weight:600;letter-spacing:.02em;box-shadow:3px 3px 0 rgba(27,26,24,.18)}
html[data-theme="tusz"] button.pri:hover:not(:disabled){background:#34322e;border-color:#34322e}
html[data-theme="tusz"] button.pri:active:not(:disabled){box-shadow:1px 1px 0 rgba(27,26,24,.18);transform:translate(1px,1px)}
html[data-theme="tusz"] button.on{background:#4a4843;color:#fbfaf7;border-color:#1b1a18;font-weight:600}
html[data-theme="tusz"] button.on:hover:not(:disabled){background:#5a5852}
html[data-theme="tusz"] button.danger{background:transparent;color:var(--hanko);border-color:var(--hanko)}
html[data-theme="tusz"] button.danger:hover:not(:disabled){background:rgba(179,38,26,.08)}
html[data-theme="tusz"] input,html[data-theme="tusz"] select,html[data-theme="tusz"] textarea{background:var(--ink);color:var(--text);border:none;border-bottom:1px solid #3a3835;border-radius:0;box-shadow:none}
html[data-theme="tusz"] input[type=checkbox],html[data-theme="tusz"] input[type=radio],html[data-theme="tusz"] input[type=range]{accent-color:#1b1a18}
html[data-theme="tusz"] input:focus,html[data-theme="tusz"] select:focus,html[data-theme="tusz"] textarea:focus{border-bottom:2px solid var(--hanko);box-shadow:none}
html[data-theme="tusz"] button:focus-visible,html[data-theme="tusz"] input:focus-visible,
html[data-theme="tusz"] select:focus-visible,html[data-theme="tusz"] summary:focus-visible{outline-color:var(--hanko)}
html[data-theme="tusz"] textarea#jsonbox{background:var(--ink)!important;color:var(--text)!important;border:1px solid #3a3835!important}
html[data-theme="tusz"] .tg[aria-pressed="true"],html[data-theme="tusz"] button.tg-on,
html[data-theme="tusz"] .viewtoggle button[aria-pressed="true"],html[data-theme="tusz"] .themepick button[aria-pressed="true"]{
  background:#1b1a18;color:#f6f5f1;border-color:#1b1a18}
html[data-theme="tusz"] .viewswitch button.on{background:#1b1a18;color:#f6f5f1;border-color:#1b1a18}

/* ——— górny pasek: papier z pociągnięciem pędzla u dołu ——— */
html[data-theme="tusz"] #topbar{background:var(--brush) left bottom/100% 7px no-repeat,rgba(246,245,241,.9);border-bottom:none;box-shadow:none;padding-bottom:12px}
html[data-theme="tusz"] .seal{background:var(--hanko);color:#fbeee8;border-radius:3px;transform:rotate(-4deg);box-shadow:inset 0 0 0 2px rgba(251,238,232,.35)}
html[data-theme="tusz"] .step::before{background:transparent;border:1px solid #6b6862;color:var(--text2)}
html[data-theme="tusz"] .step.done{color:var(--text2)}
html[data-theme="tusz"] .step.done::before{background:#4a4843;border-color:#4a4843;color:#fbfaf7}
html[data-theme="tusz"] .step.cur{color:var(--washi2);background:transparent;box-shadow:none;font-weight:700}
html[data-theme="tusz"] .step.cur::before{background:var(--hanko);border-color:var(--hanko);color:#fff;border-radius:3px}
html[data-theme="tusz"] .pill{background:transparent;border:1px solid #8d8a83;color:var(--text)}
html[data-theme="tusz"] .pill.budget{color:var(--washi2);border-color:#3a3835}
html[data-theme="tusz"] .pill.A{background:rgba(192,57,43,.1);border-color:var(--shu);color:var(--shu-l)}
html[data-theme="tusz"] .pill.O{background:rgba(63,110,168,.1);border-color:var(--ai);color:var(--ai-l)}

/* ——— arkusze: bez ramek, oddzielone pociągnięciem pędzla ——— */
html[data-theme="tusz"] #stage{background:none}
html[data-theme="tusz"] .panel{background:var(--brush) left top/100% 6px no-repeat,rgba(251,250,247,.62);border:none;border-radius:0;
  padding:18px 16px 14px;margin-bottom:18px;box-shadow:none}
html[data-theme="tusz"] .panel > h2{color:var(--washi2);border-bottom:none;padding:0 0 6px 18px;letter-spacing:.06em;font-size:16px;
  background:linear-gradient(var(--hanko),var(--hanko)) 0 4px/9px 9px no-repeat}
html[data-theme="tusz"] .panel > h2 > span{color:var(--text2)}
html[data-theme="tusz"] .panel > h2 .money,html[data-theme="tusz"] .money,html[data-theme="tusz"] .chk .cc{color:var(--washi2);font-weight:700}
html[data-theme="tusz"] .panel.sticky{background:var(--brush) left top/100% 6px no-repeat,#f6f5f1;box-shadow:0 10px 14px -12px rgba(27,26,24,.4)}
html[data-theme="tusz"] .hint,html[data-theme="tusz"] .smallcaps,html[data-theme="tusz"] .note{color:var(--text2)}
html[data-theme="tusz"] .err{color:var(--bad)}
html[data-theme="tusz"] .okmsg{color:#2f5e3a}
html[data-theme="tusz"] .warnbox{background:rgba(27,26,24,.05);border:none;border-left:3px solid #1b1a18;color:var(--text)}
html[data-theme="tusz"] .warnbox b{color:var(--washi2)}
html[data-theme="tusz"] table.tbl th{color:var(--text2);border-bottom:1px solid #3a3835}
html[data-theme="tusz"] table.tbl td{border-bottom-color:#dcd9d1}
html[data-theme="tusz"] table.tbl tr:hover td{background:rgba(27,26,24,.05)}
html[data-theme="tusz"] .budgetbar{height:6px;background:#d8d5cd;box-shadow:none;border-radius:0}
html[data-theme="tusz"] .budgetbar i{background:#1b1a18;border-radius:0}
html[data-theme="tusz"] .budgetbar.over i{background:var(--hanko)}
html[data-theme="tusz"] .chk:hover{background:rgba(27,26,24,.05)}
html[data-theme="tusz"] .chk.on{background:rgba(27,26,24,.08);border-color:#3a3835}
html[data-theme="tusz"] .tag{background:transparent;border-color:#8d8a83;color:var(--text)}
html[data-theme="tusz"] .tag.sk{border-color:#1b1a18;color:#1b1a18;font-weight:600}
html[data-theme="tusz"] .tag.tr{border-color:#6f86a3;color:#2b4f82}
html[data-theme="tusz"] .tag.bo{border-color:#6b8b6f;color:#2f5e3a}
html[data-theme="tusz"] .mapedit{background:transparent;border-color:#8d8a83}
html[data-theme="tusz"] .screenfoot{background:var(--brush) left top/100% 6px no-repeat,linear-gradient(180deg,rgba(233,232,227,.9),#e9e8e3 40%);border-top:none}
html[data-theme="tusz"] .dicebox{background:#fbfaf7;border-color:#8d8a83}
html[data-theme="tusz"] .big{color:var(--washi2)}
html[data-theme="tusz"] [style*="#ffd166"]{color:#8a5a00!important}
html[data-theme="tusz"] [style*="#e08a8a"]{color:var(--bad)!important}

/* ——— prawa kolumna i pasek składu ——— */
html[data-theme="tusz"] #rail{background:rgba(246,245,241,.7);border-left:1px solid #3a3835}
html[data-theme="tusz"] #strip{background:var(--brush) left top/100% 5px no-repeat,rgba(239,238,233,.92);border-top:none;padding-top:10px}
html[data-theme="tusz"] #build-footer{background:#e9e8e3;border-top-color:var(--line)}
/* pływające panele na pełnoekranowej planszy (rozstawienie, pasek narzędzi bitwy) — arkusz zamiast ciemnej laki */
html[data-theme="tusz"]{--rail-bg:var(--brush) left top/100% 6px no-repeat,rgba(246,245,241,.95)}
html[data-theme="tusz"] #shell .dep-top,html[data-theme="tusz"] #shell .deploy-side,html[data-theme="tusz"] #shell .bt-toolbar,html[data-theme="tusz"] #shell .bt-actionbar{
  border:none;border-radius:2px;padding-top:12px;box-shadow:0 14px 34px -18px rgba(27,26,24,.55)}
html[data-theme="tusz"] #inspector{border:none;padding-top:13px}
html[data-theme="tusz"] #inspector .iname,html[data-theme="tusz"] #unitpop .iname{color:var(--washi2)}
html[data-theme="tusz"] .statgrid{border-radius:2px}
html[data-theme="tusz"] .statgrid .up .k{color:#c9c6be}
html[data-theme="tusz"] #log .hit{color:#7a4f00}
html[data-theme="tusz"] #log .kill{color:var(--hanko)}
html[data-theme="tusz"] #log .ok{color:#2f5e3a}
html[data-theme="tusz"] #log .bad{color:var(--bad)}
html[data-theme="tusz"] #log .rnd{color:var(--washi2)}
html[data-theme="tusz"] #log .rnd::before,html[data-theme="tusz"] #log .rnd::after{height:4px;background:var(--brush) center/100% 4px no-repeat;opacity:.75}
html[data-theme="tusz"] .ucard{border:1px solid #bdb9b0;border-radius:4px;box-shadow:2px 2px 0 rgba(27,26,24,.08)}
html[data-theme="tusz"] .ucard .n{color:var(--washi)}
html[data-theme="tusz"] .ucard:hover{border-color:#3a3835;box-shadow:2px 2px 0 rgba(27,26,24,.12)}
html[data-theme="tusz"] .ucard.sel{border-color:#1b1a18;box-shadow:0 0 0 1px #1b1a18}
html[data-theme="tusz"] .uchip{border-radius:2px;box-shadow:none}
html[data-theme="tusz"] .uchip.cav{border-radius:7px}
html[data-theme="tusz"] .hpbar{background:#dcd9d1;border-radius:0;height:4px}
html[data-theme="tusz"] .hpbar i{background:#3a3835;border-radius:0}
html[data-theme="tusz"] .hpbar.low i{background:#9a6a12}html[data-theme="tusz"] .hpbar.crit i{background:var(--hanko)}
html[data-theme="tusz"] .badge.sh{background:#9a6a12}html[data-theme="tusz"] .badge.fl{background:var(--hanko)}
html[data-theme="tusz"] .striphead{color:var(--text2)}
html[data-theme="tusz"] .striphead span b{color:var(--washi)!important}

/* ——— armie, modyfikatory ——— */
html[data-theme="tusz"] .sidetab{border-top:1px solid #3a3835}
html[data-theme="tusz"] .sidetab.act{background:rgba(27,26,24,.08);border-color:#1b1a18;box-shadow:inset 0 -3px 0 #1b1a18}
html[data-theme="tusz"] .sidetab i.ok{color:#2f5e3a}html[data-theme="tusz"] .sidetab i.bad{color:var(--bad)}
html[data-theme="tusz"] .modgroup{background:transparent;border:none;border-top:1px solid #3a3835;border-radius:0;padding:8px 2px 4px}
html[data-theme="tusz"] .modgroup h3{color:var(--washi2);border-bottom:none}
html[data-theme="tusz"] .modgroup h3 span{color:var(--hanko)}
html[data-theme="tusz"] .modgroup .chk .cc{background:transparent;border:1px solid #3a3835;color:var(--washi2);border-radius:50%}
html[data-theme="tusz"] .genopt.on span{color:rgba(251,250,247,.85)}
html[data-theme="tusz"] .genresult{background:rgba(27,26,24,.05);border-color:#3a3835}
html[data-theme="tusz"] .army-json-editor{background:#fbfaf7}

/* ——— bitwa: plansza oprawiona jak zwój (szary jedwab i kreska tuszu) ——— */
html[data-theme="tusz"] #turnflag{background:#fbfaf7;border:1px solid #bdb9b0;border-left-width:4px;border-radius:2px;box-shadow:none}
html[data-theme="tusz"] #turnflag.A{background:linear-gradient(90deg,rgba(192,57,43,.1),#fbfaf7 70%)}
html[data-theme="tusz"] #turnflag.O{background:linear-gradient(90deg,rgba(63,110,168,.1),#fbfaf7 70%)}
html[data-theme="tusz"] #turnflag.A .who{color:var(--shu-l)}html[data-theme="tusz"] #turnflag.O .who{color:var(--ai-l)}
html[data-theme="tusz"] #turnflag .mon{border-radius:3px;box-shadow:none}
html[data-theme="tusz"] #boardwrap,html[data-theme="tusz"] .online-board-wrap{background:var(--fibre),#f3f2ee;border:9px solid #8f8b84;border-radius:0;
  box-shadow:inset 0 0 0 1px #1b1a18,0 0 0 1px #5d5a54,6px 8px 0 -2px rgba(27,26,24,.12)}
html[data-theme="tusz"] .hxlbl{fill:#55524c}
html[data-theme="tusz"] .legend i{border-color:rgba(27,26,24,.4);border-radius:0}
html[data-theme="tusz"] .online-unit-panel,html[data-theme="tusz"] .online-last-action{background:#fbfaf7}

/* ——— okna, wybór trybu, samouczek ——— */
html[data-theme="tusz"] #overlay{background:rgba(233,232,227,.72)}
html[data-theme="tusz"] #ovbox{background:var(--brush) left top/100% 8px no-repeat,var(--fibre),#f6f5f1;border:none;border-radius:0;color:var(--text);
  padding-top:26px;box-shadow:0 24px 60px -20px rgba(27,26,24,.5)}
html[data-theme="tusz"] #ovbox > h2{color:var(--washi2);border-bottom:none}
html[data-theme="tusz"] .modegate{background:
    linear-gradient(180deg,rgba(233,232,227,.45),rgba(233,232,227,.92) 62%,#e9e8e3),
    url(../../samurai-duel.webp) center 30%/cover no-repeat,#9d9a94;
  background-blend-mode:normal,luminosity,normal}
html[data-theme="tusz"] .modebox{background:var(--brush) left top/100% 10px no-repeat,var(--fibre),rgba(246,245,241,.95);border:none;border-radius:0;
  box-shadow:0 30px 70px -24px rgba(27,26,24,.55);padding-top:clamp(28px,5vw,50px)}
html[data-theme="tusz"] .modebrand{color:var(--washi2);letter-spacing:.08em}
html[data-theme="tusz"] .modebrand b{color:var(--washi2);font-weight:700}
html[data-theme="tusz"] .modelead{color:var(--text2)}
html[data-theme="tusz"] .modecard{background:rgba(251,250,247,.7);border:1px solid #3a3835;border-radius:2px;box-shadow:none}
html[data-theme="tusz"] .modecard strong{color:var(--washi2)}
html[data-theme="tusz"] .modecard span{color:var(--text2)}
html[data-theme="tusz"] .modecard:hover:not(:disabled){background:#fff;border-color:#1b1a18;box-shadow:4px 4px 0 rgba(27,26,24,.15)}
html[data-theme="tusz"] .modecard.pri{font-weight:400;background:#1b1a18;border-color:#1b1a18;box-shadow:4px 4px 0 rgba(27,26,24,.18)}
html[data-theme="tusz"] .modecard.pri:hover:not(:disabled){background:#2c2a27;border-color:#2c2a27}
html[data-theme="tusz"] .modecard.pri strong{color:#fbfaf7}
html[data-theme="tusz"] .modecard.pri span{color:#d6d3cc}
html[data-theme="tusz"] .modeglyph{background:var(--hanko)!important;color:#fff!important;border-radius:3px!important;transform:rotate(-4deg)!important;box-shadow:none!important}
html[data-theme="tusz"] .modecard:not(.pri) .modeglyph{background:transparent!important;color:#1b1a18!important;box-shadow:inset 0 0 0 1.5px #1b1a18!important}
html[data-theme="tusz"] .modestatus{background:rgba(251,250,247,.8);border-color:#bdb9b0;border-left-color:#1b1a18}
html[data-theme="tusz"] .duelcode{color:var(--washi2);background:transparent;border-color:#3a3835}
html[data-theme="tusz"] .historylist li{background:rgba(251,250,247,.8)}
html[data-theme="tusz"] .themepick{color:var(--text2)}
html[data-theme="tusz"] .tutorial-bar{background:var(--brush) left top/100% 6px no-repeat,#f3f2ee;border-top:none;padding-top:14px}
html[data-theme="tusz"] .tuthead b{color:var(--hanko)}
html[data-theme="tusz"] .tuttip{background:rgba(27,26,24,.05);border-color:#1b1a18}
html[data-theme="tusz"] .tutpill{background:transparent;color:var(--washi2);border-color:#1b1a18}
html[data-theme="tusz"] .tut-hl{outline-color:var(--hanko);box-shadow:0 0 0 6px rgba(179,38,26,.12)}

/* ——— znak: kaligrafia pędzlem — czarny tusz, „bitwa” rozwodnionym tuszem ——— */
html[data-theme="tusz"]{--wm-font:"WM Tusz",var(--serif);--wm-weight:400}
html[data-theme="tusz"] .wordmark{letter-spacing:.08em}
html[data-theme="tusz"] .wordmark .wm1{background:none;color:#141312;text-shadow:0 0 .6px rgba(20,19,18,.6)}
html[data-theme="tusz"] .wordmark .wm-dash{color:#8d8a83}
html[data-theme="tusz"] .wordmark .wm2{color:#5a5752;font-weight:400}
