/* B0X3 v128 - settings sheet, AI level chooser, menu gear, HUD level tag (js/Settings.js) */
.st {
    position: fixed; inset: 0; z-index: 3200; display: none; align-items: center; justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(4, 5, 9, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-family: "Oswald", sans-serif; color: #fff;
}
.st.v { display: flex; animation: stIn .18s ease-out both; }
.st[hidden] { display: none !important; }
@keyframes stIn { from { opacity: 0; } to { opacity: 1; } }
.st-box {
    width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
    border-radius: 18px; background: linear-gradient(160deg, #1e2230, #0a0b10);
    border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
}
.st-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.st-head h2 { margin: 0; font-family: "Teko", sans-serif; font-weight: 600; font-size: 32px; line-height: 1; letter-spacing: .14em; color: #f0c040; text-align: center; white-space: nowrap; }
.st-back, .st-small, .st-done, .st-tog, .st-opt {
    font-family: "Teko", sans-serif; font-weight: 600; letter-spacing: .1em; line-height: 1; cursor: pointer; color: #fff;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .1s, filter .15s, background .15s;
}
.st-back { justify-self: start; min-height: 44px; padding: 6px 12px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); font-size: 20px; }
.st-sp { display: block; }
.st-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 6px; display: grid; gap: 4px; }
.st-sec h3 { margin: 10px 0 4px; font-family: "Teko", sans-serif; font-weight: 600; font-size: 20px; letter-spacing: .2em; color: rgba(255, 255, 255, .55); }
.st-row { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 4px 10px; min-height: 48px; padding: 2px 6px; border-radius: 10px; }
.st-row:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.st-row.st-off { opacity: .45; }
.st-row-seg { grid-template-columns: 30px 1fr auto; }
.st-ic { font-size: 18px; text-align: center; }
.st-lab { font-size: 15.5px; line-height: 1.2; }
.st-lab small { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .58); }
.st-row input[type=range] { width: min(190px, 36vw); height: 44px; accent-color: #f0c040; cursor: pointer; }
.st-val { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: rgba(255, 255, 255, .75); }
.st-tog { grid-column: 3 / 5; justify-self: end; min-width: 72px; min-height: 40px; padding: 4px 12px; border-radius: 20px; font-size: 19px;
    border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.st-tog[aria-checked="true"] { background: linear-gradient(135deg, #2bb04a, #1d8a37); border-color: transparent; }
.st-seg { display: inline-flex; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .2); overflow: hidden; justify-self: end; }
.st-opt { min-height: 40px; min-width: 64px; padding: 4px 12px; font-size: 18px; border: 0; background: transparent; }
.st-opt + .st-opt { border-left: 1px solid rgba(255, 255, 255, .14); }
.st-opt[aria-checked="true"] { background: #f0c040; color: #111; }
.st-note { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 4px 6px; padding: 8px 10px; border-radius: 10px;
    background: rgba(240, 192, 64, .12); border: 1px solid rgba(240, 192, 64, .35); font-size: 14px; }
.st-note[hidden] { display: none; }
.st-hint { margin: 6px; font-size: 14px; color: rgba(255, 255, 255, .7); }
.st-hint a { color: #f0c040; }
.st-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px) * 0); border-top: 1px solid rgba(255, 255, 255, .08); }
.st-small { min-height: 44px; padding: 6px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); font-size: 18px; }
.st-done { min-height: 48px; min-width: 140px; padding: 6px 22px; border-radius: 11px; border: 0; background: linear-gradient(135deg, #d92027, #b3151b); font-size: 23px; letter-spacing: .14em; }
.st button:hover { filter: brightness(1.12); }
.st button:active { transform: scale(.97); }
.st button:focus-visible, .st input:focus-visible { outline: 2px solid #f0c040; outline-offset: 2px; }
.st-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* AI chooser */
.ch-box { width: min(760px, 100%); }
.ch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 6px 14px 16px; overflow-y: auto; }
.ch-lv {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px; padding: 14px 12px 12px;
    border-radius: 14px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #fff; text-align: left;
    font-family: "Oswald", sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .1s, border-color .15s, background .15s;
}
.ch-lv:hover { background: rgba(255, 255, 255, .09); }
.ch-lv:active { transform: scale(.97); }
.ch-lv:focus-visible { outline: 3px solid #f0c040; outline-offset: 2px; }
.ch-name { font-family: "Teko", sans-serif; font-weight: 600; font-size: 30px; line-height: .9; letter-spacing: .1em; }
.ch-dots { font-size: 12px; letter-spacing: 3px; }
.ch-sub { font-size: 13.5px; line-height: 1.25; color: rgba(255, 255, 255, .72); }
.ch-last { position: absolute; top: 8px; right: 8px; display: none; padding: 2px 7px; border-radius: 8px; font-size: 11px; letter-spacing: .12em; background: #f0c040; color: #111; }
.ch-lv.is-last { border-color: #f0c040; background: rgba(240, 192, 64, .1); }
.ch-lv.is-last .ch-last { display: block; }
.ch-easy .ch-dots { color: #4cd964; } .ch-normal .ch-dots { color: #5ac8fa; } .ch-hard .ch-dots { color: #ff9500; } .ch-champion .ch-dots { color: #ff3b30; }
.ch-champion .ch-name { color: #ffcf5a; }
@media (max-width: 700px) {
    .ch-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 430px) {
    .st-head { padding: 6px 10px 2px; }
    .st-head h2 { font-size: 26px; }
    .ch-lv { min-height: 0; padding: 10px; gap: 4px; }
    .ch-name { font-size: 25px; }
    .ch-sub { font-size: 12.5px; }
    .st-row { min-height: 44px; }
}
@media (max-height: 340px) {
    .ch-sub { display: none; }
}
@media (max-width: 420px) {
    .st-head h2 { font-size: 24px; letter-spacing: .08em; }
    .st-row { grid-template-columns: 26px 1fr auto; }
    .st-row input[type=range] { grid-column: 2 / 3; width: 100%; }
    .st-row .st-val { grid-column: 3; }
    .st-row input[type=range] + .st-val { }
    .st-row:has(input[type=range]) .st-lab { grid-column: 2 / 4; }
    .st-row:has(input[type=range]) .st-ic { grid-row: span 2; }
    .st-tog { grid-column: 3; }
    .st-row-seg { grid-template-columns: 26px 1fr; }
    .st-row-seg .st-seg { grid-column: 1 / 3; justify-self: stretch; }
    .st-row-seg .st-opt { flex: 1; }
    .ch-head-sp { display: none; }
}
@media (prefers-reduced-motion: reduce) { .st.v { animation: none; } }

/* menu gear (top right of the menu, out of the button rows) */
.menu-gear {
    position: absolute; z-index: 5; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
    width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(8, 9, 14, .55); color: #fff; font-size: 22px; line-height: 1;
    -webkit-tap-highlight-color: transparent; transition: transform .2s, background .15s;
}
.menu-gear:hover { background: rgba(8, 9, 14, .85); transform: rotate(30deg); }
.menu-gear:focus-visible { outline: 2px solid #f0c040; outline-offset: 2px; }

/* the AI level next to the opponent's name on the HUD */
.ai-lv { display: inline-block; margin: 0 6px; padding: 1px 6px; border-radius: 6px; font-size: .62em; letter-spacing: .1em; vertical-align: middle;
    background: rgba(255, 255, 255, .14); color: #fff; }
.ai-lv.lv-easy { background: rgba(76, 217, 100, .3); } .ai-lv.lv-hard { background: rgba(255, 149, 0, .38); } .ai-lv.lv-champion { background: rgba(255, 59, 48, .45); }

/* calmer effects: no full-screen hit flashes */
.b0x3-calm .flash { display: none !important; }

/* victory screen: the fight HUD is not drawn behind it (it showed through on phones) */
body.b0x3-vic #hud { opacity: 0; transition: opacity .3s; pointer-events: none; }

/* ======================== victory actions (v128): every way out, primary first and biggest ======================== */
.vic-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 460px); gap: 8px; }
.vic-actions .vic-btn { min-height: 46px; font-size: 18px; letter-spacing: .1em; padding: 6px 6px; line-height: 1.05; white-space: normal; }
.vic-actions .vic-btn[hidden] { display: none !important; }
.vic-actions .vic-primary { grid-column: 1 / -1; min-height: 58px; font-size: 26px; letter-spacing: .2em; }
.vic-actions .vic-btn-2 { background: linear-gradient(135deg, #1f5fff, #1544c8); color: #fff; border: 0; box-shadow: none; }
.vic-actions .vic-btn-menu, .vic-actions .share-result-btn { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .25); color: #fff; box-shadow: none; }
.vic-actions .share-result-btn { color: #f0c040; border-color: rgba(240, 192, 64, .45); }
.vic-actions.two .vic-btn:not(.vic-primary):not([hidden]) { grid-column: span 3; }
.vic-actions.wait .vic-primary { filter: saturate(.4) brightness(.85); }
.vic-rm { grid-column: 1 / -1; margin: 0; font-family: "Oswald", sans-serif; font-size: 15px; line-height: 1.25; color: #f0c040; text-align: center; }
.vic-rm[hidden] { display: none; }
@media (max-width: 860px) {
    .vic-actions { width: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 22px 12px max(10px, env(safe-area-inset-bottom)); gap: 8px; }
    .vic-actions .vic-btn { font-size: 16px; letter-spacing: .08em; padding: 6px 4px; }
    .vic-actions .vic-primary { font-size: 23px; letter-spacing: .16em; }
    .vic-content { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
}
/* phones held sideways: one row, primary wider */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
    .vic-actions { grid-template-columns: 1.5fr 1fr 1fr 1fr; padding-top: 16px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    .vic-actions .vic-primary { grid-column: auto; min-height: 50px; }
    .vic-actions .vic-btn { min-height: 50px; }
    .vic-actions.two { grid-template-columns: 1.5fr 1fr; }
    .vic-actions.two .vic-btn:not(.vic-primary):not([hidden]) { grid-column: auto; }
    .vic-content { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}
.vic-actions .vic-btn:disabled { opacity: .45; filter: grayscale(.7); cursor: default; box-shadow: none; }
.vic-actions .vic-primary.pulse { animation: vicPulse 1.1s ease-in-out infinite; }
@keyframes vicPulse { 50% { transform: scale(1.03); box-shadow: 0 0 26px rgba(255, 80, 60, .55); } }
@media (prefers-reduced-motion: reduce) { .vic-actions .vic-primary.pulse { animation: none; } }
