:root {
    --bg: #f7f3ec;
    --bg-deep: #eadfcd;
    --paper: rgba(255, 251, 245, 0.94);
    --paper-strong: #fffdf9;
    --text: #1c322b;
    --muted: #728078;
    --line: rgba(87, 103, 91, 0.1);
    --green: #56705f;
    --green-soft: #dde8e0;
    --green-deep: #223730;
    --sand: #b38b5a;
    --sand-soft: #f4e7d7;
    --danger: #b64f45;
    --danger-soft: #f6dfd9;
    --success: #2f6a48;
    --success-soft: #dceddf;
    --shadow: 0 20px 52px rgba(49, 57, 45, 0.08);
    --shadow-soft: 0 10px 22px rgba(49, 57, 45, 0.045);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --font-head: Georgia, "Times New Roman", serif;
    --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    background: linear-gradient(180deg, #f8f4ec 0%, #efe7d9 100%);
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(204, 220, 208, 0.34), transparent 28%),
        radial-gradient(circle at top right, rgba(243, 229, 205, 0.22), transparent 24%),
        radial-gradient(circle at bottom center, rgba(203, 178, 139, 0.1), transparent 28%),
        linear-gradient(180deg, #faf7f0 0%, #f3ecdf 54%, #ebe1d0 100%);
}

body.app-main-mode {
    height: 100vh;
    overflow: hidden;
}

button,
input,
textarea,
iframe {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: var(--green-deep);
}

.app-shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.screen {
    min-height: 100vh;
    display: none;
}

.screen.is-active {
    display: block;
}

.mobile-frame {
    width: min(100%, 460px);
    margin: 0 auto;
    min-height: 100vh;
    padding: 24px 18px calc(110px + env(safe-area-inset-bottom));
    position: relative;
}

.app-screen {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.splash-screen {
    position: relative;
    color: #f8f5ef;
    background:
        radial-gradient(circle at top, rgba(255, 249, 236, 0.14), transparent 30%),
        linear-gradient(180deg, #6a7a69 0%, #405447 100%);
}

.splash-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%),
        linear-gradient(0deg, rgba(17, 31, 25, 0.58), transparent 34%);
}

.splash-screen::before {
    content: "";
    position: absolute;
    inset: max(18px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(16, 31, 27, 0.06), rgba(16, 31, 27, 0.14)),
        url("gfx/splash.jpg") center center / contain no-repeat,
        linear-gradient(180deg, rgba(214, 222, 208, 0.35), rgba(80, 98, 84, 0.42));
    box-shadow: 0 24px 70px rgba(18, 30, 25, 0.2);
}

.splash-backdrop,
.splash-mist {
    position: absolute;
    pointer-events: none;
}

.splash-backdrop {
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 244, 226, 0.12), transparent 24%),
        radial-gradient(circle at 20% 75%, rgba(225, 237, 223, 0.16), transparent 30%),
        radial-gradient(circle at 80% 18%, rgba(247, 235, 213, 0.18), transparent 26%);
}

.splash-mist {
    width: 70vw;
    max-width: 330px;
    height: 70vw;
    max-height: 330px;
    border-radius: 999px;
    background: rgba(246, 244, 236, 0.12);
    filter: blur(14px);
}

.splash-mist-left {
    left: -14%;
    bottom: 18%;
}

.splash-mist-right {
    right: -18%;
    top: 12%;
}

.splash-content,
.splash-footer {
    position: relative;
    z-index: 1;
}

.splash-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 72px 34px 128px;
    max-width: 540px;
    margin: 0 auto;
}

.splash-content-visual {
    padding: 0;
    max-width: none;
}

.splash-mark {
    width: 92px;
    height: 92px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-family: var(--font-head);
    font-size: 2rem;
    color: var(--paper-strong);
    background: linear-gradient(180deg, rgba(222, 235, 218, 0.34), rgba(133, 170, 145, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(248, 245, 239, 0.75);
}

.top-panel .eyebrow,
.app-header .eyebrow {
    color: var(--green);
}

.splash-content h1,
.top-panel h2,
.app-header h2,
.hero-card h3,
.section-head h3,
.reward-card h3,
.detail-head h3 {
    font-family: var(--font-head);
}

.splash-content h1 {
    margin: 0;
    font-size: clamp(2.5rem, 12vw, 4.2rem);
    line-height: 0.96;
}

.splash-subtitle {
    max-width: 280px;
    margin: 18px 0 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(248, 245, 239, 0.86);
}

.splash-footer {
    position: absolute;
    left: 50%;
    bottom: calc(26px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100% - 64px), 500px);
    text-align: center;
    font-size: 0.92rem;
    color: rgba(248, 245, 239, 0.76);
}

.splash-screen.fade-out {
    animation: splashFadeOut 0.55s ease forwards;
}

.splash-screen .splash-mark,
.splash-screen .splash-subtitle,
.splash-screen .splash-footer,
.splash-screen h1,
.splash-screen .eyebrow {
    display: none;
}

@keyframes splashFadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: scale(1.01); }
}

.top-panel {
    padding-top: max(8px, env(safe-area-inset-top));
}

.top-panel h2,
.app-header h2 {
    margin: 0;
    font-size: 1.32rem;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.lead,
.muted,
.notice-card p,
.reward-description,
.detail-description {
    color: var(--muted);
}

.lead {
    margin: 14px 0 0;
    line-height: 1.65;
}

.card,
.hero-card,
.detail-card,
.summary-card,
.reward-card,
.place-card,
.state-box {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,252,247,0.94)),
        var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.card,
.hero-card,
.detail-card,
.reward-card,
.state-box {
    border-radius: var(--radius-lg);
}

.card,
.reward-card,
.state-box {
    padding: 20px;
}

.card-tight {
    padding: 18px 20px;
}

.notice-card {
    margin-top: 18px;
}

.notice-card p {
    line-height: 1.28;
    margin-bottom: 8px;
}

.notice-title,
.card-label {
    margin: 0 0 6px;
    color: var(--green);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.rules-card {
    margin-top: 18px;
    padding-bottom: 16px;
}

.rules-header,
.section-head,
.reward-head,
.place-title-row,
.detail-head,
.app-header,
.hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.rules-header h3,
.section-head h3,
.hero-card h3,
.reward-card h3 {
    margin: 0;
    font-size: 1.3rem;
}

.ghost-link {
    align-self: center;
    color: var(--green);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.rules-frame-wrap {
    margin-top: 16px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.rules-frame {
    width: 100%;
    height: 45vh;
    min-height: 360px;
    display: block;
    border: 0;
    background: #fffdfa;
}

.terms-actions {
    position: sticky;
    bottom: calc(14px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 18px;
}

.btn {
    min-height: 54px;
    border-radius: 999px;
    padding: 0 22px;
    font-weight: 700;
    font-size: 0.98rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #f6f7f4;
    background: linear-gradient(180deg, #516a58 0%, #3d5647 100%);
    box-shadow: 0 18px 36px rgba(61, 86, 71, 0.22);
}

.btn-secondary {
    color: var(--green-deep);
    background: rgba(255, 252, 247, 0.85);
    border: 1px solid var(--line);
}

.btn-large {
    width: 100%;
    margin-top: 22px;
}

.btn-small {
    min-height: 44px;
    padding: 0 18px;
    font-size: 0.92rem;
}

.btn[disabled] {
    cursor: default;
    opacity: 0.55;
    box-shadow: none;
}

.app-frame {
    height: 100dvh;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    overflow: hidden;
}

.app-header {
    position: relative;
    z-index: 2;
    padding: 2px 0 12px;
}

.app-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: linear-gradient(90deg, rgba(76,102,85,0.12), rgba(76,102,85,0));
}

.app-header > div {
    max-width: 72%;
}

.header-chip,
.hero-pill,
.status-badge,
.reward-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.header-chip {
    background: rgba(255, 252, 247, 0.78);
    border: 1px solid rgba(255,255,255,0.82);
    color: var(--green-deep);
    box-shadow: var(--shadow-soft);
    padding: 0 18px;
    letter-spacing: -0.02em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.header-chip:hover,
.header-chip:active {
    background: rgba(255, 253, 249, 0.95);
    transform: translateY(1px);
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.content-stack::-webkit-scrollbar {
    width: 8px;
}

.content-stack::-webkit-scrollbar-thumb {
    background: rgba(73, 99, 80, 0.22);
    border-radius: 999px;
}

.view {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.view.is-active {
    display: flex;
}

#view-progress {
    position: relative;
    overflow: hidden;
    flex-direction: column;
    padding: 22px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.3), transparent 20%),
        radial-gradient(circle at 12% 88%, rgba(213, 231, 217, 0.22), transparent 24%),
        linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(241, 246, 239, 0.94)),
        var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 24px rgba(49, 57, 45, 0.04);
}

#view-progress::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, #6d8c78 0%, #9db39b 56%, rgba(157, 179, 155, 0.18) 100%);
}

#view-progress > * {
    position: relative;
    z-index: 1;
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 24px 22px 22px;
    gap: 22px;
    flex-direction: column;
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.48), transparent 20%),
        radial-gradient(circle at 12% 88%, rgba(213, 231, 217, 0.36), transparent 26%),
        radial-gradient(circle at top right, rgba(213, 231, 217, 0.56), transparent 28%),
        linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(236, 244, 236, 0.94)),
        var(--paper);
    box-shadow: 0 12px 24px rgba(49, 57, 45, 0.045);
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, #6d8c78 0%, #9db39b 56%, rgba(157, 179, 155, 0.18) 100%);
}

.hero-card h3 {
    max-width: none;
    width: 100%;
    font-size: 1.14rem;
    line-height: 0.98;
    letter-spacing: -0.04em;
    white-space: nowrap;
    text-wrap: nowrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: 12px;
    width: 100%;
    min-width: 0;
    align-self: stretch;
    align-content: start;
}

.hero-pill,
.status-badge {
    background: rgba(73, 99, 80, 0.09);
    color: var(--green-deep);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.hero-pill {
    min-height: 54px;
    padding: 9px 16px;
    justify-content: center;
    background: linear-gradient(180deg, rgba(233, 241, 234, 0.94), rgba(223, 233, 223, 0.92));
    border: 1px solid rgba(255,255,255,0.7);
    font-size: 0.92rem;
    text-align: center;
}

.hero-pill strong {
    font-size: 1.72rem;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-right: 4px;
}

.status-badge.is-done {
    background: var(--success-soft);
    color: var(--success);
}

.status-badge.is-waiting {
    background: rgba(236, 222, 199, 0.88);
    color: #8a693f;
}

.places-list,
.rewards-list,
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.place-card {
    position: relative;
    display: block;
    padding: 15px 16px 15px;
    border-radius: 30px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(49, 57, 45, 0.04);
}

.place-card:hover {
    border-color: rgba(95, 120, 103, 0.18);
}

.place-card:active {
    transform: scale(0.992);
}

.place-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.place-title-row {
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    padding-top: 0;
    flex-wrap: nowrap;
}

.place-card h3 {
    margin: 0;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.18rem;
    line-height: 1.06;
    letter-spacing: -0.04em;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: clip;
    text-wrap: balance;
}

.place-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.62;
    font-size: 0.96rem;
    max-width: 31ch;
}

.place-hint {
    display: none;
}

.place-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px 8px;
    margin-top: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
}

.place-meta::-webkit-scrollbar {
    display: none;
}

.place-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0;
    border-radius: 0;
    color: var(--green);
    font-weight: 800;
    font-size: 0.84rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    white-space: nowrap;
    flex: 0 0 auto;
}

.place-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: rgba(112, 128, 119, 0.76);
    font-weight: 600;
}

.detail-card {
    overflow: hidden;
    position: relative;
    border-radius: 30px;
    box-shadow: 0 8px 18px rgba(49, 57, 45, 0.03);
}

.place-details-link {
    font-style: italic;
    font-weight: 600 !important;
    color: var(--muted) !important;
}

.detail-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 120px;
    background:
        radial-gradient(circle at 85% 18%, rgba(239, 225, 198, 0.34), transparent 18%),
        linear-gradient(180deg, rgba(239, 246, 240, 0.66), rgba(255, 252, 247, 0));
    pointer-events: none;
}

.detail-body {
    padding: 22px;
    position: relative;
    z-index: 1;
}

.detail-body::before {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7b9b86, rgba(123, 155, 134, 0.16));
    margin-bottom: 18px;
}

.detail-head {
    align-items: flex-start;
    gap: 10px;
}

.detail-head > div {
    max-width: 72%;
    flex: 1 1 auto;
    min-width: 0;
}

.detail-head h3 {
    margin: 0;
    font-size: 1.32rem;
    line-height: 0.96;
    letter-spacing: -0.05em;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: block;
    text-wrap: balance;
    word-break: normal;
}

.detail-points {
    margin: 12px 0 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--green);
}

.detail-description {
    margin: 12px 0 0;
    line-height: 1.64;
    font-size: 0.96rem;
    max-width: 32ch;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.meta-box {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(246, 248, 242, 0.96), rgba(237, 242, 232, 0.92));
    border: 1px solid rgba(255,255,255,0.88);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
}

.meta-box span {
    display: block;
    margin-bottom: 7px;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.meta-box strong {
    font-size: 1.04rem;
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.feedback-box {
    margin-top: 16px;
    padding: 14px 15px;
    border-radius: 22px;
    line-height: 1.55;
    font-size: 0.94rem;
    border: 1px solid rgba(255,255,255,0.48);
}

.feedback-box.is-success {
    background: var(--success-soft);
    color: var(--success);
}

.feedback-box.is-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.progress-summary {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 136px;
    padding: 18px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.34), transparent 20%),
        radial-gradient(circle at 12% 88%, rgba(213, 231, 217, 0.24), transparent 24%),
        linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(236, 244, 236, 0.94)),
        var(--paper);
    box-shadow: 0 12px 24px rgba(49, 57, 45, 0.04);
}

.summary-card::before,
.progress-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, #6d8c78 0%, #9db39b 56%, rgba(157, 179, 155, 0.18) 100%);
}

.summary-card strong {
    font-size: 2.35rem;
    line-height: 1;
    margin: 8px 0 6px;
    font-family: var(--font-head);
    letter-spacing: -0.04em;
}

.summary-card span {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.45;
}

.summary-card-main {
    background:
        radial-gradient(circle at top right, rgba(213, 231, 217, 0.56), transparent 28%),
        linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(232, 241, 233, 0.92)),
        var(--paper);
}

.summary-card-secondary {
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.3), transparent 20%),
        radial-gradient(circle at 12% 88%, rgba(213, 231, 217, 0.2), transparent 24%),
        linear-gradient(135deg, rgba(255, 251, 245, 0.96), rgba(243, 247, 240, 0.94)),
        var(--paper);
}

.progress-card {
    position: relative;
    overflow: hidden;
    padding: 22px 22px 20px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.3), transparent 20%),
        radial-gradient(circle at 12% 88%, rgba(213, 231, 217, 0.22), transparent 24%),
        linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(241, 246, 239, 0.94)),
        var(--paper);
    box-shadow: 0 12px 24px rgba(49, 57, 45, 0.04);
}

.progress-card .section-head,
.progress-card .recent-list,
.progress-card .muted {
    position: relative;
    z-index: 1;
}

#view-progress .progress-summary {
    order: 2;
    margin-top: 18px;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: 12px;
}

#view-progress .summary-card {
    min-height: 54px !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(233, 241, 234, 0.94), rgba(223, 233, 223, 0.92)) !important;
    border: 1px solid rgba(255,255,255,0.7) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5) !important;
}

#view-progress .card.progress-card.progress-card-history {
    order: 1;
    padding: 18px 0 0;
    background: transparent;
    border: 0;
    border-top: 0;
    border-radius: 0;
    box-shadow: none;
}

#view-progress .card.progress-card.progress-card-history::before {
    display: none;
}

#view-progress .progress-history,
#view-progress .card.progress-card.progress-card-history {
    padding-top: 0;
}

#view-progress .summary-card::before {
    display: none;
}

#view-progress .summary-card .card-label {
    margin: 0;
    color: var(--green-deep);
    font-size: 0.92rem;
    letter-spacing: -0.02em;
    text-transform: none;
}

#view-progress .summary-card strong {
    margin: 0;
    font-size: 1.72rem;
    line-height: 1;
    color: var(--green-deep);
}

#view-progress .summary-card span {
    display: none;
}

.progress-card-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.progress-history {
    position: relative;
    z-index: 1;
    padding-top: 18px;
    border-top: 1px solid rgba(87, 103, 91, 0.08);
}

.recent-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.recent-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.recent-item strong {
    display: block;
    margin-bottom: 4px;
}

.recent-item span {
    color: var(--muted);
    font-size: 0.92rem;
}

.reward-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
}

.reward-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, #c79a63 0%, rgba(199, 154, 99, 0.18) 100%);
}

.reward-cost {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f3e6d2, #edd9bc);
    color: #72522a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.reward-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reward-state {
    min-height: 42px;
    background: rgba(73, 99, 80, 0.08);
    color: var(--green);
}

.reward-state.is-locked {
    background: rgba(205, 169, 119, 0.2);
    color: #7a5a2f;
}

.reward-claim-box {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(73, 99, 80, 0.08), rgba(73, 99, 80, 0.04));
}

.reward-code {
    display: inline-flex;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 252, 247, 0.92);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.reward-place-card {
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.18), transparent 18%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 249, 244, 0.96));
}

.reward-inline-description {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.94rem;
}

.reward-meta {
    margin-top: 10px;
}

.reward-inline-action {
    margin-top: 12px;
    align-self: flex-start;
}

.reward-inline-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(73, 99, 80, 0.08), rgba(73, 99, 80, 0.04));
}

.state-box {
    text-align: center;
}

.state-box-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.state-box-success {
    background: var(--success-soft);
    color: var(--success);
}

.loading-dots {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 10px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--green);
    animation: pulse 1.1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.34; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    background: transparent;
    color: var(--green);
    font-weight: 700;
    text-align: left;
    padding: 6px 0 10px;
    font-size: 0.96rem;
}

.back-link::before {
    content: "←";
    display: inline-block;
    color: var(--sand);
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(calc(100% - 20px), 418px);
    z-index: 12;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    margin-top: 0;
    background: linear-gradient(180deg, rgba(251, 248, 242, 0.94), rgba(245, 240, 231, 0.99));
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.9);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 24px rgba(48, 57, 45, 0.075);
}

.bottom-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 30px 30px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0));
    pointer-events: none;
}

.nav-item {
    min-height: 62px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255, 252, 247, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.84);
    color: var(--muted);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(56, 66, 52, 0.05);
    padding: 7px 6px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item.is-active {
    background: linear-gradient(180deg, rgba(239, 247, 240, 0.98), rgba(225, 236, 227, 0.98));
    color: var(--green-deep);
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(76, 102, 85, 0.1);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(73, 99, 80, 0.08);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.is-hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .app-header > div {
        max-width: 58%;
    }

    .app-header h2 {
        font-size: 1.32rem;
        line-height: 0.98;
        letter-spacing: -0.045em;
        white-space: nowrap;
    }

    .eyebrow {
        margin-bottom: 8px;
        font-size: 0.72rem;
        letter-spacing: 0.16em;
    }

    .header-chip {
        min-height: 44px;
        padding: 0 14px;
        font-size: 0.84rem;
    }

    .hero-card {
        padding: 18px 17px 17px;
        gap: 14px;
        box-shadow: 0 8px 16px rgba(49, 57, 45, 0.035);
    }

    #view-progress {
        padding: 18px 17px 17px;
        border-radius: 24px;
    }

    #view-progress .progress-summary {
        margin-top: 12px;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
        gap: 10px;
    }

    #view-progress .summary-card {
        min-height: 46px !important;
        padding: 8px 13px !important;
        gap: 7px;
    }

    #view-progress .summary-card .card-label {
        font-size: 0.8rem;
    }

    #view-progress .summary-card strong {
        font-size: 1.36rem;
    }

    .hero-card h3 {
        max-width: none;
        font-size: 1.02rem;
        line-height: 1.02;
        letter-spacing: -0.03em;
        white-space: nowrap;
    }

    .hero-card .muted {
        font-size: 0.88rem;
        line-height: 1.52;
    }

    .hero-stats {
        min-width: 100%;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
        gap: 10px;
    }

    .hero-pill {
        min-height: 46px;
        padding: 8px 13px;
        font-size: 0.8rem;
    }

    .hero-pill strong {
        font-size: 1.36rem;
    }

    .place-card {
        padding: 12px 13px 13px;
        border-radius: 26px;
        box-shadow: 0 8px 16px rgba(49, 57, 45, 0.032);
    }

    .place-title-row {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 4px;
        padding-top: 0;
    }

    .place-title-row .status-badge {
        margin-top: 0;
    }

    .place-card h3 {
        max-width: none;
        font-size: 0.92rem;
        line-height: 1.08;
    }

    .status-badge {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.66rem;
        flex: 0 0 auto;
    }

    .place-description {
        max-width: none;
        font-size: 0.82rem;
        line-height: 1.48;
    }

    .place-meta {
        margin-top: 2px;
        gap: 5px 7px;
    }

    .place-meta span {
        font-size: 0.62rem;
        letter-spacing: -0.01em;
    }

    .place-meta span:not(:last-child)::after {
        margin-left: 7px;
    }

    .detail-body {
        padding: 16px;
    }

    .detail-card {
        box-shadow: 0 6px 12px rgba(49, 57, 45, 0.022);
    }

    .back-link {
        padding: 2px 0 8px;
        font-size: 0.86rem;
    }

    .detail-head {
        align-items: flex-start;
        gap: 8px;
    }

    .detail-head > div {
        max-width: 68%;
    }

    .detail-head h3 {
        font-size: 1.32rem;
        line-height: 0.96;
    }

    .detail-points {
        margin-top: 10px;
        font-size: 0.88rem;
    }

    .detail-description {
        font-size: 0.82rem;
        line-height: 1.5;
        max-width: none;
    }

    .meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin-top: 16px;
    }

    .meta-box {
        padding: 9px;
        border-radius: 14px;
    }

    .meta-box span {
        margin-bottom: 4px;
        font-size: 0.56rem;
        letter-spacing: 0.08em;
    }

    .meta-box strong {
        font-size: 0.7rem;
        line-height: 1.18;
    }

    .feedback-box {
        padding: 12px 13px;
        border-radius: 18px;
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .btn-large {
        min-height: 50px;
        margin-top: 14px;
        font-size: 0.88rem;
    }

    .progress-summary {
        gap: 10px;
    }

    .summary-card {
        min-height: 108px;
        padding: 15px;
        border-radius: 20px;
    }

    .summary-card::before,
    .progress-card::before {
        width: 6px;
    }

    .summary-card strong {
        font-size: 1.86rem;
        margin: 6px 0 4px;
    }

    .summary-card span {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .progress-card {
        padding: 18px 17px 17px;
        border-radius: 24px;
    }

    .progress-card-shell {
        gap: 14px;
    }

    .progress-history {
        padding-top: 14px;
    }

    .bottom-nav {
        width: min(calc(100% - 16px), 408px);
        gap: 8px;
        padding: 9px 9px calc(9px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
    }

    .nav-item {
        min-height: 56px;
        border-radius: 18px;
        font-size: 0.74rem;
    }

    .nav-icon {
        min-width: 27px;
        height: 27px;
        font-size: 0.68rem;
    }
}

@media (max-width: 390px) {
    .mobile-frame {
        padding-left: 14px;
        padding-right: 14px;
    }

    .splash-screen::before {
        inset: max(12px, env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom));
        border-radius: 26px;
    }

    .splash-content {
        padding-left: 22px;
        padding-right: 22px;
    }

    .progress-summary {
        grid-template-columns: 1fr;
    }

    .rules-header,
    .hero-card,
    .reward-head,
    .reward-footer {
        flex-direction: column;
    }

    .place-description {
        max-width: none;
    }

    .app-header h2 {
        font-size: 1.32rem;
    }

    .hero-card h3 {
        font-size: 0.94rem;
    }

    .place-card h3 {
        font-size: 0.92rem;
    }

    .summary-card {
        min-height: 98px;
        padding: 14px;
    }

    .summary-card strong {
        font-size: 1.68rem;
    }

    .summary-card span {
        font-size: 0.76rem;
    }

    .place-meta span {
        font-size: 0.58rem;
    }

    .detail-head h3 {
        font-size: 1.32rem;
    }

    .detail-head > div {
        max-width: 68%;
    }

    .meta-box strong {
        font-size: 0.64rem;
    }

.terms-actions {
        grid-template-columns: 1fr;
    }
}

#view-progress {
    flex-direction: column;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

#view-progress::before {
    display: none;
}

#view-progress > * {
    position: static;
    z-index: auto;
}

.progress-hero-card {
    margin: 0;
}

.progress-hero-stats {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.rewards-hero-stats {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.progress-pill {
    justify-content: center;
}

.rewards-pill {
    justify-content: center;
}

.progress-pill strong {
    margin-right: 4px;
}

.rewards-pill strong {
    margin-right: 4px;
}

#recentPlacesList {
    gap: 12px;
}

#recentPlacesList .progress-place-card {
    background:
        radial-gradient(circle at 82% 18%, rgba(245, 228, 198, 0.18), transparent 18%),
        linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 249, 244, 0.96));
}

#recentPlacesList .progress-place-card .place-title-row {
    margin-bottom: 2px;
}

#recentPlacesList .progress-place-card .place-meta {
    margin-top: 0;
}

#recentPlacesList .progress-place-card .place-date,
#recentPlacesList .progress-place-card .place-details-link {
    color: var(--muted) !important;
    font-weight: 600;
}

@media (max-width: 640px) {
    #view-progress {
        gap: 10px;
    }

    #recentPlacesList {
        gap: 10px;
    }
}
