:root {
    color-scheme: light;
    --bg: #fef6e4;
    --card: #ffffff;
    --primary: #ff7f6b;
    --primary-dark: #e85d4a;
    --text: #33272a;
    --muted: #7a6f6a;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bars {
    position: sticky;
    top: 0;
    z-index: 100;
}

.install-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-dark);
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.install-topbar[hidden] {
    display: none;
}

.install-topbar-text {
    flex: 1;
}

.install-topbar-btn {
    background: white;
    color: var(--primary-dark);
    padding: 6px 12px;
    min-height: auto;
    border-radius: 999px;
    font-size: 0.85rem;
}

.install-topbar-close {
    background: transparent;
    color: white;
    padding: 4px 8px;
    min-height: auto;
    font-size: 0.9rem;
}

.auth-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--card);
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.auth-card h1 {
    margin: 0 0 4px;
    font-size: 2rem;
}

.tagline {
    color: var(--muted);
    margin-top: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.auth-form label {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form input {
    font-size: 1rem;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #eee;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

button {
    font-size: 1rem;
    font-weight: 700;
    padding: 14px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.auth-actions button[data-action="login"] {
    background: var(--primary);
    color: white;
}

.auth-actions button[data-action="register"] {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary);
}

.error {
    color: #c0392b;
    font-size: 0.9rem;
    margin: 0;
}

.home-screen {
    flex: 1;
    padding: 24px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-stats-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    background: var(--card);
    padding: 8px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.app-stats-bar[hidden] {
    display: none;
}

.stats-badge {
    font-weight: 700;
    background: var(--bg);
    padding: 6px 14px;
    border-radius: 999px;
}

.rabbit-name-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 4px 0 12px;
}

.rabbit-name-block button {
    background: transparent;
    border: none;
    padding: 4px;
    min-height: auto;
    font-size: 1rem;
    cursor: pointer;
}

.rabbit-name-form {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.rabbit-name-form input {
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #eee;
}

.rabbit-name-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.rabbit-name-form button {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    min-height: auto;
    border-radius: 10px;
}

.share-rabbit-btn {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 16px;
    background: var(--card);
    color: var(--primary-dark);
    border: 2px solid var(--primary);
    padding: 10px;
    font-size: 0.9rem;
}

.share-rabbit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.placeholder-note {
    color: var(--muted);
    font-style: italic;
}

.home-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.home-actions button {
    flex: 1;
    background: var(--primary);
    color: white;
}

.home-actions button:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.logout-btn {
    background: transparent;
    color: var(--muted);
    border: 2px solid #eee;
    width: 100%;
}

/* --- Spil-skærme --- */

.screen {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
}

.screen.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.screen-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.back-btn {
    background: var(--card);
    padding: 8px 14px;
    min-height: auto;
    border-radius: 10px;
}

.operation-group {
    margin-bottom: 24px;
}

.operation-group h3 {
    margin-bottom: 8px;
}

.track-row {
    background: var(--card);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.track-name {
    font-weight: 700;
    margin-bottom: 8px;
}

.stage-bubbles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stage-bubble {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-size: 0.75rem;
}

.stage-bubble.locked {
    background: #eee;
    color: #aaa;
}

.stage-number {
    font-weight: 700;
    font-size: 1rem;
}

.progress-label {
    flex: 1;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}

.points-live {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary-dark);
    min-width: 48px;
    text-align: right;
}

.question-card {
    background: var(--card);
    border-radius: 20px;
    padding: 32px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.question-text {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.option-btn {
    background: #fff3e6;
    color: var(--text);
    border: 2px solid #ffd8b8;
    font-size: 1.4rem;
    padding: 18px;
}

.option-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.option-btn:disabled {
    opacity: 0.7;
}

.result-screen {
    text-align: center;
}

.result-score {
    font-size: 1.3rem;
    font-weight: 700;
}

.result-points {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.review-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    text-align: left;
}

.review-list li {
    display: flex;
    justify-content: space-between;
    background: var(--card);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.review-list li.wrong {
    border-left: 4px solid #c0392b;
}

.review-list li.correct {
    border-left: 4px solid #2ecc71;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.result-actions button:first-child {
    background: var(--primary);
    color: white;
}

.result-actions button:last-child {
    background: transparent;
    border: 2px solid #eee;
}

/* --- Kanin & butik --- */

.home-rabbit {
    max-width: 200px;
    margin: 8px auto 4px;
}

.rabbit-svg {
    width: 100%;
    height: auto;
    display: block;
}

.rabbit-preview {
    max-width: 220px;
    margin: 0 auto 20px;
    background: var(--card);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.shop-slot {
    margin-bottom: 20px;
}

.shop-slot h3 {
    margin-bottom: 8px;
}

.shop-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-item {
    background: var(--card);
    border: 2px solid #eee;
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    font-size: 0.85rem;
}

.shop-item.equipped {
    border-color: var(--primary);
    background: #fff3e6;
}

.shop-item.locked .tag.price {
    color: var(--primary-dark);
    font-weight: 700;
}

.shop-item-name {
    font-weight: 600;
}

.tag {
    font-size: 0.75rem;
    color: var(--muted);
}



