@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    --bg-1: #f2f0ea;
    --bg-2: #e9e5df;
    --ink-strong: #161616;
    --ink-muted: #4b4b4b;
    --card: #fbfbf9;
    --line: #d7d1c7;
    --accent: #2f6f6b;
    --accent-strong: #1f4f4c;
    --win: #1f7a61;
    --lose: #b4463a;
    --draw: #7a6b2b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Space Grotesk", "Segoe UI", "Apple SD Gothic Neo", sans-serif;
    background: radial-gradient(circle at top left, #ffffff 0%, var(--bg-1) 40%, var(--bg-2) 100%);
    color: var(--ink-strong);
    text-align: center;
    margin: 0;
    min-height: 100vh;
    padding: 28px 18px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(0, 0, 0, 0.03), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 10px 0 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h2 {
    font-size: 1.1rem;
    margin: 0 0 10px;
    color: var(--ink-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    width: min(520px, 92vw);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px 18px;
    box-shadow: 0 12px 30px rgba(22, 22, 22, 0.08);
    animation: float-in 520ms ease-out;
}

.player-section {
    text-align: center;
    width: 100%;
}

.choice {
    width: clamp(120px, 28vw, 150px);
    height: clamp(120px, 28vw, 150px);
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(3rem, 9vw, 4.4rem);
    background: linear-gradient(180deg, #ffffff 0%, #f6f5f2 100%);
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: fade-up 520ms ease-out 80ms both;
}

.control-button {
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 20px;
    border: 1px solid var(--ink-strong);
    border-radius: 999px;
    background-color: transparent;
    color: var(--ink-strong);
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.control-button:hover {
    background-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.control-button:active {
    transform: translateY(1px);
}

.control-button--ghost {
    border-color: var(--line);
    color: var(--ink-muted);
    margin-top: 14px;
    background-color: #ffffff;
}

.control-button--ghost:hover {
    background-color: var(--ink-strong);
    color: #ffffff;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(22, 22, 22, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 10;
}

.modal.is-visible {
    display: flex;
}

.modal__panel {
    width: min(360px, 90vw);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 18px;
    text-align: center;
    box-shadow: 0 16px 36px rgba(22, 22, 22, 0.18);
    animation: float-in 280ms ease-out;
}

.modal__panel h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.modal__panel p {
    margin: 0 0 16px;
    color: var(--ink-muted);
    font-size: 0.95rem;
}

.modal__actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#result {
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--accent-strong);
    animation: fade-up 520ms ease-out 120ms both;
}

.scoreboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 12px;
    width: min(420px, 92vw);
    margin-top: 14px;
    animation: fade-up 520ms ease-out 140ms both;
}

.score-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.score-label {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.score-card:nth-child(1) .score-value {
    color: var(--win);
}

.score-card:nth-child(2) .score-value {
    color: var(--draw);
}

.score-card:nth-child(3) .score-value {
    color: var(--lose);
}

.result--win {
    color: var(--win);
    border-color: rgba(31, 122, 97, 0.35);
    box-shadow: 0 10px 20px rgba(31, 122, 97, 0.12);
}

.result--lose {
    color: var(--lose);
    border-color: rgba(180, 70, 58, 0.35);
    box-shadow: 0 10px 20px rgba(180, 70, 58, 0.12);
}

.result--draw {
    color: var(--draw);
    border-color: rgba(122, 107, 43, 0.35);
    box-shadow: 0 10px 20px rgba(122, 107, 43, 0.12);
}

.result--pulse {
    animation: result-pulse 360ms ease-out;
}

@media (min-width: 720px) {
    .container {
        flex-direction: row;
        justify-content: space-between;
        gap: 24px;
        padding: 26px 32px;
    }
}

@keyframes float-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes result-pulse {
    0% {
        transform: scale(0.98);
    }
    60% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}
