:root {
    --ink: #172033;
    --page: #e3eaf3;
    --paper: #fbfcfe;
    --tile: #eef1f6;
    --line: #c5ccd8;
    --wall: #39414f;
    --b: #ffd23f;
    --p: #cdb4f7;
    --ok: #1f7a45;
    --okbg: #ddf3e4;
    --soft: #e8912a;
    --softbg: #fff1da;
    --blue: #2f7bd1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    padding: 24px 12px;
    background: var(--page);
    color: var(--ink);
    font:
        400 17px/1.45 "Atkinson Hyperlegible",
        "Segoe UI",
        system-ui,
        sans-serif;
}

.screen {
    width: 390px;
    max-width: 100%;
    min-height: 700px;
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: 30px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    font-family: Fredoka, "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

.pic {
    display: block;
    flex: none;
    width: var(--s, 80px);
    height: var(--s, 80px);
    object-fit: contain;
}

.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
}

.brand {
    font-weight: 600;
    font-size: 22px;
}

.score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 3px 14px 3px 8px;
    font-size: 20px;
}

.star {
    width: 26px;
    height: 26px;
}

.heart {
    width: 44px;
    height: 44px;
    flex: none;
}

.check {
    position: absolute;
    right: -8px;
    top: -8px;
    width: 30px;
    height: 30px;
}

.tts {
    width: 46px;
    height: 46px;
    flex: none;
    display: inline-grid;
    place-items: center;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    padding: 0;
}

a {
    cursor: pointer;
}

.opt.tried,
.mv.off {
    pointer-events: none;
}

.mv.off {
    opacity: 0.3;
}

.tts svg {
    width: 26px;
    height: 26px;
}

.band {
    height: 34px;
    flex: none;
    border: 3px solid var(--ink);
    border-radius: 12px;
    background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0/22px
        22px;
}

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.grow {
    flex: 1;
    justify-content: center;
}

.disc {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: var(--b);
    border: 4px solid var(--ink);
    display: grid;
    place-items: center;
}

.title {
    font-size: 58px;
    font-weight: 600;
    margin: 6px 0 0;
    line-height: 1;
}

.big {
    font-size: 40px;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
}

.big.ok {
    color: var(--ok);
    font-size: 48px;
}

.win {
    font-size: 26px;
    margin: 0;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 96px;
    border-radius: 28px;
    background: var(--ok);
    color: #fff;
    border: 4px solid var(--ink);
    box-shadow: 0 6px 0 var(--ink);
    font-size: 38px;
    font-weight: 600;
    margin-top: auto;
    white-space: nowrap;
}

.btn.sm {
    font-size: 30px;
}

.tile-p {
    display: inline-grid;
    place-items: center;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 16px;
    padding: 4px;
}

.map {
    display: grid;
    grid-template-columns: repeat(5, 52px);
    width: max-content;
    margin: 0 auto;
    border: 3px solid var(--ink);
    border-radius: 8px;
    overflow: hidden;
}

.tile {
    width: 52px;
    height: 52px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 13px;
    line-height: 1;
}

.tile.free {
    background: var(--tile);
}

.tile.wall {
    background: var(--wall);
}

.tile.meta {
    background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0/26px
        26px;
}

.tile.tb {
    background: var(--b);
}

.tile.tp {
    background: var(--p);
}

.tile b {
    font-weight: 600;
}

.tile.dest {
    outline: 4px dashed #dc322f;
    outline-offset: -4px;
}

.tok {
    position: absolute;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.rk .tok,
.ranking .tok {
    position: static;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    flex-wrap: wrap;
}

.lg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: 1px 10px 1px 6px;
}

.lg.tb {
    background: var(--b);
}

.lg.tp {
    background: var(--p);
}

.lg.ds {
    border: 3px dashed #dc322f;
    background: #fff;
}

.tutor {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1.2;
}

.tutor div {
    flex: 1;
}

.moves {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mv {
    position: relative;
    display: grid;
    place-items: center;
    height: 116px;
    background: #fff;
    border: 4px solid var(--blue);
    border-radius: 22px;
}

.mv.sug {
    border-color: #dc322f;
    background: #fff4f3;
}

.mv i {
    position: absolute;
    right: -6px;
    top: -10px;
}

.lockchip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 3px solid var(--ink);
    border-radius: 20px;
    padding: 6px 14px 6px 8px;
    font-size: 24px;
}

.lockchip.tb {
    background: var(--b);
}

.lockchip.tp {
    background: var(--p);
}

.panel {
    position: relative;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 24px;
    padding: 62px 8px 18px;
}

.panel .tts {
    position: absolute;
    right: 10px;
    top: 8px;
}

.op {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sym {
    font-size: 56px;
    font-weight: 600;
    width: 34px;
    text-align: center;
    line-height: 1;
}

.slot {
    position: relative;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 4px dashed #8793a8;
    border-radius: 18px;
    font-size: 56px;
    color: #5b6679;
}

.slot b {
    font-weight: 600;
}

.slot.done {
    border: 4px solid var(--ok);
    background: var(--okbg);
}

.okp {
    background: #fff;
    padding: 20px 8px;
}

.opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.opt {
    display: grid;
    place-items: center;
    height: 140px;
    background: #fff;
    border: 4px solid var(--blue);
    border-radius: 24px;
}

.opt.tried {
    border-color: var(--soft);
    background: var(--softbg);
}

.opt.tried .pic {
    opacity: 0.45;
}

.soft.wide {
    width: 100%;
}

.soft {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--softbg);
    border: 3px solid var(--soft);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 22px;
    line-height: 1.2;
}

.tries {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: auto;
}

.tries i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--ink);
    background: #fff;
}

.tries i.on {
    background: var(--soft);
}

.stars {
    display: flex;
    gap: 6px;
}

.stars .star {
    width: 44px;
    height: 44px;
}

.stars .star:nth-child(2) {
    position: relative;
    top: -10px;
}

.plus {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--b);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 6px 20px 6px 12px;
    font-size: 28px;
}

.trophy {
    width: 130px;
    height: 130px;
}

.ranking {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.rk {
    display: grid;
    grid-template-columns: 30px 36px 1fr auto;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 22px;
}

.rk.me {
    background: var(--b);
}

.rk .tok {
    width: 34px;
    height: 34px;
}

.rk .pt {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos {
    font-weight: 600;
}

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

.slot {
    width: 84px;
    height: 84px;
    font-size: 52px;
}

.sym {
    width: 30px;
    font-size: 52px;
}

.op {
    gap: 4px;
}

.panel {
    width: 100%;
}

@media (max-width: 430px) {
    .screen {
        padding: 12px;
    }
}

a.btn,
a.opt,
a.mv {
    cursor: pointer;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
}

a.btn:hover {
    transform: translateY(-2px);
}

a.btn:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 var(--ink);
}

a.opt:hover,
a.mv:hover {
    transform: translateY(-3px);
    background: #f3f8ff;
}

a.opt:active,
a.mv:active {
    transform: translateY(1px);
}

a:focus-visible {
    outline: 5px solid #dc322f;
    outline-offset: 3px;
}

.opt[aria-disabled] {
    pointer-events: none;
}

.slot.shown {
    border: 4px solid var(--soft);
    background: var(--softbg);
}

.note {
    font:
        400 14px/1.4 "Atkinson Hyperlegible",
        "Segoe UI",
        system-ui,
        sans-serif;
    color: #46506a;
    text-align: center;
    max-width: 390px;
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    a.btn,
    a.opt,
    a.mv {
        transition: none;
    }
}

.screen {
    position: relative;
}

.gear {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 46px;
    height: 46px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.settings {
    position: absolute;
    top: 66px;
    left: 12px;
    right: 12px;
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 16px;
    padding: 14px;
    z-index: 2;
}

.settings select {
    display: block;
    width: 100%;
    margin-top: 6px;
    font: inherit;
    font-size: 18px;
    padding: 8px;
}

.tile {
    width: var(--t, 52px);
    height: var(--t, 52px);
}

.opt.sel {
    outline: 4px solid #dc322f;
    outline-offset: 2px;
}

.map {
    display: block;
    width: max-content;
}

.view {
    overflow: hidden;
    height: calc(var(--rows) * var(--t));
}

.grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), var(--t));
}

.confetti {
    position: absolute;
    left: 50%;
    top: 25%;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
}

.settings label {
    display: block;
    font-size: 18px;
    margin-top: 12px;
}
