:root {
    --ink: #1a1a2e;
    --paper: #ffffff;
    --line: rgba(0, 0, 0, 0.2);
    --wash: rgba(0, 0, 0, 0.04);
    --wash-hover: rgba(0, 0, 0, 0.09);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

main {
    width: 100%;
    max-width: 860px;
    padding: 24px;
    position: relative;
}

.score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 24px;
}

.score-nums {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    font-size: 50px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#score-player {
    text-align: right;
}

#score-opponent {
    text-align: left;
}

.score-colon {
    padding: 0 0.2em;
}

.hands {
    display: flex;
    justify-content: center;
    gap: 4vw;
}

.hand {
    background: none;
    border: none;
    font-size: 70px;
    cursor: pointer;
    transition: transform 0.12s ease;
    line-height: 1;
    padding: 8px;
}

/* Only on devices that truly hover — on touch screens :hover sticks after a
   tap, which kept the last pick enlarged after the round ended. */
@media (hover: hover) {
    .hand:hover:not(:disabled) {
        transform: scale(1.15) translateY(-6px);
    }
}

.hand:disabled {
    cursor: default;
    filter: grayscale(0.6);
    opacity: 0.6;
}

.hand.picked {
    transform: scale(1.15) translateY(-6px);
}

.play {
    margin: 28px 0 0;
    font-size: 20px;
    min-height: 30px;
}

.invite {
    /* Out of the layout flow so the centered game block sits in the same
       place whether or not the button is shown (no shift when a friend
       joins) — it floats a bit below the status line instead. */
    position: absolute;
    top: calc(100% + 24px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--wash);
    color: var(--ink);
    font-size: 15px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.invite:hover:not(:disabled) {
    background: var(--wash-hover);
}

.invite:disabled {
    cursor: default;
    opacity: 0.55;
}

.hidden {
    display: none !important;
}

@media (min-width: 576px) {
    .score-nums { font-size: 60px; }
    .hand { font-size: 90px; }
}

@media (min-width: 768px) {
    .score { margin-bottom: 30px; }
    .score-nums { font-size: 70px; }
    .hand { font-size: 100px; }
    .play { margin-top: 30px; font-size: 24px; }
}

@media (min-width: 992px) {
    .score { margin-bottom: 40px; }
    .score-nums { font-size: 90px; }
    .hand { font-size: 130px; }
    .play { margin-top: 40px; }
}

@media (min-width: 1200px) {
    .score { margin-bottom: 45px; }
    .score-nums { font-size: 100px; }
    .hand { font-size: 160px; }
    .play { margin-top: 45px; }
}
