        :root {
            color-scheme: light;
            --bg: #eef2f8;
            --card: rgba(255,255,255,0.88);
            --text: #171717;
            --muted: #6f7482;
            --primary: #0a84ff;
            --primary-pressed: #006fe0;
            --line: #dce2ef;
            --star: #ffb800;
            --star-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 1.6l2.93 5.94 6.56.95-4.75 4.63 1.12 6.53L12 16.57 6.14 19.65l1.12-6.53L2.5 8.49l6.56-.95L12 1.6z'/%3E%3C/svg%3E");
            --radius-xl: 28px;
            --radius-lg: 22px;
            --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
            background: radial-gradient(circle at top, rgba(10, 132, 255, 0.12), transparent 34%), var(--bg);
            color: var(--text);
        }
        button, input, textarea { font: inherit; }
        .page {
            width: min(100%, 460px);
            margin: 0 auto;
            min-height: 100vh;
            padding: 24px 18px 32px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 18px;
        }
        .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
        .topbar-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
        .card {
            background: var(--card);
            border: 1px solid rgba(255,255,255,0.95);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow);
            padding: 18px;
            backdrop-filter: blur(24px);
        }
        .eyebrow, .pill-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: fit-content;
            padding: 10px 14px;
            border-radius: 999px;
            background: rgba(255,255,255,0.72);
            border: 1px solid rgba(255,255,255,0.9);
            color: var(--primary);
            font-size: 14px;
            font-weight: 700;
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
            text-decoration:none;
        }
        .pill-button { border: 0; cursor: pointer; }
        .icon-button, .back {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 999px;
            background: rgba(255,255,255,0.86);
            box-shadow: var(--shadow);
            color: var(--text);
            font-size: 22px;
            border: 0;
            text-decoration:none;
            cursor: pointer;
        }
        .copy-button {
            width: auto;
            min-width: 48px;
            padding: 0 16px;
            font-size: 14px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--primary);
        }
        .copy-button.is-copied {
            padding: 0;
            width: 48px;
            color: #18a957;
            font-size: 22px;
        }
        .copy-button:disabled {
            opacity: 1;
        }
        .result-topbar {
            align-items: flex-start;
        }
        .copy-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }
        .toggle-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 48px;
            padding: 0 14px;
            border-radius: 999px;
            background: rgba(255,255,255,0.86);
            box-shadow: var(--shadow);
            color: var(--muted);
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
        }
        .toggle-input {
            width: 18px;
            height: 18px;
            margin: 0;
            accent-color: var(--primary);
        }
        @media (max-width: 520px) {
            .copy-actions {
                width: 100%;
                justify-content: space-between;
            }
            .toggle-chip {
                flex: 1 1 auto;
                min-width: 0;
            }
        }
        h1 {
            margin: 0;
            font-size: clamp(30px, 8vw, 42px);
            line-height: 1.02;
            letter-spacing: -0.04em;
        }
        .hero-title {
            margin: 0;
            font-size: clamp(38px, 10vw, 54px);
            line-height: 0.95;
            letter-spacing: -0.05em;
        }
        .game-title {
            margin: 6px 0 0;
            font-size: clamp(34px, 9vw, 46px);
            font-weight: 900;
            letter-spacing: -0.05em;
            line-height: 0.98;
        }
        .vote-question-title {
            margin: 0;
            font-size: clamp(32px, 8.3vw, 44px);
            font-weight: 800;
            letter-spacing: -0.05em;
            line-height: 0.97;
            text-wrap: balance;
        }
        .sub, .lead, .muted, .empty-copy {
            margin: 8px 0 0;
            color: var(--muted);
            font-size: 16px;
            line-height: 1.45;
        }
        .lead { font-size: 18px; margin-top: 0; }
        .muted, .empty-copy { font-size: 15px; margin: 0; }
        .section-title, .label, .average-label {
            display: block;
            margin: 0 0 10px;
            font-size: 14px;
            font-weight: 700;
            color: var(--muted);
        }
        .input {
            width: 100%;
            border: 2px solid #b9d8ff;
            border-radius: 18px;
            padding: 17px 18px;
            font-size: 22px;
            line-height: 1.2;
            background: rgba(255,255,255,0.96);
            outline: none;
        }
        .input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 5px rgba(10, 132, 255, 0.14);
        }
        .search-stack {
            position: relative;
        }
        .search-panel {
            margin-top: 10px;
            padding: 10px;
            border: 1px solid var(--line);
            border-radius: 18px;
            background: rgba(255,255,255,0.96);
            box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
        }
        .search-results {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .search-result {
            width: 100%;
            border: 1px solid var(--line);
            border-radius: 16px;
            background: white;
            padding: 12px 14px;
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 4px;
            cursor: pointer;
        }
        .search-result-name {
            font-size: 16px;
            font-weight: 800;
            color: var(--text);
            letter-spacing: -0.02em;
        }
        .search-result-meta,
        .search-note {
            margin: 0;
            font-size: 13px;
            line-height: 1.4;
            color: var(--muted);
        }
        .search-note {
            margin-top: 10px;
        }
        .button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 62px;
            border: 0;
            border-radius: var(--radius-lg);
            font-size: 21px;
            font-weight: 800;
            color: white;
            background: linear-gradient(180deg, #1d92ff, var(--primary));
            box-shadow: 0 14px 28px rgba(10, 132, 255, 0.24);
            text-decoration: none;
            cursor: pointer;
        }
        .button:active { transform: translateY(1px) scale(0.995); }
        .button-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 56px;
            border-radius: 20px;
            background: #ffffff;
            color: var(--primary);
            font-size: 18px;
            font-weight: 800;
            text-decoration: none;
            border: 2px solid #cfe3ff;
            cursor: pointer;
        }
        .button-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 56px;
            border-radius: 20px;
            background: transparent;
            color: var(--primary);
            font-size: 18px;
            font-weight: 800;
            text-decoration: none;
            border: 0;
            cursor: pointer;
        }
        .button-danger-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 48px;
            background: transparent;
            color: #ff3b30;
            font-size: 17px;
            font-weight: 800;
            text-decoration: none;
            border: 0;
            cursor: pointer;
        }
        .recent-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .recent-game {
            display:flex;
            align-items:center;
            justify-content:center;
            min-height: 76px;
            padding: 14px;
            border: 1px solid var(--line);
            border-radius: 22px;
            background: rgba(255,255,255,0.96);
            color: var(--text);
            font-size: 22px;
            font-weight: 800;
            letter-spacing: -0.03em;
            text-align:center;
            box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
            cursor: pointer;
        }
        .recent-game span {
            display:-webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow:hidden;
        }
        .recent-block { margin-top: 16px; }
        .recent-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
        .recent-label { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); }
        .recent-clear { border: 0; background: transparent; color: var(--primary); font-size: 14px; font-weight: 700; padding: 0; cursor: pointer; }
        .recent-list { display: flex; flex-wrap: wrap; gap: 10px; }
        .recent-player {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            min-height: 44px;
            max-width: 100%;
            padding: 0 14px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: rgba(255,255,255,0.96);
            color: var(--text);
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
        }
        .recent-player-name {
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
            font: inherit;
            font-size: 16px;
            font-weight: 700;
            color: inherit;
            cursor: pointer;
        }
        .recent-player-delete {
            border: 0;
            background: transparent;
            padding: 0;
            margin: 0;
            font-size: 18px;
            line-height: 1;
            color: var(--muted);
            cursor: pointer;
        }
        .vote-card {
            text-align: center;
        }
        .vote-display {
            min-height: 248px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 10px 8px;
        }
        .stars {
            position: relative;
            display: inline-flex;
            gap: 8px;
        }
        .star {
            --fill-width: 0%;
            position: relative;
            width: 34px;
            height: 34px;
            display: inline-block;
            flex: 0 0 auto;
            color: #d8deeb;
        }
        .star::before,
        .star::after {
            content: '';
            position: absolute;
            inset: 0;
            display: block;
            background-color: currentColor;
            -webkit-mask-image: var(--star-shape);
            mask-image: var(--star-shape);
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
            -webkit-mask-size: contain;
            mask-size: contain;
        }
        .star::after {
            width: 100%;
            color: var(--star);
            -webkit-clip-path: inset(0 calc(100% - var(--fill-width)) 0 0);
            clip-path: inset(0 calc(100% - var(--fill-width)) 0 0);
        }
        .vote-stars {
            gap: 6px;
        }
        .vote-stars .star {
            width: 26px;
            height: 26px;
        }
        .score {
            margin: 2px 0 0;
            font-size: 34px;
            font-weight: 900;
            color: var(--primary);
            letter-spacing: -0.05em;
        }
        .scale-title {
            margin: 2px 0 0;
            max-width: 12ch;
            min-height: 62px;
            font-size: clamp(24px, 6vw, 32px);
            line-height: 0.96;
            font-weight: 900;
            letter-spacing: -0.05em;
            color: var(--text);
            text-wrap: balance;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .scale-copy {
            margin: 0;
            max-width: 18ch;
            min-height: 48px;
            color: var(--muted);
            font-size: 18px;
            line-height: 1.32;
            font-weight: 700;
            text-wrap: balance;
            display: flex;
            align-items: flex-start;
            justify-content: center;
        }
        .slider-card { gap: 14px; display: flex; flex-direction: column; }
        .slider-labels {
            display: flex;
            justify-content: space-between;
            color: var(--muted);
            font-size: 14px;
            font-weight: 700;
        }
        .range {
            width: 100%;
            appearance: none;
            height: 10px;
            border-radius: 999px;
            background: linear-gradient(90deg, #df5a46 0%, #f0b52e 35%, #d9d73d 50%, #76b952 75%, #4f9d4d 100%);
            outline: none;
        }
        .range::-webkit-slider-thumb {
            appearance: none;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #d6e2f4;
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
        }
        .range::-moz-range-thumb {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: #ffffff;
            border: 2px solid #d6e2f4;
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
        }
        .saved-copy {
            text-align:center;
            display:flex;
            flex-direction:column;
            gap:10px;
        }
        .saved-score { margin: 0; font-size: 40px; font-weight: 900; letter-spacing: -0.05em; color: var(--primary); }
        .average-card {
            display:flex;
            flex-direction:column;
            align-items:center;
            justify-content:center;
            text-align:center;
            gap:4px;
            min-height: 132px;
        }
        .average-value {
            margin:0;
            font-size: clamp(56px, 16vw, 74px);
            font-weight: 900;
            letter-spacing: -0.07em;
            color: var(--primary);
            line-height: 0.9;
        }
        .vote-list {
            display:flex;
            flex-direction:column;
            gap:12px;
        }
        .vote-row {
            display:grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 12px;
            align-items:center;
            padding:14px 16px;
            border-radius: 22px;
            border:1px solid var(--line);
            background: rgba(255,255,255,0.96);
        }
        .vote-meta {
            display:flex;
            flex-direction:column;
            gap:6px;
            min-width:0;
        }
        .vote-player {
            font-size: 17px;
            font-weight: 800;
            letter-spacing: -0.02em;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .vote-score-wrap {
            display: grid;
            grid-template-columns: 122px 70px;
            align-items: center;
            justify-items: end;
            gap: 14px;
            min-width: 206px;
        }
        .vote-score {
            min-width: 70px;
            text-align: right;
            font-size: 20px;
            font-weight: 900;
            color: var(--primary);
            letter-spacing: -0.04em;
        }
        .settings-actions {
            display:flex;
            flex-direction:column;
            gap: 12px;
            margin-top:8px;
        }
        .settings-choice-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 8px;
        }
        .settings-choice {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid var(--line);
            border-radius: 20px;
            background: rgba(255,255,255,0.96);
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 4px;
            cursor: pointer;
        }
        .settings-choice.is-active {
            border-color: #b9d8ff;
            box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.08);
        }
        .settings-choice-title {
            font-size: 17px;
            font-weight: 800;
            letter-spacing: -0.02em;
            color: var(--text);
        }
        .settings-choice-copy {
            font-size: 14px;
            line-height: 1.4;
            color: var(--muted);
        }
        .legal-list {
            margin: 0;
            padding-left: 20px;
            color: var(--text);
            font-size: 15px;
            line-height: 1.55;
        }
        .legal-list li + li {
            margin-top: 8px;
        }
.settings-version {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}
        .history-list {
            display:flex;
            flex-direction:column;
            gap: 12px;
        }
        .history-item {
            position: relative;
            width: 100%;
            text-align: left;
            border: 1px solid var(--line);
            border-radius: 24px;
            background: rgba(255,255,255,0.96);
            padding: 16px 54px 16px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .history-item-button {
            width: 100%;
            padding: 0;
            margin: 0;
            border: 0;
            background: transparent;
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 8px;
            cursor: pointer;
        }
        .player-list-item {
            width: 100%;
            padding: 16px;
            margin: 0;
            border: 1px solid var(--line);
            border-radius: 24px;
            background: rgba(255,255,255,0.96);
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 8px;
            cursor: pointer;
        }
        .history-item-title {
            font-size: 20px;
            font-weight: 900;
            letter-spacing: -0.03em;
        }
        .history-meta {
            display:flex;
            gap:10px;
            flex-wrap:wrap;
            color: var(--muted);
            font-size: 14px;
            font-weight: 700;
        }
        .bgg-meta {
            margin: 8px 0 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.35;
            font-weight: 700;
        }
        .history-bgg-meta {
            margin-top: -2px;
        }
        .history-delete {
            position:absolute;
            top:12px;
            right:12px;
            width:32px;
            height:32px;
            border-radius:999px;
            border:0;
            background:#ffe5e2;
            color:#ff3b30;
            font-size:20px;
            font-weight:800;
            line-height:1;
            cursor:pointer;
        }
        .player-summary {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .player-vote-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 12px;
        }
        .player-vote-row {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 14px 16px;
            border-radius: 22px;
            border: 1px solid var(--line);
            background: rgba(255,255,255,0.96);
        }
        .player-vote-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .player-vote-game {
            min-width: 0;
            font-size: 17px;
            font-weight: 800;
            letter-spacing: -0.02em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .player-vote-score {
            flex: 0 0 auto;
            font-size: 20px;
            font-weight: 900;
            color: var(--primary);
            letter-spacing: -0.04em;
        }
        .player-vote-bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .player-vote-date {
            color: var(--muted);
            font-size: 15px;
            line-height: 1.2;
        }
        .search-input {
            width:100%;
            border:1.5px solid var(--line);
            border-radius: 18px;
            padding: 14px 16px;
            font-size: 17px;
            background: rgba(255,255,255,0.96);
            outline:none;
        }
        .search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
        }
        .sheet-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.26);
            display: none;
            align-items: flex-end;
            justify-content: center;
            padding: 16px;
            z-index: 20;
        }
        .sheet-backdrop.is-open { display: flex; }
        .sheet {
            width: min(100%, 460px);
            background: rgba(255,255,255,0.97);
            border-radius: 30px 30px 20px 20px;
            padding: 20px 18px 18px;
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .sheet-handle {
            width: 42px;
            height: 5px;
            border-radius: 999px;
            background: #d5dbe8;
            margin: 0 auto;
        }
        .sheet-title {
            margin: 0;
            font-size: 22px;
            font-weight: 900;
            letter-spacing: -0.03em;
        }
        .sheet-copy {
            margin: 0;
            color: var(--muted);
            font-size: 15px;
            line-height: 1.45;
        }
        .sheet-list {
            margin: 0;
            padding-left: 18px;
            color: var(--text);
            font-size: 15px;
            line-height: 1.5;
        }
        .sheet-textarea {
            width: 100%;
            min-height: 160px;
            border: 1.5px solid var(--line);
            border-radius: 18px;
            padding: 14px 16px;
            resize: vertical;
            font-size: 15px;
            line-height: 1.45;
            background: rgba(255,255,255,0.96);
        }
        .sheet-actions {
            display:flex;
            flex-direction:column;
            gap: 10px;
        }
        .update-banner {
            position: fixed;
            left: 16px;
            right: 16px;
            bottom: 16px;
            z-index: 30;
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 22px;
            background: rgba(24, 24, 27, 0.92);
            color: #ffffff;
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
            backdrop-filter: blur(18px);
        }
        .update-banner.is-visible {
            display: flex;
        }
        .update-copy {
            margin: 0;
            font-size: 14px;
            line-height: 1.35;
            color: rgba(255,255,255,0.88);
        }
        .update-button {
            flex: 0 0 auto;
            min-height: 42px;
            padding: 0 16px;
            border-radius: 999px;
            border: 0;
            background: #ffffff;
            color: var(--primary);
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
        }
        @media (max-width: 400px) {
            .recent-grid { grid-template-columns: 1fr; }
            .vote-score-wrap {
                grid-template-columns: 108px 64px;
                min-width: 184px;
                gap: 10px;
            }
            .page { padding-inline: 14px; }
            .range::-webkit-slider-thumb {
                width: 32px;
                height: 32px;
            }
            .range::-moz-range-thumb {
                width: 32px;
                height: 32px;
            }
        }

        .open-session-card {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .open-session-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
        }
        .open-session-button {
            width: auto;
            min-width: 140px;
            padding-inline: 18px;
            flex: 0 0 auto;
        }
        @media (max-width: 520px) {
            .open-session-head {
                flex-direction: column;
                align-items: stretch;
            }
            .open-session-button {
                width: 100%;
            }
        }
