:root {
    --ink: #151225;
    --muted: #6f6a82;
    --card: rgba(255, 255, 255, 0.92);
    --line: rgba(21, 18, 37, 0.12);
    --purple: #6c2df6;
    --pink: #ff4ab8;
    --orange: #ff9f1c;
    --green: #16db93;
    --blue: #2ec4ff;
    --danger: #ef476f;
    --shadow: 0 24px 80px rgba(21, 18, 37, 0.22);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.party-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.8), transparent 22rem),
        radial-gradient(circle at 85% 20%, rgba(46, 196, 255, 0.75), transparent 24rem),
        linear-gradient(135deg, #6c2df6 0%, #ff4ab8 45%, #ff9f1c 100%);
    padding: 1rem;
}

.entry-shell { min-height: calc(100vh - 4rem); display: grid; place-items: center; }
.hero-card {
    width: min(100%, 34rem);
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    border-radius: 2rem;
    padding: clamp(1.5rem, 6vw, 3rem);
    backdrop-filter: blur(16px);
}
.eyebrow { margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; color: var(--purple); font-size: .8rem; }
h1, h2, h3, p { margin-top: 0; }
.hero-card h1 { font-size: clamp(2.4rem, 12vw, 4.5rem); line-height: .95; margin-bottom: 1rem; }
.hero-copy { color: var(--muted); font-size: 1.1rem; }
.join-form, .admin-form { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; font-weight: 800; }
input, textarea {
    border: 2px solid transparent;
    border-radius: 1rem;
    padding: .95rem 1rem;
    background: #f6f3ff;
    color: var(--ink);
    outline: none;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, textarea:focus { border-color: var(--purple); background: white; }
.primary-button, .ghost-button, .small-button, .danger-button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 950;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.primary-button { background: var(--ink); color: white; padding: 1rem 1.3rem; font-size: 1.05rem; }
.primary-button.compact, .link-button { padding: .75rem 1rem; font-size: .95rem; }
.ghost-button { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.35); padding: .75rem 1rem; }
.ghost-button.dark { background: #f4f2fb; color: var(--ink); border-color: var(--line); }
.small-button { background: var(--purple); color: white; padding: .55rem .85rem; }
.danger-button { background: var(--danger); color: white; padding: .65rem .95rem; }
.entry-links { margin-top: 1.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.entry-links a { color: var(--ink); font-weight: 850; }
.field-error { margin: -.6rem 0 0; color: var(--danger); font-weight: 800; }
.alert { border-radius: 1rem; padding: .9rem 1rem; font-weight: 850; margin-bottom: 1rem; }
.alert-error { background: #ffe8ef; color: #9b1239; border: 1px solid rgba(239, 71, 111, .25); }
.alert-success { background: #dcfff1; color: #04724d; border: 1px solid rgba(22, 219, 147, .25); }
.responsible-note { text-align: center; color: rgba(255,255,255,.9); font-size: .85rem; padding: 1rem; }
.dark-note { color: var(--muted); }

 .top-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; max-width: 70rem; margin: 0 auto 1rem; }
.top-bar h1 { margin: 0; font-size: clamp(2rem, 10vw, 4rem); line-height: 1; }
.dashboard-grid { max-width: 70rem; margin: 0 auto; display: grid; gap: 1rem; }
.counter-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.counter-card, .section-card {
    background: var(--card);
    border-radius: 1.5rem;
    box-shadow: 0 15px 45px rgba(21, 18, 37, 0.15);
    padding: 1rem;
}
.counter-card {
    color: white;
    overflow: hidden;
    position: relative;
    display: grid;
    align-content: start;
    gap: .4rem;
}
.shot-card { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.drink-card { background: linear-gradient(135deg, #00b4d8, var(--green)); }
.counter-title { display: block; font-weight: 950; opacity: .92; }
.counter-card strong { display: block; font-size: clamp(3.4rem, 11vw, 6.4rem); line-height: .9; margin: .35rem 0; }
.counter-help { margin: -.1rem 0 .75rem; color: rgba(255,255,255,.9); font-weight: 800; }
.counter-choice-form { display: grid; gap: .75rem; }
.choice-options {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    min-width: 0;
}
.shot-strength-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-options legend {
    grid-column: 1 / -1;
    margin: 0 0 .45rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 950;
    opacity: .88;
}
.choice-options label { display: block; min-width: 0; cursor: pointer; }
.choice-options input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.choice-options label > span {
    display: grid;
    place-items: center;
    min-height: 3rem;
    width: 100%;
    border-radius: 1rem;
    background: rgba(255,255,255,.20);
    border: 1px solid rgba(255,255,255,.42);
    color: white;
    font-weight: 1000;
    font-size: .92rem;
    line-height: 1.05;
    text-align: center;
    padding: .55rem .45rem;
    transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}
.choice-options small { font-size: .68rem; font-weight: 850; opacity: .88; }
.choice-options input[type="radio"]:checked + span {
    background: white;
    color: var(--ink);
    border-color: white;
    box-shadow: 0 8px 22px rgba(21,18,37,.16);
    transform: translateY(-1px);
}
.custom-choice > span { gap: .35rem; }
.custom-choice input[type="number"] {
    width: min(100%, 6.5rem);
    min-height: 2.35rem;
    border: 0;
    border-radius: .75rem;
    padding: .45rem .55rem;
    font-weight: 900;
    text-align: center;
    background: rgba(255,255,255,.92);
    color: var(--ink);
}

.choice-options .custom-choice > span { padding: .4rem; }
.choice-options .custom-choice input[type="number"] {
    border: 0;
    border-radius: .75rem;
    background: rgba(255,255,255,.92);
    color: var(--ink);
    font-weight: 900;
    text-align: center;
    width: 100%;
    min-height: 2.25rem;
    padding: .4rem .45rem;
}
.choice-options input[type="radio"]:checked + span input[type="number"] {
    background: #f6f3ff;
}

.counter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.counter-actions button {
    width: 100%;
    min-height: 4rem;
    border: 0;
    border-radius: 1.2rem;
    font-weight: 1000;
    font-size: 2.2rem;
    color: var(--ink);
    background: rgba(255,255,255,.88);
    cursor: pointer;
}
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; }
.section-heading span { color: var(--muted); font-weight: 850; }
.achievement-category { margin-top: 1.5rem; }
.achievement-category h3 { margin: 0 0 .7rem; padding-top: .25rem; }
.achievement-grid { display: grid; gap: .8rem; }
.achievement-card {
    width: 100%;
    display: grid;
    grid-template-columns: 5rem 1fr auto;
    align-items: center;
    gap: .9rem;
    padding: .8rem;
    border-radius: 1.2rem;
    background: #f8f6ff;
    border: 1px solid var(--line);
    text-align: left;
}
.achievement-card img { width: 5rem; height: 5rem; border-radius: 1rem; object-fit: cover; background: #ddd; }
.achievement-card h3 { margin: 0 0 .15rem; }
.achievement-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.achievement-button { border: 0; cursor: pointer; }
.achievement-button button { background: var(--orange); color: var(--ink); border: 0; border-radius: 999px; padding: .7rem .9rem; font-weight: 950; cursor: pointer; }
.achievement-claimed { background: linear-gradient(135deg, #fff8db, #e8fff6); border-color: rgba(255,159,28,.35); }
.empty-state { color: var(--muted); padding: 1rem; background: #f8f6ff; border-radius: 1rem; font-weight: 750; }

#player-dashboard-content { transition: transform .2s ease, opacity .2s ease; }
#player-dashboard-content.refreshing { transform: scale(.995); opacity: .72; }
.player-achievement-search-form {
    display: grid;
    gap: .45rem;
    margin: -.25rem 0 1rem;
}
.player-search-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 950;
}
.player-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
}
.player-search-input {
    border: 2px solid var(--line);
    background: #f8f6ff;
    min-height: 3rem;
    padding: .75rem .9rem;
}


@media (max-width: 720px) {
    .counter-panel { grid-template-columns: 1fr; }
    .achievement-card { grid-template-columns: 4.2rem 1fr; }
    .achievement-card img { width: 4.2rem; height: 4.2rem; }
    .achievement-card form, .achievement-card button { grid-column: 1 / -1; width: 100%; }
    .top-bar { align-items: flex-start; }
}
.top-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.top-actions form { margin: 0; }
.achievement-pending {
  opacity: .86;
  border: 2px dashed rgba(255,255,255,.55);
}

@media (max-width: 560px) {
    .party-body {
        padding: .65rem;
        min-height: 100svh;
        background:
            radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.82), transparent 14rem),
            radial-gradient(circle at 95% 12%, rgba(46, 196, 255, 0.7), transparent 16rem),
            linear-gradient(145deg, #6c2df6 0%, #ff4ab8 48%, #ff9f1c 100%);
    }
    .entry-shell {
        min-height: calc(100svh - 3.5rem);
        align-items: start;
        padding-top: clamp(.5rem, 4vh, 2rem);
    }
    .hero-card {
        border-radius: 1.35rem;
        padding: 1.15rem;
        width: 100%;
    }
    .hero-card h1 {
        font-size: clamp(2.25rem, 14vw, 3.35rem);
        margin-bottom: .65rem;
    }
    .hero-copy {
        font-size: .98rem;
        line-height: 1.35;
        margin-bottom: 1rem;
    }
    .join-form { gap: .75rem; }
    .join-form label { font-size: .94rem; }
    input, textarea {
        width: 100%;
        min-height: 3.25rem;
        border-radius: .9rem;
        padding: .85rem .95rem;
        font-size: 1rem;
    }
    .primary-button {
        width: 100%;
        min-height: 3.35rem;
        padding: .9rem 1rem;
        font-size: 1.05rem;
    }
    .entry-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: .65rem;
        margin-top: 1rem;
    }
    .entry-links a {
        display: flex;
        justify-content: center;
        border-radius: 999px;
        background: rgba(21, 18, 37, .08);
        padding: .85rem 1rem;
        text-decoration: none;
    }
    .responsible-note { padding: .75rem .35rem; font-size: .78rem; }
}

 @media (max-width: 720px) {
    .counter-panel { grid-template-columns: 1fr; }
    .achievement-card { grid-template-columns: 4.2rem 1fr; }
    .achievement-card img { width: 4.2rem; height: 4.2rem; }
    .achievement-card form, .achievement-card button { grid-column: 1 / -1; width: 100%; }
    .top-bar { align-items: flex-start; }
}

@media (max-width: 560px) {
    .counter-card, .section-card { border-radius: 1.2rem; padding: .85rem; }
    .counter-card strong { font-size: clamp(3rem, 20vw, 4.7rem); }
    .choice-options, .shot-strength-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .choice-options legend { margin-bottom: .55rem; }
    .choice-options label > span { min-height: 2.95rem; font-size: .86rem; padding: .5rem .35rem; }
    .choice-options .custom-choice > span { padding: .35rem; }
    .custom-choice input[type="number"] { width: 100%; min-height: 2.15rem; padding: .35rem .45rem; font-size: .9rem; }
    .player-search-row { grid-template-columns: 1fr; }
    .player-search-row .small-button { width: 100%; min-height: 2.9rem; }
    .counter-actions button { min-height: 3.5rem; font-size: 2rem; border-radius: 1rem; }
    .top-bar { flex-direction: column; align-items: stretch; }
    .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .top-actions .ghost-button { width: 100%; }
}

.password-change-form {
    display: flex;
    gap: .75rem;
    align-items: end;
    flex-wrap: wrap;
}
.password-change-form label { display: grid; gap: .35rem; font-weight: 900; color: var(--ink); }
.password-change-form input {
    min-width: min(100%, 18rem);
    border: 2px solid var(--line);
    border-radius: .85rem;
    padding: .8rem .9rem;
}
.password-card { border: 2px dashed rgba(108,45,246,.22); }
