:root {
    color-scheme: dark;
}

html,
body,
#app,
.app-shell,
.main-stage,
.play-view {
    background: #111;
}

body,
button,
input,
select {
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
    font-weight: 900;
}

.app-shell {
    background-image: none;
}

.app-shell::before,
.topbar,
.play-footer,
.danger-copy {
    display: none !important;
}

.onboarding-tip {
    position: absolute !important;
    z-index: 9;
    top: 31%;
    left: 50%;
    display: grid !important;
    width: 78%;
    min-height: 0;
    gap: 4px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, .76);
    background: transparent !important;
    box-shadow: none !important;
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 4px #000;
    transform: translateX(-50%);
    pointer-events: none;
}

.onboarding-tip.is-hidden {
    display: none !important;
}

.onboarding-tip span {
    font-size: clamp(.54rem, 2.2vw, .76rem);
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.2;
}

.game-head {
    position: absolute;
    z-index: 6;
    top: 28%;
    right: 3px;
    display: flex !important;
    width: 46px;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    padding: 0;
    color: #fff;
    pointer-events: none;
}

.game-head > div:first-child {
    display: grid;
    justify-items: center;
    gap: 3px;
}

.game-head .micro-label {
    color: #777;
    font-family: "Arial Black", "Arial Rounded MT Bold", sans-serif;
    font-size: .55rem;
    letter-spacing: .04em;
}

.game-head [data-score] {
    color: #fff;
    font-family: "Arial Black", "Arial Rounded MT Bold", sans-serif;
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 1000;
    letter-spacing: -.07em;
    line-height: 1;
    text-shadow: 3px 3px 0 #000;
}

.game-head-center,
.game-head .align-right {
    display: none !important;
}

.main-stage {
    padding-top: 0;
}

.play-view {
    position: relative;
    justify-content: flex-start;
    padding: 2px 0;
}

.play-view::before {
    position: absolute;
    z-index: 0;
    left: 7px;
    top: 50%;
    color: #2f2f2f;
    content: "SOBOSUBA";
    font-size: clamp(2.2rem, 9vw, 4rem);
    font-weight: 1000;
    letter-spacing: -.08em;
    line-height: 1;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
}

.board-frame {
    z-index: 1;
    width: min(calc(100vw - 4px), 430px, calc((100dvh - 4px) * .5625));
    min-height: 0;
    max-height: calc(100dvh - 4px);
    border: 11px solid #303030;
    border-radius: 7px 7px 30px 30px;
    background: #000;
    box-shadow: inset 0 0 0 3px #161616, 0 0 0 2px #050505, 0 16px 34px rgba(0, 0, 0, .55);
    overflow: hidden;
}

.board-frame::before,
.board-frame::after {
    position: absolute;
    z-index: 4;
    top: 30%;
    width: 28px;
    height: 58px;
    border: 6px solid #383838;
    background: #232323;
    content: "";
    pointer-events: none;
}

.board-frame::before {
    left: -18px;
    border-radius: 0 40px 40px 0;
}

.board-frame::after {
    right: -18px;
    border-radius: 40px 0 0 40px;
}

.game-canvas {
    border-radius: 0 0 19px 19px;
    background: #000;
}

.rotate-notice,
.unsupported-screen {
    border-color: #353535;
    color: #fff;
    background: #111;
    background-image: none;
}

.modal-layer,
.board-frame .modal-layer {
    background: transparent !important;
    backdrop-filter: none !important;
}

.modal-card,
.board-frame .modal-card {
    width: 100%;
    max-height: 100%;
    padding: 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, .86);
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
    text-shadow: 0 2px 5px #000;
}

.modal-card h2,
.final-score > strong {
    color: #fff;
    font-family: "Arial Black", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
    font-weight: 1000;
    letter-spacing: -.04em;
    text-transform: uppercase;
    -webkit-text-stroke: 0;
    text-shadow: 0 3px 7px #000;
}

.modal-card p,
.modal-card small,
.setting-row small,
.rule-list b,
.rule-list span,
.setting-row strong,
.final-score > span {
    color: rgba(255, 255, 255, .8);
}

.rule-list,
.final-score,
.setting-row,
.run-records > div {
    border: 0 !important;
    color: #fff;
    background: transparent !important;
    box-shadow: none !important;
}

.rule-list > div {
    border: 0 !important;
    color: rgba(255, 255, 255, .82);
    background: transparent !important;
}

.modal-card .primary-button,
.modal-card .text-button {
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(255, 255, 255, .9);
    background: transparent !important;
    box-shadow: none !important;
    font-family: "Arial Black", "Arial Rounded MT Bold", sans-serif;
    text-shadow: 0 2px 4px #000;
    text-transform: uppercase;
}

.modal-card .primary-button:hover,
.modal-card .primary-button:focus-visible,
.modal-card .text-button:hover,
.modal-card .text-button:focus-visible {
    color: #ffe26a;
    outline: 0 !important;
    text-decoration: underline;
    text-underline-offset: 5px;
    transform: none;
}

.setting-row {
    border-bottom: 1px solid rgba(255, 255, 255, .2) !important;
}

.setting-row input,
.setting-row select {
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
    background: rgba(20, 20, 20, .42);
    box-shadow: none;
}

.setting-row input:checked {
    background: #4aff36;
}

.how-diagram i {
    border-color: rgba(255, 255, 255, .55);
    color: #111;
    box-shadow: none;
}

.game-over-card {
    position: absolute;
    top: 45%;
    right: 0;
    width: 46px !important;
    height: 48%;
    align-content: center;
    justify-items: center;
    padding: 0 !important;
    pointer-events: none;
}

.game-over-card .eyebrow {
    display: none;
}

.game-over-card h2 {
    margin: 0 !important;
    color: #ffe26a;
    font-size: clamp(.86rem, 3.5vw, 1.2rem) !important;
    letter-spacing: .08em;
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.game-over-card .final-score,
.game-over-card .new-best,
.game-over-card .record-note {
    display: none !important;
}

.auto-restart-note {
    margin-top: 12px;
    color: rgba(255, 255, 255, .62) !important;
    font-size: clamp(.42rem, 1.6vw, .56rem);
    letter-spacing: .08em;
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    animation: endNoticePulse 1.1s ease-in-out infinite alternate;
}

.game-over-metrics {
    display: none !important;
}

@keyframes endNoticePulse {
    from { opacity: .42; }
    to { opacity: .86; }
}

.toast {
    border: 4px solid #fff;
    border-radius: 14px;
    color: #fff;
    background: #111;
    box-shadow: 0 5px 0 #303030;
    font-family: "Arial Black", "Arial Rounded MT Bold", sans-serif;
    text-transform: uppercase;
}

.board-frame .modal-layer {
    position: absolute;
    z-index: 40;
    inset: 0;
    place-items: center;
    padding: 18px;
    background: transparent;
    backdrop-filter: none;
}

.board-frame .modal-card {
    width: 100%;
    max-height: 100%;
    padding: 12px 10px;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: transparent;
    box-shadow: none;
}

.board-frame .modal-card h2 {
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 8vw, 2.8rem);
}

.board-frame .modal-actions {
    margin-top: 12px;
}

.board-frame .toast {
    display: none !important;
    position: absolute;
    z-index: 60;
    left: 50%;
    bottom: 9%;
    width: 86%;
    min-height: 0;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: transparent;
    box-shadow: none;
    font-family: "Arial Black", "Arial Rounded MT Bold", sans-serif;
    font-size: clamp(1rem, 5vw, 1.55rem);
    line-height: 1.05;
    text-align: center;
    text-shadow: 3px 4px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    transform: translate(-50%, 12px);
}

.board-frame .toast.is-visible {
    transform: translate(-50%, 0);
}

@media (max-width: 520px) {
    .play-view::before {
        left: 2px;
        font-size: 2rem;
    }

    .board-frame {
        width: min(calc(100vw - 4px), calc((100dvh - 4px) * .5625));
        max-height: calc(100dvh - 4px);
        border-width: 8px;
        border-radius: 6px 6px 24px 24px;
    }

    .game-head {
        right: 0;
        width: 38px;
    }

    .game-head [data-score] {
        font-size: 1.15rem;
    }
}

/* Embedded score cards replace the clipped in-canvas HUD. */
.embedded .game-head{display:none!important}
.board-frame .game-over-card{position:relative;top:auto;right:auto;width:100%!important;height:auto;max-height:90%;overflow:auto;padding:24px 16px!important;border:1px solid #9d7bd2;border-radius:22px;background:#201633f5!important;pointer-events:auto;box-shadow:0 14px 60px #000a!important;text-shadow:none}
.board-frame .game-over-card h2{writing-mode:horizontal-tb;transform:none;font-size:clamp(1.3rem,6vw,2rem)!important;line-height:1.2;margin-bottom:16px!important;letter-spacing:-.03em;color:#ffdb7d;text-shadow:none}
.board-frame .game-over-card .final-score{display:grid!important;gap:6px;margin:12px 0}.board-frame .game-over-card .final-score>strong{color:#a2f5e5;font-size:clamp(2.5rem,13vw,4rem);text-shadow:none}.board-frame .game-over-card .new-best:not(.is-hidden){display:block!important;color:#ffdc72}
.board-frame .game-over-card .result-best-line{color:#ffdc72;font-size:13px}.result-best-line strong{margin-left:8px}.board-frame .game-over-card .daily-result{font-size:12px;line-height:1.6;min-height:38px;color:#d4c6e9}
.board-frame .game-over-card .primary-button{min-height:48px;width:100%;border-radius:12px!important;background:linear-gradient(100deg,#a5f3da,#c6b1ff)!important;color:#28163f;text-shadow:none;font-size:15px;text-transform:none}.board-frame .game-over-card .primary-button:focus-visible{outline:3px solid #ffe26a!important;outline-offset:4px}
