* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft JhengHei", sans-serif;
    background: linear-gradient(180deg, #fff4df, #ffd9b3);
    color: #5a351c;
}

.app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    text-align: center;
}

.top h1 {
    margin: 8px 0;
    font-size: 32px;
}

.top p {
    margin: 0 0 12px;
    font-size: 14px;
}

.status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.status div {
    flex: 1;
    background: #fffaf0;
    border: 2px solid #f2b26b;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 4px 0 #d98a42;
}

.status span {
    display: block;
    font-size: 13px;
}

.status strong {
    font-size: 28px;
}

canvas {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fffaf5;
    border: 4px solid #d98a42;
    border-radius: 24px;
    box-shadow: 0 8px 0 #b96f32;
    touch-action: manipulation;
}

button {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: none;
    border-radius: 18px;
    background: #ff9f43;
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 5px 0 #c76b21;
    cursor: pointer;
}

button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #c76b21;
}

.leaderboard {
    margin-top: 24px;
    background: rgba(255, 250, 240, 0.9);
    border-radius: 20px;
    padding: 16px;
    text-align: left;
}

.leaderboard h2 {
    text-align: center;
    margin-top: 0;
}

.leaderboard li {
    padding: 8px 0;
    border-bottom: 1px dashed #d9a36c;
    font-size: 16px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none;
}

.audio-control{
    margin-top:16px;
    padding:12px;
    background:rgba(255,255,255,0.8);
    border-radius:16px;
    font-size:14px;
}
.audio-control div{
    margin:6px 0;
}

.modal-box {
    width: 100%;
    max-width: 360px;
    background: #fffaf0;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
}

.modal-box input {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 2px solid #d98a42;
    font-size: 18px;
    text-align: center;
}

@media (max-width: 420px) {
    .top h1 {
        font-size: 26px;
    }

    .status strong {
        font-size: 24px;
    }
}

.footer{
    margin-top: 24px;
    padding: 10px;

    font-size: 12px;
    text-align: center;

    color: #8b6b52;

    border-top: 1px dashed rgba(0,0,0,0.15);
}