/* Social XP visual style: dark neon glassmorphism mobile-first */

:root {
    --bg: #05070f;
    --bg-alt: #0d1122;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.14);
    --line: rgba(255, 255, 255, 0.18);
    --text: #f6f8ff;
    --muted: #a5acc6;
    --accent: #2bf2ff;
    --accent-2: #31ff94;
    --danger: #ff5168;
    --warn: #ffbd4c;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --radius: 18px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(circle at 20% 15%, #141a34 0%, #05070f 45%, #04040a 100%);
    color: var(--text);
    font-family: "Segoe UI", "SF Pro Text", "Helvetica Neue", sans-serif;
}

body {
    padding: max(16px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

p {
    color: var(--muted);
}

input,
select,
button {
    font: inherit;
}

.bg-glow {
    position: fixed;
    width: 48vw;
    height: 48vw;
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}

.bg-glow-a {
    top: -8vw;
    right: -4vw;
    background: rgba(43, 242, 255, 0.35);
}

.bg-glow-b {
    bottom: -10vw;
    left: -8vw;
    background: rgba(49, 255, 148, 0.24);
}

.app-shell {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.screen {
    display: none;
    gap: 12px;
}

.screen.active,
.screen:not(.hidden) {
    display: grid;
}

.card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.brand-head h1 {
    font-size: 34px;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.stack {
    display: grid;
    gap: 10px;
}

.hidden {
    display: none !important;
}

label {
    display: grid;
    gap: 6px;
}

input,
select {
    border: 1px solid var(--line);
    background: rgba(4, 7, 15, 0.56);
    color: var(--text);
    border-radius: 12px;
    padding: 13px 12px;
    min-height: 44px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 242, 255, 0.18);
}

.btn {
    border: 1px solid transparent;
    border-radius: 14px;
    min-height: 48px;
    padding: 12px;
    color: var(--text);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(120deg, #19d2ff, #31ff94);
    color: #001111;
    font-weight: 700;
}

.btn-secondary {
    background: linear-gradient(120deg, rgba(61, 126, 255, 0.95), rgba(43, 242, 255, 0.9));
    color: #04111f;
    font-weight: 700;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
}

.btn-warning {
    background: linear-gradient(120deg, #ff9e3d, #ffd35a);
    color: #311d00;
    font-weight: 700;
}

.btn-danger {
    background: linear-gradient(120deg, #ff4f63, #ff6c4a);
    color: #28000a;
    font-weight: 700;
}

.small {
    min-height: 40px;
    padding: 8px 10px;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.45);
    animation: rippleAnim 0.6s ease-out;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.game-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.header-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 420px) {
    .header-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 640px) {
    .header-actions {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.leaderboard {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.leader-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.35s ease, background 0.35s ease;
}

.leader-item.bump {
    background: rgba(43, 242, 255, 0.14);
}

.badge-rank {
    min-width: 34px;
    text-align: center;
    font-size: 18px;
}

.player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-xp {
    font-weight: 700;
    color: var(--accent-2);
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    min-height: 60px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, rgba(27, 35, 66, 0.88), rgba(12, 16, 30, 0.88));
    color: var(--text);
    font-weight: 600;
}

.action-points {
    margin-left: 6px;
    color: var(--accent);
}

.event-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 7px;
}

.event-item {
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    animation: fadeInUp 0.35s ease;
}

.event-item small {
    color: #8f97b7;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 10, 0.7);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 12px;
    z-index: 25;
}

.modal-content {
    width: 100%;
    max-width: 480px;
}

.center {
    text-align: center;
}

.picker-list {
    display: grid;
    gap: 8px;
}

.qr-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: white;
    margin: 0 auto;
}

.small-note {
    word-break: break-all;
}

.admin-fab {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(255, 81, 104, 0.95), rgba(255, 189, 76, 0.9));
    color: #260b0d;
    font-weight: 800;
    z-index: 30;
}

.admin-modal {
    max-height: 88vh;
    overflow: auto;
}

.admin-box {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.toast-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: grid;
    gap: 8px;
    width: min(92vw, 460px);
}

.toast {
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(3, 10, 23, 0.92);
    border: 1px solid rgba(43, 242, 255, 0.5);
    animation: toastIn 0.25s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-points-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 55;
}

.float-point {
    position: absolute;
    color: var(--accent-2);
    font-weight: 800;
    animation: floatPoint 1s ease-out forwards;
}

@keyframes floatPoint {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(1.15);
    }
}

@media (max-width: 360px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .brand-head h1 {
        font-size: 30px;
    }
}
