.sm {
    --ink: #303b31;
    --red: #b94d3e;
    --cream: #fffaf0;
    --green: #506b50;
    background: #f6efe2;
    color: var(--ink);
    padding: 52px 18px 60px;
    margin-top: -40px;
    font: 14px/1.6 system-ui, -apple-system, 'Microsoft JhengHei', sans-serif
}

.sm * {
    box-sizing: border-box
}

.sm [hidden] {
    display: none !important
}

.sm-wrap {
    max-width: 1110px;
    margin: auto
}

.sm a {
    color: inherit;
    text-decoration: none
}

.sm button {
    font: inherit;
    cursor: pointer;
    border: 1px solid #d5cbb7;
    background: #fffdf5;
    color: var(--ink);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    touch-action: manipulation
}

.sm button:disabled {
    opacity: .5;
    cursor: default
}

.sm button:focus-visible,
.sm a:focus-visible,
.sm summary:focus-visible {
    outline: 3px solid #c76940;
    outline-offset: 3px
}

.sm-nav {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px
}

.sm-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 36px 0 28px;
    gap: 20px
}

.sm-eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
    margin: 0 0 10px
}

.sm-intro .sm-eyebrow span {
    color: #8d9385;
    margin-left: 20px
}

.sm h1 {
    font-size: clamp(28px, 3.5vw, 44px);
    line-height: 1.3;
    letter-spacing: -1px;
    font-weight: 850;
    margin: 14px 0
}

.sm h1 em {
    font-style: normal;
    color: var(--red)
}

.sm-intro>div>p:last-child {
    font-size: 13px;
    color: #7c8172;
    margin: 14px 0 0
}

.sm-stamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border: 2px solid #b5684c;
    border-radius: 50%;
    color: #a64f3d;
    transform: rotate(8deg);
    flex-shrink: 0
}

.sm-stamp b {
    font-size: 34px;
    line-height: 1.4
}

.sm-stamp span {
    font-size: 9px;
    letter-spacing: 1px
}

.sm-worlds {
    display: flex;
    gap: 26px;
    border-bottom: 1px solid #d8cfbc;
    margin-bottom: 22px;
    font-size: 11px;
    font-weight: 700;
    color: #969884
}

.sm-worlds span {
    padding: 10px 0
}

.sm-worlds .is-current {
    color: #a84d37;
    border-bottom: 3px solid #b86648;
    margin-bottom: -1px
}

.sm-cabinet {
    border: 1px solid #c7bca7;
    border-radius: 16px;
    overflow: hidden;
    background: #fffaf0;
    box-shadow: 0 8px 0 #dcd5c5
}

.sm-brand {
    background: #bd6552;
    color: #fff7e4;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px
}

.sm-brand>div {
    display: flex;
    align-items: center;
    gap: 12px
}

.sm-brand h2 {
    color: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0
}

.sm-brand p {
    font-size: 10px;
    margin: 4px 0 0;
    letter-spacing: 1px
}

.sm-mark {
    background: #fff2cd;
    color: #a1513b;
    font-size: 25px;
    border-radius: 8px;
    padding: 0 8px;
    transform: rotate(-5deg)
}

.sm-brand button {
    background: transparent;
    border-color: #e8b4a0;
    color: inherit;
    font-size: 11px;
    flex-shrink: 0
}

.sm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px
}

.sm-play {
    padding: 24px;
    background: #f1e5ce;
    border-right: 1px solid #ded2bd
}

.sm-mission {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px
}

.sm-mission span {
    font-size: 9px;
    letter-spacing: 1px;
    color: #977958
}

.sm-mission h3 {
    font-size: 16px;
    color: var(--ink);
    margin: 3px 0 0
}

.sm-mission button {
    font-size: 10px;
    padding: 8px 10px
}

.sm-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #fffcf2;
    border: 1px solid #dfd1b6;
    border-radius: 10px;
    margin-bottom: 14px
}

.sm-hud>div {
    display: flex;
    flex-direction: column
}

.sm-hud span {
    font-size: 9px;
    letter-spacing: 1px;
    color: #93856c
}

.sm-hud b {
    font: 700 26px/1.4 ui-monospace, monospace;
    color: #45573f
}

.sm-hud #sm-moves {
    color: #b9543e
}

.sm-hud .sm-fever {
    align-items: flex-end
}

.sm-hud #sm-fever {
    font: 700 13px/2 system-ui, sans-serif;
    color: #b66d3a
}

.sm-board-wrap {
    position: relative;
    background: #798b66;
    padding: 10px;
    border-radius: 13px;
    border: 4px solid #667a55;
    max-width: 610px;
    margin: auto;
    box-shadow: inset 0 0 0 1px #a1ad8d
}

.sm-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    aspect-ratio: 1;
    touch-action: none
}

.sm button.sm-cell {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #e0d4b6;
    border-radius: 9px;
    background: #fff9e9;
    min-width: 0;
    aspect-ratio: 1;
    overflow: visible;
    transition: transform .15s, opacity .15s, background .15s;
    isolation: isolate;
    box-shadow: 0 2px 0 #56684a
}

.sm button.sm-cell:nth-child(16n+2),
.sm button.sm-cell:nth-child(16n+4),
.sm button.sm-cell:nth-child(16n+6),
.sm button.sm-cell:nth-child(16n+8),
.sm button.sm-cell:nth-child(16n+9),
.sm button.sm-cell:nth-child(16n+11),
.sm button.sm-cell:nth-child(16n+13),
.sm button.sm-cell:nth-child(16n+15) {
    background: #f1e7cf
}

.sm-sushi {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    background-image: url('sushi-sprites.png');
    background-size: 300% 200%;
    background-repeat: no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 2px 1px #45361d22)
}

.sm-sushi[data-type="0"] {
    background-position: 0 0
}

.sm-sushi[data-type="1"] {
    background-position: 50% 0
}

.sm-sushi[data-type="2"] {
    background-position: 100% 0
}

.sm-sushi[data-type="3"] {
    background-position: 0 100%
}

.sm-sushi[data-type="4"] {
    background-position: 50% 100%
}

.sm-sushi[data-type="5"] {
    background-position: 100% 100%
}

.sm .sm-cell.is-selected {
    outline: 3px solid #e79045;
    outline-offset: 0;
    z-index: 2;
    background: #ffe4ab;
    transform: scale(1.06)
}

.sm .sm-cell.is-clearing {
    transform: scale(.35) rotate(8deg);
    opacity: .1
}

.sm .sm-cell.is-created {
    outline: 3px solid #efb02c;
    outline-offset: -2px
}

.sm .sm-cell.is-hint {
    animation: sm-hint .65s ease-in-out 3
}

.sm .sm-cell[data-ice="1"] {
    box-shadow: inset 0 0 0 3px #a5dae5, 0 2px 0 #56684a
}

.sm .sm-cell[data-ice="2"] {
    box-shadow: inset 0 0 0 5px #6cc3df, 0 2px 0 #56684a
}

.sm .sm-cell[data-ice="2"]:after {
    content: '❄';
    position: absolute;
    right: 2px;
    top: 0;
    font-size: 12px;
    color: #30748c;
    text-shadow: 0 0 2px #fff;
    pointer-events: none
}

.sm-power {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: #244e3cdd;
    color: #fff3b8;
    font-size: 10px;
    border-radius: 0 0 6px 6px;
    line-height: 1.25;
    pointer-events: none
}

.sm-power.is-bomb {
    background: #b14c3ce8;
    font-size: 8px;
    letter-spacing: 1px
}

.sm-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    background: #fffaf0ef;
    border-radius: 8px;
    padding: 25px;
    z-index: 5
}

.sm-overlay>div {
    max-width: 330px
}

.sm-overlay p:first-child {
    font-size: 9px;
    color: #a76f47;
    letter-spacing: 2px;
    font-weight: 800
}

.sm-overlay h3 {
    font-size: clamp(21px, 2.5vw, 30px);
    font-weight: 800;
    color: #4d5b3b;
    margin: 14px 0
}

.sm-overlay p {
    font-size: 12px;
    line-height: 1.9;
    color: #7a8069
}

.sm .sm-primary {
    background: #bd654f;
    color: #fff7e1;
    border: 0;
    padding: 13px 28px;
    font-size: 13px;
    box-shadow: 0 3px 0 #95533f
}

.sm-overlay a {
    display: block;
    font-size: 11px;
    margin-top: 20px;
    color: #986041;
    text-decoration: underline;
    text-underline-offset: 4px
}

.sm-status {
    font-size: 11px;
    min-height: 20px;
    color: #7b745d;
    margin: 13px 0
}

.sm-actions {
    display: flex;
    align-items: center;
    gap: 9px
}

.sm-actions>span {
    margin-left: auto;
    font-size: 10px;
    color: #94866b
}

.sm-sidebar {
    padding: 22px
}

.sm-order {
    padding: 19px 16px;
    border: 1px solid #dfd4bf;
    background: #fffef7;
    position: relative;
    box-shadow: 0 3px 0 #e4dcca
}

.sm-order:before {
    content: '';
    position: absolute;
    width: 45px;
    height: 13px;
    top: -7px;
    left: calc(50% - 22px);
    background: #c6b78580;
    transform: rotate(-5deg)
}

.sm-order .sm-eyebrow {
    font-size: 8px;
    color: #9e8768;
    letter-spacing: 1px
}

.sm-order h3 {
    font-size: 20px;
    color: #48533c;
    margin: 10px 0 16px
}

.sm-target {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 9px;
    margin: 10px 0
}

.sm-target .sm-sushi {
    width: 48px
}

.sm-target>div>span {
    font-size: 11px
}

.sm-target b {
    float: right;
    font: 700 12px monospace;
    color: #9f6843
}

.sm-target progress {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 5px;
    accent-color: #7f9c5c
}

.sm-target.is-done b {
    color: #548649
}

.sm-order-total {
    border-top: 1px dashed #d0bfa2;
    margin-top: 17px;
    padding-top: 13px;
    display: flex;
    justify-content: space-between;
    font-size: 11px
}

.sm-order-total strong {
    font: 700 16px monospace;
    color: #9d5c3b
}

.sm #sm-extra-goal {
    font-size: 10px;
    line-height: 1.9;
    color: #788069;
    margin: 10px 0 0
}

.sm-tip {
    margin: 23px 0 18px
}

.sm-tip>b {
    font-size: 12px;
    color: #7c674b
}

.sm-tip p,
.sm-tip>span {
    font-size: 10px;
    line-height: 1.9;
    color: #8c826c
}

.sm-tip>span {
    color: #b36b4f
}

.sm-progress {
    display: grid;
    gap: 8px;
    font-size: 10px;
    border-block: 1px solid #ddd4c0;
    padding: 13px 0
}

.sm-progress b {
    float: right;
    font: 700 12px monospace
}

.sm-ranking {
    margin-top: 21px
}

.sm-ranking h3 {
    font-size: 13px;
    color: var(--ink);
    margin: 0
}

.sm-ranking h3 span {
    float: right;
    font: 9px monospace;
    color: #a19882
}

.sm-ranking ol {
    padding-left: 23px;
    font: 10px monospace;
    margin: 13px 0
}

.sm-ranking li {
    padding: 5px 0
}

.sm-ranking li span {
    float: right
}

.sm-ranking p,
.sm-ranking a {
    font-size: 10px;
    line-height: 1.8
}

.sm-ranking a {
    color: #9b6044;
    border-bottom: 1px solid #c8a68a
}

.sm-ranking button {
    margin-top: 10px
}

.sm-levels {
    padding: 25px
}

.sm-selection-heading {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.sm-selection-heading h3 {
    font-size: 20px;
    color: var(--ink)
}

.sm-level-world {
    margin-bottom: 25px
}

.sm-level-world h4 {
    font-size: 14px;
    color: #9c634a
}

.sm-level-world>div {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px
}

.sm-level-world button {
    padding: 12px 5px
}

.sm-level-world button b {
    display: block;
    font-size: 19px
}

.sm-level-world button span {
    font-size: 9px;
    display: block;
    color: #918771
}

.sm-level-world button.is-complete {
    background: #e8efdb;
    border-color: #a4b18a
}

.sm-menu {
    margin: 34px 0
}

.sm-menu>p {
    font-size: 10px;
    letter-spacing: 1px;
    color: #9b7b5c;
    font-weight: 800
}

.sm-menu>p>span {
    font-weight: 400;
    color: #9d9783;
    margin-left: 20px;
    letter-spacing: 0
}

.sm-menu>div {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px
}

.sm-menu article {
    display: flex;
    align-items: center;
    gap: 4px
}

.sm-menu article .sm-sushi {
    width: 55px;
    flex-shrink: 0
}

.sm-menu article b {
    font-size: 11px
}

.sm-menu article small {
    display: block;
    font-size: 8px;
    letter-spacing: 1px;
    color: #9c9681
}

.sm-help {
    border-top: 1px solid #d8cfbc;
    padding-top: 18px;
    font-size: 12px
}

.sm-help summary {
    cursor: pointer;
    font-weight: 700;
    color: #716c55
}

.sm-help p {
    max-width: 880px;
    font-size: 12px;
    line-height: 1.95;
    color: #807f6d
}

@keyframes sm-hint {
    50% {
        transform: scale(.87);
        background: #f9cc87
    }
}

@media(max-width:800px) {
    .sm {
        margin-top: -40px;
        padding: 42px 12px 40px
    }

    .sm-intro {
        margin: 28px 0 20px
    }

    .sm-intro .sm-eyebrow span {
        display: block;
        margin: 7px 0
    }

    .sm-stamp {
        width: 80px;
        height: 80px
    }

    .sm-stamp b {
        font-size: 26px
    }

    .sm-stamp span {
        font-size: 7px
    }

    .sm-layout {
        grid-template-columns: 1fr
    }

    .sm-play {
        padding: 18px;
        border-right: 0
    }

    .sm-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px
    }

    .sm-order {
        grid-row: span 2
    }

    .sm-tip {
        margin: 0
    }

    .sm-ranking {
        grid-column: 1/-1;
        margin: 0
    }

    .sm-progress {
        align-self: start
    }

    .sm-menu>div {
        grid-template-columns: repeat(3, 1fr)
    }

    .sm-level-world>div {
        grid-template-columns: repeat(5, 1fr)
    }

    .sm-brand {
        padding: 16px
    }

    .sm-brand h2 {
        font-size: 12px;
        letter-spacing: 1px
    }

    .sm-worlds {
        gap: 20px;
        font-size: 10px
    }
}

@media(max-width:440px) {
    .sm-intro {
        gap: 8px
    }

    .sm-intro h1 {
        font-size: 29px;
        line-height: 1.5;
        max-width: 275px
    }

    .sm-stamp {
        display: none
    }

    .sm-brand>div {
        gap: 8px
    }

    .sm-brand h2 {
        font-size: 10px;
        letter-spacing: .6px
    }

    .sm-brand button {
        padding: 8px;
        font-size: 9px
    }

    .sm-mark {
        font-size: 21px
    }

    .sm-play {
        padding: 12px
    }

    .sm-mission h3 {
        font-size: 14px
    }

    .sm-hud {
        padding: 10px 12px
    }

    .sm-hud b {
        font-size: 23px
    }

    .sm-hud #sm-fever {
        font-size: 11px
    }

    .sm-board-wrap {
        padding: 5px;
        border-width: 3px
    }

    .sm-board {
        gap: 3px
    }

    .sm button.sm-cell {
        border-radius: 6px
    }

    .sm-actions {
        gap: 6px
    }

    .sm-actions button {
        padding: 9px 10px;
        font-size: 11px
    }

    .sm-actions>span {
        display: none
    }

    .sm-sidebar {
        padding: 19px 14px;
        gap: 15px;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr)
    }

    .sm-order {
        padding: 16px 10px
    }

    .sm-order h3 {
        font-size: 18px
    }

    .sm-target {
        grid-template-columns: 36px 1fr;
        gap: 4px
    }

    .sm-target .sm-sushi {
        width: 36px
    }

    .sm-target>div>span {
        font-size: 9px
    }

    .sm-target b {
        font-size: 10px
    }

    .sm-order-total strong {
        font-size: 14px
    }

    .sm-menu {
        margin: 27px 0
    }

    .sm-menu>div {
        gap: 8px
    }

    .sm-menu article {
        gap: 0
    }

    .sm-menu article .sm-sushi {
        width: 43px
    }

    .sm-menu article b {
        font-size: 9px
    }

    .sm-menu article small {
        font-size: 7px
    }

    .sm-menu>p>span {
        display: block;
        margin: 6px 0
    }

    .sm-overlay {
        padding: 14px
    }

    .sm-overlay h3 {
        margin: 9px 0
    }

    .sm-overlay p {
        font-size: 11px
    }

    .sm-overlay .sm-primary {
        padding: 11px 24px
    }

    .sm-worlds {
        justify-content: space-between;
        gap: 6px
    }

    .sm-power {
        font-size: 9px
    }

    .sm-power.is-bomb {
        font-size: 6px
    }
}

@media(prefers-reduced-motion:reduce) {
    .sm .sm-cell {
        transition: none !important;
        animation: none !important
    }
}

.sm-sushi {
    clip-path: inset(2% 4%)
}

.sm-cell.is-selected .sm-sushi {
    animation: sm-bounce .7s ease-in-out infinite
}

.sm-cell:has(.sm-power:not(.is-bomb)):before {
    content: '';
    position: absolute;
    width: 70%;
    height: 3px;
    background: #f2ba60;
    border: 1px solid #98623b;
    box-shadow: 0 5px 0 #df9f46;
    transform: rotate(-25deg);
    z-index: 2;
    pointer-events: none
}

@keyframes sm-bounce {
    50% {
        transform: translateY(-2px) rotate(-3deg)
    }
}

@media(max-width:440px) {
    .sm-intro h1 {
        max-width: none;
        font-size: 28px
    }
}

@media(prefers-reduced-motion:reduce) {
    .sm-sushi {
        animation: none !important
    }
}