:root {
    --bg: #fbf5ea;
    --panel: #ffffff;
    --ink: #3a2e39;
    --ink-soft: #6e6470;
    --turf: #4ca62e;
    --turf-dark: #3c8523;
    --sakura: #e85d8b;
    --gold: #f2a93b;
    --slate: #7c748f;
    --line: #dad0c2;
    --divider: #efe8dc;
    --shadow: rgba(58, 46, 57, 0.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html,
body {
    height: 100%;
}
body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Baloo 2", "Segoe UI", system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

header {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 6px;
}
header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--turf);
    letter-spacing: 0.5px;
}
.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cross-link {
    color: var(--sakura);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
}
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--sakura);
    background: var(--sakura);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
}

.game {
    width: 100%;
    max-width: 560px;
    padding: 8px 18px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
#subtitle {
    color: var(--ink-soft);
    font-size: 1rem;
    text-align: center;
    margin-top: 4px;
}

/* ===== wheel ===== */
#wheel-wrap {
    position: relative;
    width: min(88vw, 380px);
    aspect-ratio: 1;
    margin-top: 10px;
}
#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow:
        0 0 0 8px #fff,
        0 0 0 12px var(--gold),
        0 14px 34px var(--shadow);
    display: block;
    will-change: transform;
}
#pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 26px solid var(--sakura);
    filter: drop-shadow(0 3px 2px var(--shadow));
    z-index: 3;
}
#spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 5px solid #fff;
    background: linear-gradient(160deg, var(--sakura), #c8447a);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 16px var(--shadow);
    z-index: 2;
    transition:
        transform 0.12s ease,
        filter 0.12s ease;
}
#spin-btn:hover {
    filter: brightness(1.05);
}
#spin-btn:active {
    transform: translate(-50%, -50%) scale(0.94);
}
#spin-btn:disabled {
    filter: grayscale(0.4) brightness(0.95);
    cursor: default;
}

/* ===== result ===== */
#result {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
#result.show .r-img {
    animation: pop 0.4s cubic-bezier(0.2, 1.3, 0.5, 1) both;
}
#result .r-label {
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#result .r-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
    border: 4px solid var(--gold);
    background: var(--panel);
    box-shadow: 0 8px 20px var(--shadow);
}
#result .r-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sakura);
}
@keyframes pop {
    0% {
        transform: scale(0.5) rotate(-8deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.cta {
    border: none;
    border-radius: 14px;
    padding: 12px 22px;
    background: var(--turf);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 6px 14px var(--shadow);
}
.cta:hover {
    background: var(--turf-dark);
}

/* ===== how-to card (shares the overlay pattern from the other games) ===== */
#howto .card,
#modal .card {
    background: var(--panel);
    border-radius: 20px;
    padding: 26px 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 18px 50px var(--shadow);
    text-align: center;
}
.card .result {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sakura);
    margin-bottom: 12px;
}
.card p {
    color: var(--ink);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* ===== toast ===== */
#toast-wrap {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 60;
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 6px 16px var(--shadow);
    animation: toastIn 0.2s ease both;
}
@keyframes toastIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }
}

/* ===== petals (ambient) ===== */
#petals {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.petal {
    position: absolute;
    top: -24px;
    animation: fall linear infinite;
}
.petal i {
    display: block;
    border-radius: 60% 40% 60% 40%;
    transform: rotate(20deg);
}
@keyframes fall {
    to {
        transform: translateY(105vh) rotate(360deg);
    }
}

/* ===== confetti ===== */
#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 55;
    overflow: hidden;
}
.confetti {
    position: absolute;
}
