* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: #fff9e9; color: #172c42; font-family: "Nunito", system-ui, sans-serif }
main { width: min(100% - 24px, 600px, max(420px, 100svh - 230px)); margin: 0 auto; padding: 12px 0 }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap }
h1 { margin: 0; color: #145647; font-size: clamp(34px, 8vw, 54px); line-height: 1.1; letter-spacing: -.05em }
h1 span { font-size: .34em; margin-left: .65em; letter-spacing: 0 }
header p { margin: 0 0 8px; font-size: .88rem; font-weight: 700 }
.game { background: #152e45; border-radius: 21px; padding: 9px; color: #fff; box-shadow: 0 6px 0 #e4d8be }
.stats { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; font-size: .75rem; padding: 3px 5px 8px }
.stats b { font-size: 1.15rem; font-variant-numeric: tabular-nums }
#lives { color: #ffd64d; letter-spacing: 1px }
.order { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; padding-bottom: 8px }
.order p { width: 100%; text-align: center; margin: 0; font-weight: 750 }
button { font: inherit; font-weight: 750; cursor: pointer; border: 0; border-radius: 12px; background: #e1f5e9; color: #16483d; padding: 7px 11px; min-height: 38px }
button:disabled { opacity: .55; cursor: default }
button:focus-visible { outline: 3px solid #ea852f; outline-offset: 2px }
.board { position: relative; border-radius: 12px; overflow: hidden }
canvas { display: block; width: 100%; aspect-ratio: 1 }
#overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #0a223255 }
.card { background: #fff9e9; color: #16344a; padding: 13px 19px 17px; text-align: center; border-radius: 19px; box-shadow: 0 6px 0 #0e253a70 }
.card h2 { font-size: clamp(18px, 5vw, 25px); margin: 0 }
.card p { margin: 8px 0 12px; font-size: .9rem; white-space: pre-line }
#play { background: #ffce49; color: #3a2d09; min-height: 44px; padding-inline: 25px }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 12px }
.controls p, #feedback { font-size: .74rem; margin: 5px 0 }

.controls { justify-content: flex-start; gap: 10px }
.collection { margin-top: 12px; padding: 9px 12px; border-radius: 14px; background: #fff1ce }
.collection h2 { margin: 0; font-size: .95rem }
#count { margin-left: .4em; font-size: .8em; color: #614d22 }
#collected { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 5px 0 0; gap: 4px }
#collected li { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fffbf0; font-size: 21px }
#trap-guide { margin: 6px 0; font-size: .75rem }
.account-panel { margin-top: 14px; padding: 12px; border-radius: 14px; background: #fff1ce }
.account-panel h2 { font-size: 1.1rem; margin: 0 0 8px }
.account-panel label { display: grid; gap: 4px; margin: 8px 0 }
.account-panel input, .account-panel select { max-width: 100%; font: inherit; padding: 6px; border: 1px solid #8b8171; border-radius: 7px; color: #172c42; background: #fff }
.account-panel p { margin: 6px 0; font-size: .85rem }
.account-panel table { width: 100%; border-collapse: collapse; font-size: .85rem; text-align: left }
.account-panel th, .account-panel td { padding: 5px; border-bottom: 1px solid #e2d5b4; overflow-wrap: anywhere }
.account-panel th:last-child, .account-panel td:last-child { text-align: right }
#admin-users { padding: 0; list-style: none }
#admin-users li { margin: 8px 0; padding: 8px; background: #fff9e9; border-radius: 8px }
#admin-users form { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px }
.game-header { align-items: center; margin-bottom: 8px }
.game-header p { margin: 0 }
.wordmark { display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.055em }
.wordmark .logo-name { font: 950 clamp(40px, 10vw, 59px)/1 system-ui, sans-serif; letter-spacing: -.085em; margin: 0; color: #155548; text-shadow: 0 3px #f3d477 }
.wordmark .logo-kana { margin: 4px 0 0; padding: 4px 7px; border-radius: 50px; background: #ffe398; color: #664522; font-size: .29em; white-space: nowrap }
.logo-mascot { position: relative; display: block; width: .78em; height: .76em; border: 2px solid #a95d2c; border-radius: 49% 52% 50% 46%; background: #ffcf49; box-shadow: inset 0 -.09em #f3a63b; transform: rotate(-12deg) }
.logo-mascot::before { content: ""; position: absolute; top: 29%; left: 27%; width: .075em; height: .105em; border-radius: 50%; background: #3e3228; box-shadow: .24em 0 #3e3228, -.05em .14em #ff9e65, .29em .14em #ff9e65 }
.logo-mascot::after { content: ""; position: absolute; top: 55%; left: 37%; width: .14em; height: .09em; border-radius: 0 0 50px 50px; background: #633f2f }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 10px }
.account-actions a { padding: 8px 14px; border: 1px solid #27695a; border-radius: 999px; color: #155548; background: #fffef6; text-decoration: none; font-size: .83rem; font-weight: 750 }
.account-actions a:last-child { background: #155548; color: #fffdf3 }
.account-actions a:focus-visible { outline: 3px solid #ea852f; outline-offset: 2px }
#account-user, #account-status { margin: 5px 0; font-size: .83rem }
#account-user:empty, #account-status:empty { display: none }
