:root {
    --page: #fff7e8;
    --paper: rgba(255, 252, 246, 0.88);
    --paper-strong: #fffdf7;
    --ink: #1d2433;
    --muted: #716b63;
    --line: rgba(29, 36, 51, 0.1);
    --accent: #c45a2f;
    --accent-deep: #8f3110;
    --accent-soft: #f3c28f;
    --shadow: 0 24px 60px rgba(92, 56, 28, 0.18);
    --success: #2d8a58;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 210, 155, 0.95), transparent 32%),
        radial-gradient(circle at bottom right, rgba(220, 105, 61, 0.18), transparent 30%),
        linear-gradient(145deg, #fff8e9 0%, #ffe8c7 46%, #f8d7b4 100%);
    padding: 24px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.38;
    filter: blur(4px);
}

body::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

body::after {
    width: 260px;
    height: 260px;
    left: -80px;
    bottom: 5vh;
    background: radial-gradient(circle, rgba(255, 212, 177, 0.9), rgba(255, 212, 177, 0));
}

.app-shell {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: stretch;
}

.hero-card,
.panel,
.list-panel {
    background: var(--paper);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -80px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--accent-deep);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    max-width: 10ch;
    margin-bottom: 18px;
}

.hero-copy {
    color: var(--muted);
    max-width: 58ch;
    font-size: 1.02rem;
    line-height: 1.6;
    margin-bottom: 26px;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.meta-box {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.meta-label {
    display: block;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.panel-stack {
    display: grid;
    gap: 16px;
}

.mini-panel {
    padding: 24px;
}

.mini-panel h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.mini-panel p {
    color: var(--muted);
    line-height: 1.55;
}

.group-panel {
    display: grid;
    gap: 16px;
}

.group-panel-below {
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.group-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.group-mode-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.group-person-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(29, 36, 51, 0.08);
}

.group-person-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.group-person-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.group-person-header h3 {
    font-size: 1rem;
}

.group-person-count,
.group-mode-summary {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--accent-deep);
}

.group-person-card label + input,
.group-person-card label + textarea,
.group-person-card label + .group-choices-list {
    margin-bottom: 12px;
}

.group-choices-list {
    display: grid;
    gap: 10px;
}

.group-choice-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(29, 36, 51, 0.08);
}

.group-choice-input {
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.group-choice-input:focus {
    box-shadow: none;
    background: transparent;
}

.group-choice-add {
    width: 100%;
}

.group-choice-remove {
    width: auto;
}

.group-person-remove,
.add-person-btn {
    width: auto;
}

.group-mode-footer {
    position: relative;
    z-index: 1;
    padding-top: 2px;
}

.workspace {
    display: grid;
    gap: 24px;
}

.workspace-top {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 24px;
    align-items: start;
}

.panel {
    padding: 30px;
}

.wheel-panel {
    position: sticky;
    top: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 1.55rem;
    margin-bottom: 6px;
}

.panel-header p {
    color: var(--muted);
    line-height: 1.5;
}

.status-pill {
    flex-shrink: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--accent-deep);
}

.mode-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(29, 36, 51, 0.08);
}

.mode-toolbar-label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--muted);
}

.mode-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(29, 36, 51, 0.08);
}

.mode-btn {
    padding: 10px 16px;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
}

.mode-btn.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #e28649 100%);
    color: #fffdf9;
    box-shadow: 0 12px 20px rgba(196, 90, 47, 0.16);
}

.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter-btn {
    padding: 11px 16px;
    border: 1px solid rgba(29, 36, 51, 0.1);
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink);
    box-shadow: none;
}

.filter-btn.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #e28649 100%);
    color: #fffdf9;
    box-shadow: 0 14px 24px rgba(196, 90, 47, 0.18);
}

.wheel-card {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 18px 12px 8px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.45) 54%, rgba(255, 255, 255, 0.2) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(252, 235, 215, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.wheel-stage {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.pointer {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 38px solid var(--accent-deep);
    z-index: 4;
    filter: drop-shadow(0 10px 12px rgba(143, 49, 16, 0.3));
}

.wheel-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: center;
    filter: drop-shadow(0 32px 40px rgba(95, 57, 24, 0.22));
}

.wheel-rim {
    fill: #fff8ee;
    stroke: rgba(255, 255, 255, 0.94);
    stroke-width: 14;
}

.wheel-divider {
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2;
}

.wheel-label {
    fill: #ffffff;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.wheel-label.tight {
    letter-spacing: 0.04em;
}

.wheel-hub {
    position: absolute;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffdf8, #ffd7ab 70%, #ef9c5d 100%);
    border: 8px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(143, 49, 16, 0.18);
    z-index: 3;
}

.active-choice {
    min-height: 32px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-align: center;
}

.active-choice.muted {
    color: var(--muted);
    font-weight: 600;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

button {
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #e28649 100%);
    color: #fffdf9;
    box-shadow: 0 16px 26px rgba(196, 90, 47, 0.26);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    border: 1px solid var(--line);
}

.result-card {
    width: 100%;
    padding: 20px 22px;
    border-radius: 24px;
    background: linear-gradient(140deg, rgba(255, 244, 230, 0.96), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 6px;
}

.result-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.result-value {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 900;
    color: #0b57d0;
    word-break: break-word;
    text-decoration: underline;
    cursor: pointer;
}

.result-value:hover {
    color: #0842a0;
}

.result-value.is-disabled {
    color: var(--accent-deep);
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.result-link {
    width: fit-content;
    font-size: 0.95rem;
    color: #0b57d0;
    text-decoration: underline;
    cursor: pointer;
}

.result-link:hover {
    color: #0842a0;
}

.result-link.is-hidden {
    display: none;
}

.editor-grid {
    display: grid;
    gap: 18px;
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

label {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 10px;
}

textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid rgba(29, 36, 51, 0.12);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    border-radius: 18px;
    font: inherit;
    padding: 16px 18px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.5;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: rgba(196, 90, 47, 0.45);
    box-shadow: 0 0 0 4px rgba(196, 90, 47, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.quick-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.category-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(29, 36, 51, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
}

.category-chip {
    padding: 10px 14px;
    border: 1px solid rgba(29, 36, 51, 0.1);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    box-shadow: none;
}

.category-chip.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, #e28649 100%);
    color: #fffdf9;
    box-shadow: 0 12px 20px rgba(196, 90, 47, 0.16);
}

.helper {
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.94rem;
}

.list-panel {
    padding: 18px;
}

.entry-list {
    display: grid;
    gap: 12px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.entry-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) minmax(220px, 0.9fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(29, 36, 51, 0.08);
}

.entry-row.off {
    opacity: 0.56;
}

.entry-row.filtered-out {
    background: rgba(255, 255, 255, 0.46);
}

.entry-toggle {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.entry-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.entry-name {
    font-weight: 700;
    word-break: break-word;
}

.entry-category-editor {
    min-width: 0;
}

.entry-category-editor .category-chip-group {
    padding: 8px;
    border-radius: 14px;
}

.entry-category-editor .category-chip {
    padding: 8px 10px;
    font-size: 0.76rem;
}

.ghost-btn {
    padding: 10px 14px;
    background: rgba(29, 36, 51, 0.06);
    color: var(--ink);
}

.empty-state {
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
}

.count-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    padding-top: 8px;
}

.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 20;
}

@media (max-width: 1080px) {
    .hero,
    .workspace-top {
        grid-template-columns: 1fr;
    }

    .group-mode-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wheel-panel {
        position: static;
    }
}

@media (max-width: 720px) {
    body {
        padding: 14px;
    }

    .hero-card,
    .panel,
    .list-panel,
    .mini-panel {
        padding: 22px;
        border-radius: 24px;
    }

    .hero-meta {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-toolbar,
    .group-panel-header,
    .group-person-header,
    .group-person-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-toggle {
        grid-auto-flow: row;
        grid-auto-columns: unset;
    }

    .group-mode-list {
        grid-template-columns: 1fr;
    }

    .quick-add,
    .entry-row {
        grid-template-columns: 1fr;
    }

    .entry-row {
        gap: 10px;
    }

    .controls,
    .editor-actions {
        justify-content: stretch;
    }
    button {
        width: 100%;
    }
}