* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #2b110d;
    color: #fff8e7;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #8b1e16 0%, #c0392b 40%, #d35400 100%);
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(60, 15, 10, 0.85);
    border-bottom: 2px solid #f1c40f;
    z-index: 10;
}

.stat-box {
    background: #5a1812;
    border: 1.5px solid #f1c40f;
    border-radius: 8px;
    padding: 4px 10px;
    text-align: center;
    min-width: 72px;
}

.stat-box .label {
    display: block;
    font-size: 11px;
    color: #f9e79f;
}

.stat-box .value {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
}

.title-box {
    text-align: center;
}

.title-box h1 {
    font-size: 18px;
    color: #ffd700;
    text-shadow: 1px 1px 2px #000;
}

.title-box .subtitle {
    font-size: 11px;
    color: #fadbd8;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.toast {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.78);
    color: #ffd700;
    border: 2px solid #f1c40f;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
    transition: opacity 0.25s;
    white-space: nowrap;
    z-index: 20;
}

.hidden {
    display: none !important;
}

.modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
    padding: 20px;
}

.modal-content {
    background: #fff8e7;
    color: #5a1812;
    border: 4px solid #d4ac0d;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-content h2 {
    color: #c0392b;
    margin-bottom: 10px;
}

.final-score {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 14px;
}

.final-score span {
    color: #d35400;
    font-size: 26px;
}

.prizes-list {
    background: #fdebd0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 18px;
    min-height: 60px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
    color: #fff;
    border: 2px solid #f1c40f;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
}

.btn-primary:active {
    transform: scale(0.97);
}

.bottom-bar {
    background: rgba(60, 15, 10, 0.9);
    border-top: 2px solid #f1c40f;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.prize-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #f9e79f;
}

.btn-secondary {
    background: #f1c40f;
    color: #5a1812;
    border: none;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;
}
