:root {
    --color-primary: #1d747b;
    --color-primary-hover: #155d63;
    --color-primary-soft: #e5f3f5;
    --color-success: #18794e;
    --color-text: #34373a;
    --color-muted: #6b7580;
}

body {
    font-family: Arial, sans-serif;
    background: #f7f6f3;
    color: var(--color-text);

    min-height: 100vh;

    margin: 0;
}

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

    width: min(100% - 48px, 1120px);
    margin: 0 auto;
    padding: 20px 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-nav a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--color-primary-hover);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.nav-balance {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 7px 6px 11px;
    background: var(--color-primary-soft);
    border-radius: 999px;
    color: var(--color-primary-hover);
    font-size: 14px;
    font-weight: 700;
}

.nav-balance strong {
    display: grid;
    place-items: center;
    min-width: 27px;
    height: 27px;
    padding: 0 4px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 999px;
}

.nav-profile,
.nav-register {
    padding: 9px 13px;
    border: 1px solid #c9d8dc;
    border-radius: 9px;
}

.site-logo {
    display: inline-flex;
    flex: 0 0 auto;
}

.site-logo img {
    display: block;
    width: 180px;
    height: auto;
}

main {
    width: min(100% - 40px, 1200px);
    margin: 0 auto;
}

main:has(.focus-home) {
    width: min(100% - 48px, 1120px);
}


.button {
    margin-top: 20px;
    padding: 12px 24px;

    border: none;
    border-radius: 8px;

    background: var(--color-primary);
    color: white;

    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: var(--color-primary-hover);
}

.button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(42, 127, 142, 0.25);
    outline-offset: 3px;
}

.hidden {
    display: none;
}

/* Mosaic detail */

.mosaic-detail {
    padding: 24px 0 56px;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;

    color: #51606f;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    color: var(--color-primary);
}

.mosaic-detail__heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;

    margin-bottom: 24px;
}

.mosaic-detail__heading h1 {
    margin: 4px 0 0;
    font-size: clamp(32px, 5vw, 48px);
}

.eyebrow,
.timer-label {
    margin: 0;

    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow {
    color: var(--color-primary-hover);
}

.mosaic-size {
    margin: 0 0 6px;
    color: #6b7580;
}

.mosaic-detail__actions {
    text-align: right;
}

.tutorial-help,
.tutorial__skip {
    padding: 0;

    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mosaic-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
    gap: 28px;
    align-items: stretch;
}

.mosaic-panel,
.focus-panel {
    padding: 24px;

    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
}

.mosaic-panel {
    display: flex;
    align-items: center;
}

.mosaic {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;

    overflow: hidden;
    border-radius: 10px;
}

.mosaic--celebrating {
    animation: mosaic-celebration 1.4s ease-out;
}

@keyframes mosaic-celebration {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(42, 127, 142, 0);
    }

    35% {
        transform: scale(1.025);
        box-shadow: 0 0 36px rgba(42, 127, 142, 0.55);
    }

    70% {
        transform: scale(1.01);
        box-shadow: 0 0 24px rgba(24, 121, 78, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(24, 121, 78, 0);
    }
}

.mosaic-image {
    display: block;
    width: 100%;
    height: auto;
}

.mosaic-grid {
    position: absolute;
    inset: 0;

    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
}

.tile {
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #222;

    cursor: default;
    transform-origin: center;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tile--available {
    cursor: pointer;
}

.tile--available:hover,
.tile--available:focus-visible {
    background: #234f57;
    box-shadow: inset 0 0 0 2px #6fc0ca;
    outline: none;
}

.tile.tile--opened {
    background: transparent;
    border-color: transparent;
}

.tile.tile--revealing {
    animation: tile-reveal 1200ms ease-out both;
}

@keyframes tile-reveal {
    0% {
        opacity: 0.85;
        transform: scale(1);
        box-shadow: inset 0 0 0 2px rgba(111, 192, 202, 0.65);
    }

    55% {
        opacity: 1;
        transform: scale(0.97);
        box-shadow: inset 0 0 10px 2px rgba(111, 192, 202, 0.4);
    }

    100% {
        opacity: 0;
        transform: scale(0.92);
        box-shadow: inset 0 0 0 0 rgba(111, 192, 202, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tile.tile--revealing {
        animation: none;
    }
}

.tile:disabled {
    cursor: default;
}

.focus-panel {
    position: sticky;
    top: 24px;
    padding: 32px;
}

.mosaic-completion-message {
    display: none;
}

.reward-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding-bottom: 20px;
    border-bottom: 1px solid #e5e9ee;
}

.reward-summary span {
    color: #51606f;
    font-weight: 600;
}

.reward-summary strong {
    display: grid;
    place-items: center;
    min-width: 48px;
    min-height: 48px;

    background: var(--color-primary-soft);
    border-radius: 50%;
    color: var(--color-primary-hover);
    font-size: 22px;
}

.focus-hint {
    margin: 24px 0;
    color: #6b7580;
    line-height: 1.55;
}

.tile-message,
.completion-message {
    margin: 12px 0;

    font-weight: 600;
    line-height: 1.5;
}

.tile-message:empty,
.completion-message:empty {
    display: none;
}

.tile-message {
    color: #a05a00;
}

.completion-message {
    color: #18794e;
    font-size: 1.5rem;
    animation: completion-rise 600ms ease-out both;
}

@keyframes completion-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#completion-link:not(.hidden) {
    display: inline-block;
    margin-top: 10px;
}

.timer {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e5e9ee;
    text-align: center;
}

.timer h2 {
    margin: 18px 0 22px;

    font-size: clamp(48px, 6vw, 68px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.timer-display {
    position: relative;
    display: grid;
    width: min(100%, 340px);
    aspect-ratio: 1;
    margin: 0 auto 22px;
    place-items: center;
}

.timer-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring__track,
.timer-ring__progress {
    fill: none;
    stroke-width: 5;
}

.timer-ring__track {
    stroke: #e5f0ef;
}

.timer-ring__progress {
    stroke: var(--color-primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 400ms ease;
}

.timer--break .timer-ring__progress {
    stroke: var(--color-success);
}

.timer-display h2 {
    position: relative;
    z-index: 1;
    margin: 0;
}

.timer-mode-group {
    display: flex;
    width: min(100%, 340px);
    padding: 4px;
    gap: 4px;
    border: 1px solid #d1dfe1;
    border-radius: 12px;
    background: #f3f7f7;
}

.timer-mode-button {
    flex: 1;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.timer-mode-button[aria-pressed="true"] {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 5px #174e5720;
}

.timer-mode-button:disabled { cursor: default; opacity: 0.65; }
.timer-mode-button:focus-visible,
.timer-volume:focus-visible { outline: 3px solid #67b9c2; outline-offset: 3px; }
.timer-mode-button:not(:disabled):hover { background: #e1eeee; color: #17515b; }
.timer-mode-button[aria-pressed="true"]:not(:disabled):hover { background: var(--color-primary-hover); color: white; }

.timer .timer-volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    margin: 22px auto 0;
    color: var(--color-muted);
    font-size: 13px;
}
.timer-sound-icon { width: 21px; height: 21px; flex-shrink: 0; color: var(--color-primary); }
.timer-volume-label { margin: 0; }
.timer-volume-control output { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.timer-volume {
    appearance: none;
    -webkit-appearance: none;
    width: clamp(72px, 12vw, 110px);
    height: 4px;
    margin: 0;
    border-radius: 4px;
    background: linear-gradient(to right, var(--color-primary) var(--volume, 70%), #dce7e8 var(--volume, 70%));
    cursor: pointer;
}
.timer-volume::-webkit-slider-thumb {
    appearance: none;
    width: 13px;
    height: 13px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 1px #88b4bb;
}
.timer-volume::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--color-primary);
}

.timer-demo-badge {
    display: block;
    width: fit-content;
    margin: 8px auto 20px;
    padding: 5px 9px;
    background: #fff4d6;
    border: 1px solid #ead49a;
    border-radius: 999px;
    color: #795b0b;
    font-size: 12px;
    font-weight: 700;
}

.focus-home__timer .timer-demo-badge {
    margin-top: 8px;
    margin-bottom: 20px;
}

.timer--break .timer-label,
.timer--break h2 {
    color: var(--color-success);
}

.timer--complete .timer-label {
    color: var(--color-primary);
}

.timer--complete .timer-demo-badge,
.timer--complete .timer-volume-label,
.timer--complete .timer-volume,
.timer--complete .tile-message,
.timer--complete .timer-label,
.timer--complete .timer-display,
.timer--complete .timer-controls {
    display: none;
}

.timer--complete .timer-ring__progress {
    stroke: var(--color-success);
    stroke-dashoffset: 0 !important;
}

.timer--break {
    padding: 24px 16px 16px;

    background: #f2faf6;
    border: 1px solid #bee3cf;
    border-radius: 12px;
}

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

.timer-controls .button,
.focus-panel > .button {
    margin-top: 12px;
}

.button--secondary {
    background: #e8edf3;
    color: #344150;
}

.button--secondary:hover {
    background: #dbe2e9;
}

/* Focus home */

.focus-home {
    width: 100%;
    margin: 0 auto;
    padding: 72px 0 72px;
}

@media (min-width: 851px) {
    .focus-home {
        box-sizing: border-box;
        min-height: calc(100vh - 300px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.focus-home__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    margin-bottom: 36px;
}

.focus-home__header h1 {
    margin: 6px 0 10px;
    font-size: clamp(36px, 6vw, 58px);
}

.focus-home__intro {
    max-width: 620px;
    margin: 0;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1.55;
}

.focus-home__balance {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    padding: 12px 14px 12px 20px;
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(39, 51, 64, 0.07);
    color: #51606f;
    font-weight: 700;
}

.focus-home__balance strong {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: var(--color-primary-soft);
    border-radius: 50%;
    color: var(--color-primary-hover);
    font-size: 22px;
}

.focus-home__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px;
    align-items: stretch;
}

.focus-home__timer-card,
.focus-home__mosaic-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 520px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
}

.focus-home__timer-card:has(.timer--break),
.focus-home__timer-card:has(.timer--complete),
.focus-panel:has(.timer--break) {
    background: #f2faf6;
    border-color: #bee3cf;
}

.focus-panel:has(.timer--complete) {
    background: #f2faf6;
    border-color: #bee3cf;
}

.focus-home__timer-card:has(.timer--complete) {
    display: flex;
    align-items: center;
}

.focus-panel:has(.timer--complete) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

.focus-panel:has(.timer--complete) .timer {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.timer--complete .timer-settings,
.timer.timer--complete .timer-volume-control {
    display: none;
}

.focus-home__timer-card:has(.timer--complete) .focus-home__timer,
.focus-panel:has(.timer--complete) .timer {
    width: 100%;
}

.focus-home__timer {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.timer-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}


.focus-home__timer .timer-label {
    font-size: 14px;
}

.focus-home__timer h2 {
    margin: 12px 0 18px;
    font-size: clamp(76px, 10vw, 124px);
    line-height: 0.95;
}

.focus-home__timer .timer-controls {
    margin-top: 6px;
}

.focus-home__timer .timer-controls .button {
    min-width: 128px;
}

.timer-controls #start {
    min-width: 160px;
}

.focus-home__mosaic-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin-bottom: 24px;
    object-fit: cover;
    border-radius: 12px;
}

.focus-home__mosaic-preview {
    position: relative;
    width: min(100%, 280px);
    align-self: center;
    flex-shrink: 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    margin-bottom: 24px;
    border-radius: 12px;
}

.focus-home__mosaic-preview img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    object-fit: cover;
}

.focus-home__mosaic-preview-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    grid-template-rows: repeat(var(--rows), 1fr);
}

.focus-home__mosaic-preview-grid span {
    background: #20272b;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.focus-home__mosaic-preview-grid span.is-opened {
    background: transparent;
    border-color: transparent;
}

.focus-home__mosaic-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: 24px;
    align-self: stretch;
}

.focus-home__mosaic-card h2 {
    margin: 8px 0 10px;
}

.focus-home__mosaic-card .button {
    display: inline-block;
    margin-top: 14px;
    text-align: center;
}

.focus-home__mosaic-card--session-complete .button {
    display: none;
}

.focus-home__session-result .session-reveal-action {
    display: none;
}

.focus-home__guest-note {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid #e5e9ee;
    color: var(--color-muted);
    text-align: center;
}

.focus-home__guest-note a {
    color: var(--color-primary-hover);
    font-weight: 700;
}

.focus-home__session-result {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #eaf6f7, #f2faf6);
    border: 1px solid #c8e5e5;
    border-radius: 14px;
    text-align: center;
}

.focus-home__timer-card:has(.timer--complete) .focus-home__session-result,
.focus-panel:has(.timer--complete) .mosaic-session-result {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.focus-home__timer-card:has(.timer--complete) .focus-home__result-actions,
.focus-panel:has(.timer--complete) .focus-home__result-actions {
    flex-direction: column;
    align-items: center;
}

.focus-home__session-result:not(.hidden) {
    animation: completion-card-in 450ms ease-out both;
}

@keyframes completion-card-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.focus-home__result-kicker {
    margin: 0 0 6px;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.completion-celebration {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 8px);
    grid-template-rows: repeat(3, 8px);
    justify-content: center;
    gap: 9px;
    width: 120px;
    margin: 0 auto 16px;
}

.completion-celebration span {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #e6b84d;
    transform: rotate(24deg);
}

.completion-celebration span:nth-child(2n) {
    background: #53aeb5;
    transform: rotate(-18deg);
}

.completion-celebration span:nth-child(3n) {
    background: #e76f78;
}

.completion-celebration__tile {
    grid-column: 3;
    grid-row: 2;
    width: 44px !important;
    height: 44px !important;
    margin: -18px 0 0 -18px;
    border-radius: 7px !important;
    background: var(--color-primary) !important;
    box-shadow: 0 7px 16px rgba(33, 107, 120, 0.2);
    transform: none !important;
}

.focus-home__session-result #long-break {
    width: auto;
    padding: 4px 8px;
    background: transparent;
    color: var(--color-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.focus-home__session-result h3 {
    margin: 0;
    font-size: 24px;
}

.focus-home__result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.focus-home__result-actions .button {
    box-sizing: border-box;
    width: 190px;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.mosaic-session-result {
    padding: 20px;
}

.mosaic-session-result .focus-home__result-actions {
    justify-content: center;
}

.mosaic-session-result #completed-mosaic-action {
    display: none;
}

/* Profile */

.profile-page {
    display: grid;
    min-height: calc(100vh - 112px);
    place-items: center;
    padding: 32px 0 64px;
}

.profile-card {
    box-sizing: border-box;
    width: min(100%, 560px);
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e9ee;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
}

.profile-card h1 {
    margin: 6px 0 4px;
    font-size: 40px;
}

.profile-card__username {
    margin: 0;
    color: var(--color-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 32px;
}

.profile-stats > div {
    padding: 22px;
    background: #f5f8fa;
    border-radius: 12px;
}

.profile-stats strong,
.profile-stats span {
    display: block;
}

.profile-stats strong {
    color: var(--color-primary-hover);
    font-size: 32px;
}

.profile-stats span {
    margin-top: 4px;
    color: var(--color-muted);
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.profile-actions form {
    margin: 0;
}

.profile-actions .button {
    margin: 0;
}

/* Mosaic catalog */

.pack-catalog {
    padding: 24px 0 56px;
}

.pack-catalog__header {
    margin-bottom: 28px;
}

.pack-catalog__header h1 {
    margin: 6px 0 10px;
    font-size: clamp(32px, 5vw, 48px);
}

.pack-catalog__intro {
    max-width: 640px;
    margin: 0;
    color: #51606f;
    line-height: 1.6;
}

.pack-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 1040px;
    margin: 0 auto;
}

.pack-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.pack-card-link--locked {
    pointer-events: none;
}

.pack-detail {
    padding: 24px 0 56px;
}

.pack-section {
    padding: 24px;
    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
}

.pack-section--locked {
    background: linear-gradient(180deg, #f7f9fb 0%, #eef2f5 100%);
}

.pack-card {
    overflow: hidden;
    height: 100%;
    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 20px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pack-card-link:hover .pack-card,
.pack-card-link:focus-visible .pack-card {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(39, 51, 64, 0.12);
}

.pack-card__image-wrap {
    position: relative;
    overflow: hidden;
}

.pack-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.pack-card__lock-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    background: rgba(23, 30, 36, 0.82);
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pack-card__lock-icon svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.pack-card__body {
    padding: 20px;
}

.pack-card__body h2 {
    margin: 6px 0 10px;
    font-size: clamp(24px, 3vw, 32px);
}

.pack-card__description {
    margin: 0 0 14px;
    color: #51606f;
    line-height: 1.5;
}

.pack-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pack-card__count {
    color: #51606f;
    font-size: 14px;
    font-weight: 600;
}

.pack-card--not_started .pack-card__image {
    filter: grayscale(1) blur(2.5px);
    transform: scale(1.015);
}

.pack-card--in_progress .pack-card__image {
    filter: grayscale(1) blur(1px);
    transform: scale(1.01);
}

.pack-card--completed .pack-card__image {
    filter: grayscale(0);
}

.pack-card--completed {
    box-shadow:
        inset 0 0 0 2px #3ba675,
        0 10px 28px rgba(24, 121, 78, 0.16);
}

.pack-card--locked {
    background: #f6f8fa;
}

.pack-card--locked .pack-card__image {
    filter: grayscale(1) blur(3px) brightness(0.8);
    transform: scale(1.015);
}

.pack-card--locked .pack-card__lock-icon {
    display: inline-flex;
}

.pack-card--locked .mosaic-status {
    background: #eceff2;
    color: #65707c;
}

.pack-section__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 24px;
    margin-bottom: 18px;
}

.pack-section__header h2 {
    margin: 4px 0 0;
    font-size: clamp(24px, 3vw, 32px);
}

.pack-section__eyebrow {
    margin: 0;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pack-section__description,
.pack-lock-note,
.pack-progress-card__hint,
.pack-empty-state {
    color: #51606f;
    line-height: 1.5;
}

.pack-lock-note {
    max-width: 320px;
    margin: 0;
    padding: 12px 14px;
    background: #f2f5f8;
    border-radius: 12px;
    font-weight: 600;
}

.pack-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.pack-progress-card {
    padding: 16px;
    background: #f8fafb;
    border: 1px solid #e5e9ee;
    border-radius: 16px;
}

.pack-progress-card__heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    font-weight: 700;
}

.pack-progress-card__heading span {
    color: #51606f;
}

.pack-progress-card__heading strong {
    color: var(--color-primary-hover);
}

.progress-bar {
    overflow: hidden;
    height: 10px;
    background: #dfe7eb;
    border-radius: 999px;
}

.progress-bar__fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #216b78 0%, #52a4af 100%);
    border-radius: 999px;
}

.progress-bar__fill--accent {
    background: linear-gradient(90deg, #18794e 0%, #48af72 100%);
}

.pack-progress-card__hint {
    margin: 12px 0 0;
    font-size: 14px;
}

.pack-mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.pack-mosaic-link {
    color: inherit;
    text-decoration: none;
}

.mosaic-card {
    overflow: hidden;
    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(39, 51, 64, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mosaic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(39, 51, 64, 0.1);
}

.mosaic-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.mosaic-card h2,
.mosaic-card h3 {
    margin: 16px 16px 8px;
}

.mosaic-card p {
    margin: 8px 16px;
}

.mosaic-card p:last-child {
    margin-bottom: 16px;

    font-size: 14px;
    font-weight: 600;
}

.mosaic-status {
    display: inline-block;
    padding: 5px 9px;

    border-radius: 999px;
}

.mosaic-card--not_started .mosaic-status {
    background: #eef1f3;
    color: #59636e;
}

.mosaic-card--in_progress .mosaic-status {
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
}

.mosaic-card--in_progress img {
    filter: grayscale(1) blur(1px);
    transform: scale(1.01);
}

.mosaic-card--not_started img {
    filter: grayscale(1) blur(2.5px);
    transform: scale(1.015);
}

.mosaic-card--completed img {
    filter: grayscale(0);
    transform: scale(1);
}

.mosaic-card--completed {
    box-shadow:
        inset 0 0 0 2px #3ba675,
        0 10px 28px rgba(24, 121, 78, 0.16);
}

.mosaic-card--completed .mosaic-status {
    background: #e7f7ef;
    color: var(--color-success);
}

.mosaic-card--locked {
    background: #f6f8fa;
    box-shadow: none;
}

.mosaic-card--locked img {
    filter: grayscale(1) blur(3px);
    transform: scale(1.015);
}

.mosaic-card--locked .mosaic-status {
    background: #eceff2;
    color: #65707c;
}

.pack-empty-state {
    padding: 20px;
    background: #f8fafb;
    border: 1px dashed #c9d8dc;
    border-radius: 16px;
}

/* First-visit tutorial */

.tutorial-open {
    overflow: hidden;
}

.tutorial {
    position: fixed;
    z-index: 1000;
    inset: 0;

    display: grid;
    place-items: center;
    padding: 20px;
}

.tutorial.hidden {
    display: none;
}

.tutorial__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 29, 31, 0.5);
}

.tutorial__dialog {
    position: relative;
    z-index: 2;

    box-sizing: border-box;
    width: min(100%, 480px);
    padding: 28px;

    background: white;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.tutorial__step {
    margin: 0 0 8px;

    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tutorial__dialog h2 {
    margin: 0 0 12px;
}

.tutorial__dialog > p:last-of-type {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.6;
}

.tutorial__controls {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-top: 24px;
}

.tutorial__controls > div {
    display: flex;
    gap: 10px;
}

.tutorial__controls .button {
    margin-top: 0;
}

.tutorial-highlight {
    box-shadow: 0 0 0 5px #8ed1da, 0 0 32px rgba(42, 127, 142, 0.6);
}

/* Authentication */

.auth-page {
    min-height: calc(100vh - 96px);

    display: grid;
    place-items: center;

    padding: 32px 0 64px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 36px;

    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(39, 51, 64, 0.08);
}

.auth-card h1 {
    margin: 6px 0 12px;
    font-size: 36px;
}

.auth-intro {
    margin: 0 0 28px;
    color: #6b7580;
    line-height: 1.55;
}

.auth-form p {
    margin: 0 0 18px;
}

.auth-form label {
    display: block;
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 700;
}

.auth-form input {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;

    background: #fbfcfd;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    color: #273340;
    font: inherit;
}

.auth-form input:focus {
    outline: 3px solid rgba(42, 127, 142, 0.16);
    border-color: var(--color-primary);
}

.auth-form .helptext {
    display: block;
    margin-top: 7px;

    color: #6b7580;
    font-size: 13px;
    line-height: 1.45;
}

.auth-form ul {
    padding-left: 20px;
}

.auth-form .errorlist {
    margin: 0 0 8px;
    padding: 10px 12px;

    background: #fff0f0;
    border-radius: 8px;
    color: #b42318;
    font-size: 14px;
    list-style-position: inside;
}

.auth-form .button {
    width: 100%;
    margin-top: 4px;
}

.auth-switch {
    margin: 24px 0 0;
    text-align: center;
}

.auth-switch a {
    color: var(--color-primary-hover);
    font-weight: 700;
}

@media (max-width: 850px) {
    .mosaic-workspace {
        grid-template-columns: 1fr;
    }

    .mosaic-panel {
        display: block;
    }

    .focus-panel {
        position: static;
        margin-top: 0;
    }

    .pack-mosaic-grid,
    .pack-progress-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .focus-home__grid {
        grid-template-columns: 1fr;
    }

    .focus-home__mosaic-card {
        position: static;
    }
}

@media (max-width: 500px) {
    header {
        width: min(100% - 28px, 1200px);
        align-items: flex-start;
        gap: 16px;
    }

    .site-logo img {
        width: 132px;
    }

    .site-nav {
        justify-content: flex-end;
        flex-wrap: wrap;
        font-size: 14px;
    }

    .nav-balance__label {
        display: none;
    }

    .nav-balance {
        padding-left: 7px;
    }

    .mosaic-detail {
        padding-top: 12px;
    }

    .mosaic-detail__heading {
        display: block;
    }

    .mosaic-size {
        margin-top: 8px;
    }

    .mosaic-detail__actions {
        text-align: left;
    }

    .mosaic-panel,
    .focus-panel {
        padding: 16px;
        border-radius: 14px;
    }

    .timer {
        margin-top: 22px;
        padding-top: 22px;
    }

    .focus-home {
        padding-top: 16px;
    }

    .focus-home__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .focus-home__timer-card,
    .focus-home__mosaic-card {
        min-height: 0;
        padding: 20px;
    }

    .timer-settings {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .timer-volume-control {
        min-width: 0;
    }

    .focus-home__timer h2 {
        font-size: clamp(64px, 24vw, 96px);
    }

    .focus-home__session-result {
        padding: 20px;
    }

    .focus-home__result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .focus-home__result-actions .button {
        box-sizing: border-box;
        width: 100%;
        text-align: center;
    }

    .profile-card {
        padding: 26px 20px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-actions .button,
    .profile-actions form {
        box-sizing: border-box;
        width: 100%;
        text-align: center;
    }

    .auth-page {
        display: block;
        padding-top: 20px;
    }

    .auth-card {
        box-sizing: border-box;
        padding: 24px 20px;
    }

    .tutorial__dialog {
        padding: 22px;
    }

    .tutorial__controls {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .tutorial__controls > div .button {
        flex: 1;
    }

    .pack-list,
    .pack-mosaic-grid,
    .pack-progress-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mosaic--celebrating,
    .completion-message,
    .focus-home__session-result:not(.hidden) {
        animation: none;
    }
}


.hero {
    min-height: 70vh;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.hero-content {
    max-width: 620px;
}

.hero-label {
    margin-bottom: 12px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.hero h1 {
    margin: 0 0 20px;

    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
}

.hero-description {
    max-width: 520px;
    margin: 0 auto 32px;

    font-size: 18px;
    line-height: 1.6;
}

.hero .button {
    display: inline-block;
}
.active-timer-banner {
    align-items: center;
    background: var(--color-ink, #1f2933);
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 0.7rem 1rem;
    text-align: center;
}

.active-timer-banner a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.active-timer-banner[hidden] {
    display: none;
}

.catalog-empty-state {
    padding: 48px 24px;
    background: white;
    border: 1px solid #e5e9ee;
    border-radius: 18px;
    text-align: center;
}

.catalog-empty-state h2 {
    margin: 0 0 8px;
}

.catalog-empty-state p {
    color: var(--color-muted);
    margin: 0;
}

@media (max-width: 500px) {
    .active-timer-banner {
        gap: 0.5rem 0.8rem;
        justify-content: flex-start;
        line-height: 1.4;
    }
}

/* Keep completion actions inside the narrow mosaic side panel. */
.focus-panel .focus-home__result-actions .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
}
.focus-panel .reward-summary { flex-shrink: 0; }
.focus-panel .focus-home__session-result { min-width: 0; }
@media (max-width: 640px) {
    .timer-mode-group { margin-inline: auto; }
}

/* Focus home follows the compact two-card composition. */
.focus-home { padding: 28px 0 32px; }
header { border-bottom: 1px solid #dededb; }
.focus-home__header {
    display: block;
    text-align: center;
    margin: 0 auto 28px;
}
.focus-home__header h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3.4vw, 42px);
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: #242628;
}
.focus-home__intro { max-width: none; font-size: clamp(16px, 1.6vw, 20px); }
.focus-home__welcome { display: flex; justify-content: center; gap: 12px; margin-top: 10px; color: var(--color-muted); font-size: 13px; }
.focus-home__welcome .tutorial-help { font-size: inherit; }
.focus-home__grid { gap: 24px; }
.focus-home__timer-card,
.focus-home__mosaic-card {
    position: static;
    min-height: 510px;
    padding: 24px 28px;
    border-color: #e6e7e5;
    box-shadow: 0 6px 24px #323a3b04;
}
.focus-home__card-kicker { align-self: flex-start; margin: 0 0 20px; }
.focus-home .focus-home__timer { margin: 0; padding: 0; }
.focus-home__timer-card:has(.timer--complete) .focus-home__card-kicker { display: none; }
.focus-home__timer .timer-display {
    width: min(100%, 280px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 18px auto 8px;
}
.focus-home__timer.timer--complete .timer-display { display: none; }
.focus-home__timer .timer-display h2 { margin: 0; font-size: clamp(52px, 5.5vw, 76px); letter-spacing: -0.055em; color: #242628; }
.focus-home__timer .timer-label {
    position: relative;
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-muted);
}
.focus-home__timer .timer-ring__track { stroke: #d7ebea; }
.focus-home__timer .timer-ring__progress { stroke: #45a0a5; }
.focus-home__timer .timer-controls #start { width: min(100%, 300px); font-weight: 600; }
.focus-home__timer .tile-message:empty,
.focus-home__timer .completion-message:empty { display: none; }
.focus-home__guest-note { margin-top: 16px; padding-top: 14px; font-size: 12px; }
.focus-home__mosaic-card { text-align: center; justify-content: flex-start; }
.focus-home__mosaic-card .focus-home__picture-heading { align-self: flex-start; font-size: 24px; margin: 0 0 20px; letter-spacing: -0.03em; }
.focus-home__mosaic-preview { width: min(100%, 320px); margin-bottom: 16px; border-radius: 7px; }
.focus-home__mosaic-preview-grid span { background: #cde1df; border: 1px solid #ffffffa6; }
.focus-home__mosaic-preview-grid span.is-opened { background: transparent; border-color: #ffffffa6; }
.focus-home__picture-title { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
#latest-mosaic-progress { margin: 0 0 16px; color: var(--color-muted); font-size: 14px; }
.focus-home__picture-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }
.focus-home__picture-actions .focus-home__balance {
    padding: 10px 16px;
    gap: 5px;
    background: #e5f2f2;
    color: #17636a;
    border: 0;
    box-shadow: none;
    font-size: 14px;
}
.focus-home__picture-actions .focus-home__balance strong { display: inline; width: auto; height: auto; background: transparent; font-size: inherit; }
.focus-home__picture-actions .button { margin: 0; border: 1px solid var(--color-primary); background: white; color: var(--color-primary); padding: 10px 16px; font-size: 14px; }
.focus-home__change-mosaic { align-self: center; margin-top: 14px; color: var(--color-primary); font-size: 13px; text-underline-offset: 3px; }
.focus-home__empty-picture { margin-block: auto; }
.focus-home__empty-picture p { color: var(--color-muted); line-height: 1.6; }
.focus-home__steps { display: flex; justify-content: space-around; gap: 16px; padding: 0; margin: 24px 0 0; list-style: none; }
.focus-home__steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.focus-home__steps li span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--color-primary); background: #dcebea; }
@media (max-width: 850px) {
    .focus-home__grid { grid-template-columns: 1fr; }
    .focus-home__timer-card, .focus-home__mosaic-card { min-height: 0; padding: 24px 20px; }
    .focus-home__steps { flex-wrap: wrap; justify-content: center; }
    .focus-home__steps li { font-size: 12px; }
    .focus-home__empty-picture { margin-block: 20px 28px; }
}
