@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(fonts/inter-600.woff) format("woff")}
@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(fonts/inter-700.woff) format("woff")}
@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:swap;src:url(fonts/inter-800.woff) format("woff")}
@font-face{font-family:Inter;font-style:normal;font-weight:900;font-display:swap;src:url(fonts/inter-900.woff) format("woff")}
:root{
  --font:Inter,system-ui,"Segoe UI","Noto Sans","Noto Sans Arabic","Noto Sans Devanagari","Noto Sans SC","Noto Sans JP","Noto Sans KR","Helvetica Neue",Arial,sans-serif;
  --bg:#ffffff;--surface:#f2f5ef;--ink:#0e0f0c;--forest:#163300;--lime:#9fe870;--lime-hover:#b5f08f;
  --muted:#5d7079;--line:#dfe4da;--loss:#d03238;--draw:#ffc091;--win:#2f5711;
  box-sizing:border-box;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);line-height:1.3;-webkit-font-smoothing:antialiased}
main{max-width:520px;margin:0 auto;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;gap:clamp(5px,1.2vh,10px);padding:calc(8px + env(safe-area-inset-top,0px)) 14px calc(10px + env(safe-area-inset-bottom,0px))}
.head{display:flex;align-items:center;justify-content:space-between;gap:10px}
h1{font-size:clamp(19px,3.4vh,26px);line-height:1.1;font-weight:900;letter-spacing:-.01em;color:var(--forest);margin:0;overflow-wrap:anywhere}
html[lang=ar] h1,html[lang=hi] h1,html[lang=zh] h1,html[lang=ja] h1,html[lang=ko] h1{letter-spacing:0;line-height:1.25}
html[lang=ar] .big,html[lang=hi] .big{letter-spacing:0}
.sub{color:var(--muted);margin:0;font-size:clamp(11.5px,1.7vh,13.5px);line-height:1.3}
.lang{position:relative;flex:none;display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 9px;border-radius:999px;background:var(--surface);color:var(--forest)}
.lang svg{width:14px;height:14px;flex:none;pointer-events:none}
.lang .code{font:800 12px var(--font);letter-spacing:.02em;pointer-events:none}
.lang .chev{width:9px;height:9px}
.lang select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;border:0;margin:0;padding:0;font-size:16px}
.lang:hover{background:var(--lime);color:#163300}
.card{background:var(--surface);border-radius:20px;padding:clamp(8px,1.4vh,12px) 14px}
.card h2{font-size:12.5px;margin:0 0 1px;font-weight:700;color:var(--muted)}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:clamp(3px,.7vh,6px) 0}
.row+.row{border-top:1px solid var(--line)}
.row label{font-weight:600;font-size:15px;display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere}
.dot{width:11px;height:11px;border-radius:50%;display:inline-block;flex:none}
.step{display:flex;align-items:center;gap:6px;direction:ltr;flex:none}
.step button{width:clamp(30px,5vh,38px);height:clamp(30px,5vh,38px);border-radius:50%;border:0;background:var(--bg);color:var(--forest);font-size:20px;font-weight:700;cursor:pointer;line-height:1;padding:0}
.step button:hover{background:var(--lime)}
.step button:active{transform:scale(.94)}
input[type=number]{width:68px;height:clamp(34px,5.4vh,42px);border:2px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);font:700 18px var(--font);text-align:center;-moz-appearance:textfield}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none}
.err{color:var(--loss);font-size:12.5px;font-weight:600;margin:2px 0 0}
.err:empty{display:none}
.result{position:relative;background:#163300;color:#fff;border-radius:20px;padding:clamp(10px,1.8vh,16px) 14px;flex:1 1 auto;max-height:380px;display:flex;flex-direction:column;justify-content:space-between;gap:clamp(6px,1.2vh,10px)}
.bigrow{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.bigwrap{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;direction:ltr}
.winicon{width:clamp(16px,2.8vh,22px);height:clamp(16px,2.8vh,22px);color:#9fe870;flex:none}
.big{font-size:clamp(40px,9vh,68px);font-weight:900;letter-spacing:-.03em;line-height:1}
.info{flex:none;width:30px;height:30px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:#fff;display:grid;place-items:center;cursor:pointer;transition:background .15s;position:relative;z-index:3;padding:0}
.info:hover,.info[aria-expanded="true"]{background:#9fe870;color:#163300}
.info svg{width:18px;height:18px}
.infobox{position:absolute;z-index:2;inset:10px 10px 10px 10px;top:48px;overflow:auto;background:#0d2200;border:1px solid rgba(255,255,255,.18);border-radius:14px;padding:10px 12px;font-size:13px;line-height:1.35;cursor:pointer}
.infobox p{margin:0 0 7px}.infobox p:last-child{margin:0}
.meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px}
.record{font-size:15px;font-weight:600;opacity:.88}
.total{display:inline-flex;align-items:center;gap:5px;background:rgba(255,255,255,.12);border-radius:99px;padding:4px 12px;font-size:12.5px;font-weight:600}
.total b{font-size:15px;font-weight:800}
.bar{display:flex;gap:3px;height:clamp(24px,4.4vh,34px);border-radius:99px;overflow:hidden;background:#163300;direction:ltr}
.bar.empty{background:rgba(255,255,255,.14)}
.seg{display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;min-width:0;white-space:nowrap;transition:flex-grow .35s ease}
.legend{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.legend div{background:rgba(255,255,255,.1);border-radius:12px;padding:6px 8px;min-width:0}
.legend i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-inline-end:5px}
.legend small{display:block;font-size:11.5px;font-weight:600;opacity:.85;overflow-wrap:anywhere;line-height:1.2}
.legend b{font-size:17px;font-weight:800;margin-inline-end:6px}
.legend em{font-style:normal;font-size:12px;font-weight:600;opacity:.8}
.actions{display:flex;gap:8px}
.btn{flex:1;border:0;border-radius:999px;padding:clamp(9px,1.6vh,13px) 16px;font:700 15px var(--font);cursor:pointer;background:var(--lime);color:#163300;transition:transform .1s,background .15s;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn svg{width:17px;height:17px;flex:none}
.btn:hover{background:var(--lime-hover)}
.btn:active{transform:scale(.97)}
.btn.danger{background:#d03238;color:#fff}
.btn.danger:hover{background:#e0474d}
.btn.sec{background:rgba(22,51,0,.08);color:var(--forest)}
.sheet{position:fixed;inset:0;z-index:20;display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.panel{position:relative;width:100%;max-width:520px;max-height:100dvh;overflow:auto;background:var(--bg);border-radius:24px 24px 0 0;padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:8px}
.phead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.phead h3{margin:0;font-size:16px;font-weight:800;color:var(--forest)}
.x{width:32px;height:32px;border-radius:50%;border:0;background:var(--surface);color:var(--forest);font-size:20px;line-height:1;cursor:pointer;padding:0}
.x:hover{background:var(--lime);color:#163300}
.prev{align-self:center;height:min(40vh,420px);width:auto;max-width:100%;object-fit:contain;border-radius:14px;background:#163300}
.sbtns{display:grid;grid-template-columns:1fr;gap:8px}
.sbtns .btn{padding:12px 16px;font-size:15px}
.smsg{margin:0;min-height:18px;text-align:center;font-size:13px;font-weight:600;color:var(--muted)}
.below{max-width:520px;margin:0 auto;padding:28px 16px 8px;color:var(--ink)}
.guide h2{font-size:20px;color:var(--forest);margin:26px 0 8px;font-weight:800}
.guide h2:first-child{margin-top:0}
.guide h3{font-size:16px;margin:16px 0 4px;color:var(--forest)}
.guide p{margin:0 0 10px;line-height:1.6;font-size:15px}
.guide .formula{background:var(--surface);border-radius:14px;padding:12px 14px;font-weight:700}
.guide details{background:var(--surface);border-radius:14px;padding:10px 14px;margin-bottom:8px}
.guide summary{cursor:pointer;font-weight:700}
.guide details p{margin:8px 0 0}
.ad{min-height:100px;margin:18px 0;text-align:center}
.ad::before{content:"Advertisement";display:block;font-size:11px;color:var(--muted);margin-bottom:4px}
.foot{max-width:520px;margin:0 auto;padding:16px 16px calc(24px + env(safe-area-inset-bottom,0px));display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:13px}
.foot a{color:var(--forest)}
.chead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:0}
.chead h2{margin:0;flex:none}
.msel{position:relative;display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;background:var(--bg);color:var(--forest);min-width:0;flex:0 1 auto}
.msel .mtxt{font:700 12px var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msel svg{width:9px;height:9px;flex:none;pointer-events:none}
.msel select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;border:0;margin:0;padding:0;font-size:16px}
.msel:hover{background:var(--lime);color:#163300}
@media (max-width:360px){.msel{padding:0 8px}.msel .mtxt{font-size:11px}}
@media (max-height:620px){
  main{padding-top:calc(6px + env(safe-area-inset-top,0px))}
  h1{font-size:clamp(17px,3vh,22px)}
  .sub{font-size:11px;line-height:1.25}
  .card{padding:6px 12px}
  .row{padding:2px 0}
  .result{padding:8px 12px;gap:5px}
  .legend div{padding:4px 8px}
  .btn{padding:9px 14px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
.c-win{background:var(--win)}.c-loss{background:var(--loss)}.c-draw{background:var(--draw)}
.k-win{background:#9fe870}.k-draw{background:#ffc091}.k-loss{background:#ff7b80}
.seg.k-win,.seg.k-draw,.seg.k-loss{color:#163300}
.guide ul{margin:0 0 10px;padding-inline-start:20px;line-height:1.6;font-size:15px}
.guide li{margin-bottom:6px}
.guide a{color:var(--forest)}

/* light only, crisp text, clean focus */
:root{color-scheme:light}
html{-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility;-webkit-tap-highlight-color:transparent}
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
button,select,.lang,.msel{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
select{outline:none}
::selection{background:rgba(159,232,112,.55);color:#0e0f0c}
input:focus{outline:none}
input[type=number]:focus,input[type=number]:focus-visible{outline:none;border-color:var(--forest);box-shadow:inset 0 0 0 1px var(--forest)}
button:focus{outline:none}
button:focus-visible{outline:none;box-shadow:inset 0 0 0 3px var(--forest)}
.btn:focus-visible{box-shadow:inset 0 0 0 3px var(--forest),inset 0 0 0 5px #fff}
.lang:focus-within,.msel:focus-within{outline:none}
.lang:has(select:focus-visible),.msel:has(select:focus-visible){box-shadow:inset 0 0 0 2px var(--forest)}
.tip{margin:0 0 3px;font-size:11.5px;line-height:1.25;font-weight:600;color:var(--muted);overflow-wrap:anywhere}
.ad{min-height:0}

/* Win% brand */
h1{display:flex;flex-direction:column;gap:1px}
h1 .brand{font-size:clamp(26px,4.6vh,34px);line-height:1;font-weight:900;letter-spacing:-.02em;color:var(--forest)}
h1 .kind{font-size:clamp(11.5px,1.7vh,13.5px);line-height:1.2;font-weight:700;letter-spacing:0;color:var(--forest);opacity:.8}
@media (max-height:620px){main{gap:4px}h1 .brand{font-size:22px}h1 .kind{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}h1{min-width:0}}
.by{margin:0;text-align:center;font-size:10px;line-height:1;font-weight:600;letter-spacing:.02em;color:var(--muted);opacity:.75}
@media (max-height:620px){main{gap:3px;padding-bottom:calc(4px + env(safe-area-inset-bottom,0px))}.by{font-size:9px}}
