/* === Smurf theme tokens === */
:root {
    --smurf-blue: #3DAEE9;
    --mushroom-red: #E63946;
    --dot-yellow: #FFD23F;
    --pink: #EC4899;
    --bg-soft: #e8f4fc;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.15);
    --font-main: 'Nunito', sans-serif;
}

/* === Reset / Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-soft);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    animation: pageFadeIn 0.2s ease both;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Accessibility: focus-visible === */
:focus-visible {
    outline: 3px solid var(--smurf-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Suppress focus ring for mouse/touch, keep for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* === Mascot utility === */
.dulifuli {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.dulifuli-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.dulifuli-tagline {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mushroom-red);
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.dulifuli--sm  { width: 64px;  }
.dulifuli--md  { width: 112px; }
.dulifuli--lg  { width: 168px; }
.dulifuli--sm .dulifuli-tagline { font-size: 0.9rem; }
.dulifuli--lg .dulifuli-tagline { font-size: 1.25rem; }

/* === Login page === */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)) 24px;
    gap: 8px;
    position: relative;
}

.login-mascot {
    opacity: 0.85;
}

/* Menü-kabala: strici.png a Dulifuli helyén, csak a menü oldalon */
.menu-stici {
    display: block;
    max-width: 240px;
    max-height: 280px;
    margin: 0 auto;
}

/* === Envelope wrapper === */
/* Szándékosan kisebb, mint a nyitási animáció helyigénye: a kinyíló fedél és a
   felemelkedő levél felfelé túllóg, rá a maszkot taglinejaira (elfogadott). */
.envlope-wrapper {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Envelope === */
#envelope {
    position: relative;
    width: 280px;
    height: 180px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    margin-left: auto;
    margin-right: auto;
    top: 10px;
    background-color: var(--smurf-blue);
    box-shadow: 0 4px 20px var(--shadow);
}

.front {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 3;
}

.flap {
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-bottom: 82px solid transparent;
    border-top: 98px solid var(--smurf-blue);
    transform-origin: top;
    pointer-events: none;
}

.pocket {
    border-left: 140px solid #7ec8f0;
    border-right: 140px solid #7ec8f0;
    border-bottom: 90px solid #5bbce4;
    border-top: 90px solid transparent;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* === Letter === */
.letter {
    position: relative;
    background-color: var(--white);
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    height: 90%;
    top: 5%;
    border-radius: 6px;
    box-shadow: 0 2px 26px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    overflow: hidden;
}

.letter:after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

/* === Greeting inside the letter (shown when envelope opens) === */
.letter-greeting {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--smurf-blue);
    text-align: center;
    padding-top: 14px;
}

/* === Login form (below envelope) === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: 12px;
}

.login-label {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.35;
}

.login-input {
    width: 100%;
    border: 2px solid var(--smurf-blue);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: var(--font-main);
    font-size: 1.05rem;
    text-align: center;
    outline: none;
    background: var(--white);
    -webkit-appearance: none;
    min-height: 48px;
}

.login-input:focus {
    border-color: var(--mushroom-red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.18);
}

.login-btn {
    width: 100%;
    background-color: var(--smurf-blue);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    -webkit-appearance: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.login-btn:active {
    background-color: #2a94cc;
    transform: scale(0.98);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error {
    font-size: 0.9rem;
    color: var(--mushroom-red);
    min-height: 1em;
    text-align: center;
    font-weight: 500;
}

/* === Envelope open/close states === */
.open .flap {
    transform: rotateX(180deg);
    transition: transform 0.4s ease, z-index 0.6s;
    z-index: 1;
}

.close .flap {
    transform: rotateX(0deg);
    transition: transform 0.4s 0.6s ease, z-index 1s;
    z-index: 5;
}

.close .letter {
    transform: translateY(0px);
    transition: transform 0.4s ease, z-index 1s;
    z-index: 1;
}

.open .letter {
    transform: translateY(-100px);
    transition: transform 0.4s 0.6s ease, z-index 0.6s;
    z-index: 2;
}

/* === Hearts === */
.hearts {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    z-index: 2;
}

.heart {
    position: absolute;
    bottom: 0;
    right: 10%;
    pointer-events: none;
    font-size: 56px;
    line-height: 1;
}

.close .heart {
    opacity: 0;
    -webkit-animation: none;
    animation: none;
}

.a1 {
    left: 20%;
    transform: scale(0.6);
    opacity: 1;
    -webkit-animation: slideUp 4s linear 1, sideSway 2s ease-in-out 4 alternate;
    animation: slideUp 4s linear 1, sideSway 2s ease-in-out 4 alternate;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    -webkit-animation-delay: 0.7s;
    animation-delay: 0.7s;
}

.a2 {
    left: 55%;
    transform: scale(1);
    opacity: 1;
    -webkit-animation: slideUp 5s linear 1, sideSway 4s ease-in-out 2 alternate;
    animation: slideUp 5s linear 1, sideSway 4s ease-in-out 2 alternate;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    -webkit-animation-delay: 0.7s;
    animation-delay: 0.7s;
}

.a3 {
    left: 10%;
    transform: scale(0.8);
    opacity: 1;
    -webkit-animation: slideUp 7s linear 1, sideSway 2s ease-in-out 6 alternate;
    animation: slideUp 7s linear 1, sideSway 2s ease-in-out 6 alternate;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    -webkit-animation-delay: 0.7s;
    animation-delay: 0.7s;
}

@-webkit-keyframes slideUp {
    0%   { top: 0; }
    100% { top: -600px; }
}
@keyframes slideUp {
    0%   { top: 0; }
    100% { top: -600px; }
}

@-webkit-keyframes sideSway {
    0%   { margin-left: 0px; }
    100% { margin-left: 50px; }
}
@keyframes sideSway {
    0%   { margin-left: 0px; }
    100% { margin-left: 50px; }
}

/* === Shake keyframe (wrong password feedback) === */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-8px); }
    30%       { transform: translateX(8px); }
    45%       { transform: translateX(-6px); }
    60%       { transform: translateX(6px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

.shake {
    animation: shake 0.5s ease both;
}

/* === Menu page === */
.menu-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100dvh;
    padding: 48px 24px 32px;
    padding-top: max(48px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 32px;
}

.menu-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.menu-title {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--smurf-blue);
}

.menu-sub {
    font-size: 1rem;
    color: var(--smurf-blue);
    font-weight: 600;
}

.menu-modes {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 320px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
    cursor: not-allowed;
    opacity: 0.6;
    min-height: 60px;
    width: 100%;
    -webkit-appearance: none;
    text-decoration: none;
}

a.mode-btn {
    cursor: pointer;
    opacity: 1;
    color: #333;
}

a.mode-btn:active {
    background-color: #eaf6fd;
}

.mode-btn--history {
    border-color: var(--dot-yellow);
}

a.mode-btn--history:active {
    background-color: #fff6d1;
}

.mode-label {
    flex: 1;
    text-align: center;
}

.mode-soon {
    font-size: 0.7rem;
    color: var(--mushroom-red);
    background: rgba(230, 57, 70, 0.08);
    border-radius: 6px;
    padding: 2px 6px;
}

.menu-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logout-btn {
    background: transparent;
    border: 2px solid var(--mushroom-red);
    border-radius: 8px;
    color: var(--mushroom-red);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 28px;
    cursor: pointer;
    min-height: 44px;
    -webkit-appearance: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.logout-btn:active {
    background-color: var(--mushroom-red);
    color: var(--white);
}

/* === Shared page layout (story, compliment) === */
.story-page,
.compliment-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--smurf-blue);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
}

.back-link:active {
    opacity: 0.7;
}

.step-badge,
.seen-counter {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    background: var(--smurf-blue);
    border-radius: 20px;
    padding: 4px 12px;
}

/* === Scene card === */
.scene-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 28px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scene-img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    max-height: 200px;
}

.scene-text {
    font-family: var(--font-main);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: #222;
}

.story-actions {
    display: flex;
    justify-content: center;
}

/* === Compliment card === */
/* Két szekciós bók-elrendezés: felül kép (kártya-háttér nélkül), alul szöveg-kártya.
   A swipe (#compliment-card) az egész oszlopot mozgatja. Csak-kép esetén középre kerül. */
.compliment-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-height: 0;
}

.compliment-media-card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compliment-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    padding: 32px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

.compliment-text {
    font-family: var(--font-main);
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.55;
    color: #222;
}

.compliment-img {
    display: block;
    max-width: 100%;
    max-height: 420px;
    border-radius: 14px;
    pointer-events: none;
}

/* Csak-képes lap (nincs szöveg): a kép nagyobb lehet, a képernyőhöz igazodva */
.compliment-media-card--solo .compliment-img {
    max-height: 62dvh;
}

.tag-pill {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--smurf-blue);
    background: rgba(61, 174, 233, 0.1);
    border: 1px solid rgba(61, 174, 233, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
    align-self: center;
}

.compliment-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Lapozási tipp a gombok helyén */
.compliment-hint {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: #88a4b5;
    text-align: center;
}

/* Swipe-olható bók-kártya: a vízszintes húzást a JS kapja, a függőleges görgetés marad */
#compliment-card {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

/* === Primary button === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--smurf-blue);
    color: var(--white);
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    padding: 14px 36px;
    min-height: 52px;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background-color 0.15s ease;
}

.btn-primary:active {
    background-color: #2a94cc;
}

/* === Finished state === */
.finished-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
    padding: 24px;
}

.finished-text {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.5;
    color: #444;
    max-width: 280px;
}

/* === Wheel page === */
.wheel-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 16px;
    background: var(--bg-soft);
}

.wheel-round-title {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.wheel-counter {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    background: var(--smurf-blue);
    border-radius: 20px;
    padding: 4px 12px;
}

.wheel-card-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-card {
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 20px;
    box-shadow: 0 6px 24px var(--shadow);
    width: 100%;
    max-width: 360px;
    padding: 28px 24px;
    perspective: 800px;
}

.wheel-card-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}

.wheel-card-title {
    font-family: var(--font-main);
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.wheel-card-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    color: #555;
    line-height: 1.5;
    min-height: 1.2em;
}

/* Spin animation on card swap */
@keyframes spinCard {
    0%   { transform: rotateY(0deg);   opacity: 1; }
    40%  { transform: rotateY(90deg);  opacity: 0.3; }
    60%  { transform: rotateY(270deg); opacity: 0.3; }
    100% { transform: rotateY(360deg); opacity: 1; }
}

.spinning {
    animation: spinCard 0.7s ease both;
}

/* Like / dislike action buttons */
.wheel-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-bottom: 8px;
}

.wheel-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2.5px solid var(--smurf-blue);
    background: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    transition: transform 0.1s ease, background-color 0.15s ease;
    touch-action: manipulation;
}

.wheel-btn:active {
    transform: scale(0.9);
}

.wheel-btn--dislike {
    border-color: var(--mushroom-red);
}

.wheel-btn--dislike:active {
    background-color: rgba(230, 57, 70, 0.08);
}

.wheel-btn--like:active {
    background-color: rgba(61, 174, 233, 0.1);
}

.wheel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Waiting / empty state cards */
.waiting-card,
.empty-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    padding: 32px 24px;
    background: var(--white);
    border: 2px solid var(--mushroom-red);
    border-radius: 20px;
    box-shadow: 0 4px 16px var(--shadow);
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
}

.waiting-emoji {
    font-size: 2.5rem;
}

.waiting-text,
.empty-text {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.5;
    color: #444;
    max-width: 260px;
}

/* === Admin pages === */
.admin-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 16px;
    background: var(--bg-soft);
}

.admin-header {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-title {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--smurf-blue);
}

/* Stat cards */
.stat-card {
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card-title {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #555;
}

.stat-value {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    color: #222;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0eef7;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--smurf-blue);
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 0;
}

/* Status pill */
.status-pill {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 2px 10px;
}

.status-pill--open {
    background: rgba(255, 210, 63, 0.25);
    color: #b58c00;
}

.status-pill--revealed {
    background: rgba(40, 167, 69, 0.15);
    color: #1a7a30;
}

/* Admin CTA buttons */
.admin-ctas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.cta-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--smurf-blue);
    color: var(--white);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    min-height: 52px;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background-color 0.15s ease;
    text-align: center;
}

.cta-btn-primary:active {
    background-color: #2a94cc;
}

.cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--mushroom-red);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--mushroom-red);
    border-radius: 12px;
    padding: 12px 20px;
    min-height: 52px;
    cursor: pointer;
    width: 100%;
    -webkit-appearance: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cta-btn-secondary:active {
    background-color: var(--mushroom-red);
    color: var(--white);
}

/* Swipe deck */
.swipe-page {
    /* inherits .admin-page */
}

.swipe-deck {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.swipe-card {
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 20px;
    box-shadow: 0 6px 24px var(--shadow);
    width: 100%;
    max-width: 360px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    cursor: grab;
    will-change: transform;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-counter {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    background: var(--smurf-blue);
    border-radius: 20px;
    padding: 4px 12px;
}

/* === Reveal page === */
.reveal-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 20px;
    background: var(--bg-soft);
}

.reveal-title {
    font-family: var(--font-main);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--smurf-blue);
    text-align: center;
    line-height: 1.3;
}

.reveal-round {
    font-size: 0.9rem;
    font-weight: 400;
    color: #777;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.match-card {
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 16px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-card-title {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.match-card-desc {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.reveal-footer {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* Empty matches state */
.empty-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px 24px;
    background: var(--white);
    border: 2px solid var(--mushroom-red);
    border-radius: 20px;
    box-shadow: 0 4px 16px var(--shadow);
}

.empty-matches-emoji {
    font-size: 2.5rem;
}

.empty-matches-text {
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
    color: #444;
    max-width: 280px;
}

/* Waiting state on reveal page */
.waiting-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 32px 24px;
}

/* Admin match list (inline in stats card) */
.match-list-admin {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
}

.match-list-item {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #333;
    padding: 4px 0;
}

/* New round button */
.new-round-btn {
    width: 100%;
}

/* Error banner */
.error-banner {
    background: rgba(230, 57, 70, 0.1);
    border: 1.5px solid var(--mushroom-red);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--mushroom-red);
    text-align: center;
}

/* Tertiary history link */
.history-link {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--smurf-blue);
    text-decoration: underline;
    text-align: center;
    display: block;
    padding: 4px 0;
}

/* === Activity log === */
.activity-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    font-size: 0.82rem;
    color: #555;
    margin: 0 0 8px;
    cursor: pointer;
    user-select: none;
}

.activity-toggle input {
    margin: 0;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-list--hide-noise .activity-item:not(.activity-item--important) {
    display: none;
}

/* Base item — used as the muted "noise" style by default */
.activity-item {
    border-left: 3px solid #ccc;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #777;
}

.activity-item .activity-event {
    color: #888;
    font-weight: 600;
}

/* Important variants — coloured by role */
.activity-item--important {
    color: #222;
}
.activity-item--important .activity-event {
    font-weight: 700;
}

.activity-item--important.activity-item--visitor {
    border-left-color: var(--pink);
    background: #fce4ec;
}
.activity-item--important.activity-item--visitor .activity-event {
    color: var(--pink);
}

.activity-item--important.activity-item--admin {
    border-left-color: var(--smurf-blue);
    background: #e8f4fc;
}
.activity-item--important.activity-item--admin .activity-event {
    color: var(--smurf-blue);
}

.activity-item--important.activity-item--anon {
    border-left-color: var(--mushroom-red);
    background: #fdecee;
}
.activity-item--important.activity-item--anon .activity-event {
    color: var(--mushroom-red);
}

.activity-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
}

.activity-row--main {
    justify-content: space-between;
    margin-bottom: 4px;
}

.activity-time {
    font-size: 0.78rem;
    color: #888;
    font-variant-numeric: tabular-nums;
}

.activity-row--meta,
.activity-row--extra {
    font-size: 0.78rem;
    color: #777;
}

.activity-role {
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
    color: #555;
}

.activity-item--visitor .activity-role {
    background: rgba(236, 72, 153, 0.14);
    color: var(--pink);
}

.activity-item--admin .activity-role {
    background: rgba(61, 174, 233, 0.14);
    color: var(--smurf-blue);
}

.activity-device--mobile {
    color: #444;
}

.activity-path,
.activity-ip,
.activity-meta-pair {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: #666;
}

.activity-meta-pair {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 3px;
    padding: 0 4px;
}

/* === History page === */
.history-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 16px;
    background: var(--bg-soft);
}

.history-round-card {
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-round-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.history-round-title {
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
}

.history-dates-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.history-date-item {
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: #777;
}

.history-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-section-label {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--smurf-blue);
}

.history-no-match {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #aaa;
}

/* === History: tétel-jelölő + múltbeli találkozók felfedése toggle === */
.history-bullet {
    color: var(--smurf-blue);
    font-weight: 800;
    margin-right: 0.35rem;
}

/* Reveal toggle: vizuálisan rejtett (de fókuszálható) checkbox + stílusos címke */
.reveal-past-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.reveal-past-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--smurf-blue);
    background: var(--white);
    border: 2px solid var(--smurf-blue);
    border-radius: 20px;
    padding: 8px 16px;
    min-height: 44px;
    cursor: pointer;
    user-select: none;
}

.reveal-past-toggle .reveal-past-on { display: none; }
.reveal-past-checkbox:checked ~ .reveal-past-toggle .reveal-past-off { display: none; }
.reveal-past-checkbox:checked ~ .reveal-past-toggle .reveal-past-on { display: inline; }

.reveal-past-checkbox:focus-visible ~ .reveal-past-toggle {
    outline: 3px solid var(--smurf-blue);
    outline-offset: 3px;
}

/* Múltbeli találkozók alapból rejtve; a toggle felfedi.
   A kártya display:flex (oszlop), ezért flex-szel állítjuk vissza, nem block-kal. */
.history-round-card.is-past { display: none; }
.reveal-past-checkbox:checked ~ .history-round-card.is-past { display: flex; }

/* A tervező alatti találkozó-lista (visitor): aktívak fent, múltbeliek a toggle mögött */
.plan-rounds {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.plan-rounds-label {
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--smurf-blue);
}

.match-titles {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-title-item {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    color: #222;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Likes breakdown (details/summary) */
.likes-breakdown {
    border-top: 1px solid #e8f0f7;
    padding-top: 10px;
}

.likes-breakdown-summary {
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    padding: 2px 0;
    list-style: disclosure-closed;
}

.likes-breakdown[open] .likes-breakdown-summary {
    list-style: disclosure-open;
}

.likes-breakdown-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 380px) {
    .likes-breakdown-body {
        grid-template-columns: 1fr;
    }
}

.likes-col-label {
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.likes-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.likes-list li {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #555;
}

.likes-none {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: #bbb;
}

/* === Plan picker page === */
.plan-picker-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 16px 20px 32px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    gap: 24px;
    background: var(--bg-soft);
}

.plan-picker-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding-top: 16px;
}

.plan-picker-title {
    font-family: var(--font-main);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--smurf-blue);
}

.plan-picker-sub {
    font-family: var(--font-main);
    font-size: 1rem;
    color: #555;
    font-weight: 400;
}

.plan-picker-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.plan-date-label {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plan-date-input {
    width: 100%;
    border: 2px solid var(--smurf-blue);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--font-main);
    font-size: 1.05rem;
    background: var(--white);
    color: #222;
    outline: none;
    -webkit-appearance: none;
    min-height: 52px;
    cursor: pointer;
}

.plan-date-input:focus {
    border-color: var(--mushroom-red);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.14);
}

.plan-picker-submit {
    width: 100%;
}

/* Plan date header (swipe + reveal pages) */
.plan-date-header {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--smurf-blue);
    text-align: center;
    padding: 4px 0;
}

/* Plan card list inside admin stats */
.plan-card-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.plan-card {
    background: var(--bg-soft);
    border: 1.5px solid rgba(61, 174, 233, 0.35);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.plan-card-title {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    flex: 1;
}

.plan-card-link {
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--smurf-blue);
    text-decoration: underline;
    margin-top: 4px;
    display: inline-block;
}

.plan-card-delete-form {
    margin: 0;
    padding: 0;
}

.plan-card-delete {
    background: transparent;
    border: none;
    color: var(--mushroom-red);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    -webkit-appearance: none;
    transition: background-color 0.15s ease;
}

.plan-card-delete:hover,
.plan-card-delete:active {
    background: rgba(230, 57, 70, 0.12);
}

/* === Polish: button active press scale === */
.btn-primary:active,
.cta-btn-primary:active,
.mode-btn:active,
.wheel-btn:active,
.logout-btn:active {
    transform: scale(0.97);
}

/* === Polish: reveal mascot header === */
.reveal-mascot-header {
    display: flex;
    justify-content: center;
    margin-bottom: -8px;
}

/* === Polish: finished-card gets align-items center for mascot === */
.finished-card {
    align-items: center;
}

/* === Polish: waiting-state align === */
.waiting-state {
    align-items: center;
}

/* === Polish: progress-bar already has transition, ensure it === */
.progress-fill {
    transition: width 0.4s ease;
}

/* === Mobile safety: no horizontal overflow === */
body, .login-page, .menu-page, .story-page, .compliment-page,
.wheel-page, .reveal-page, .admin-page, .history-page, .plan-picker-page {
    overflow-x: hidden;
}

/* === Role="progressbar" wrapper === */
[role="progressbar"] {
    /* Inherits .progress-bar sizing; this rule ensures consistent rendering */
}

/* === Admin swipe page safe-area bottom padding for actions === */
.wheel-actions {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* === Small screens: ensure mode buttons don't clip === */
@media (max-width: 360px) {
    .mode-btn {
        padding: 14px 12px;
        font-size: 1rem;
    }
    .wheel-card-title {
        font-size: 1.15rem;
    }
    .compliment-text {
        font-size: 1.1rem;
    }
}
