/* ===== Vanilla Sky — Color System ===== */
:root {
    --bg-grad-from:  #fdf6ee;
    --bg-grad-mid:   #f9e8d4;
    --bg-grad-to:    #f2dce8;
    --card:          rgba(255, 248, 236, 0.88);
    --border:        rgba(210, 168, 120, 0.28);
    --border-strong: rgba(210, 168, 120, 0.50);

    --primary:       #e8956d;   /* amber */
    --primary-h:     #f0aa85;
    --secondary:     #b8a0d0;   /* dusty lavender */
    --secondary-h:   #ccb8e4;
    --sage:          #8db89a;   /* sage green */
    --sage-h:        #a3cbaf;
    --gold:          #d4aa60;   /* muted gold */
    --disabled:      #c8b8a8;

    --text:          #3d2814;
    --text-muted:    #9a7060;
    --text-light:    #c4a88a;
    --shadow:        rgba(100, 55, 20, 0.10);
}

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

body {
    min-height: 100vh;
    background: linear-gradient(155deg, var(--bg-grad-from) 0%, var(--bg-grad-mid) 55%, var(--bg-grad-to) 100%);
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    gap: 8px;
}

/* ===== App container ===== */
#app {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== Card base ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
    backdrop-filter: blur(6px);
}

/* ===== Header ===== */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    height: 58px;
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
}

#title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.06em;
}

#weather-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

#weather-temp {
    font-weight: 700;
    color: var(--text);
}

/* ===== Scene (result + destiny) ===== */
#scene {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
    padding: 14px 16px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#scene-hint {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
    word-break: keep-all;
}

#scene-hint b {
    font-weight: 700;
    color: var(--text-muted);
}

#result {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    min-height: 26px;
    word-break: keep-all;
}

#result-meta {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.01em;
    word-break: keep-all;
}

#result-meta:empty { display: none; }

#destiny-report {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    line-height: 1.65;
    min-height: 16px;
    word-break: keep-all;
}

#destiny-source {
    font-size: 10px;
    font-weight: 300;
    color: var(--text-light);
    text-align: center;
    letter-spacing: 0.02em;
    word-break: keep-all;
}

#destiny-source:empty { display: none; }

/* ===== Roulette ===== */
.roulette-container {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

#arrow {
    position: absolute;
    left: 50%;
    top: 3px;
    transform: translateX(-50%);
    z-index: 2;
}

#roulette {
    width: 90%;
    height: 90%;
}

/* ===== Category filter ===== */
#category-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
}

.cat-btn {
    flex: 1;
    min-width: 38px;
    padding: 6px 4px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

.cat-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Buttons wrapper ===== */
.buttons-wrapper {
    display: flex;
    gap: 6px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 2px 14px var(--shadow);
    margin-bottom: 4px;
}

.button-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 76px;
    height: 128px;
}

.view-common {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(61, 40, 20, 0.05);
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px;
}

.ticket-sep {
    font-size: 10px;
    color: var(--text-light);
    margin: 0 1px;
}

/* ===== Control buttons ===== */
#find-restaurants,
#start,
#navigate {
    width: 100%;
    flex: 2;
    border-radius: 12px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#find-restaurants         { background: var(--sage);      color: #fff; }
#find-restaurants:hover:enabled { background: var(--sage-h); }

#start                    { background: var(--primary);   color: #fff; }
#start:hover:enabled      { background: var(--primary-h); }

#navigate                 { background: var(--secondary); color: #fff; }
#navigate:hover:enabled   { background: var(--secondary-h); }

#find-restaurants:disabled,
#start:disabled,
#navigate:disabled {
    background: var(--disabled);
    cursor: not-allowed;
    opacity: 0.65;
}

/* ===== Toast ===== */
#toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(61, 40, 20, 0.88);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Noto Sans KR', sans-serif;
    white-space: normal;
    word-break: keep-all;
    text-align: center;
    max-width: 90vw;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Header right (points + weather) ===== */
#header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

#points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: rgba(212, 170, 96, 0.14);
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#points-badge:hover { background: rgba(212, 170, 96, 0.26); }

/* ===== Verify-visit button ===== */
#verify-visit {
    margin-top: 4px;
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    background: var(--sage);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#verify-visit:hover:enabled { background: var(--sage-h); }

#verify-visit:disabled {
    background: var(--disabled);
    cursor: not-allowed;
    opacity: 0.7;
}

.hidden { display: none !important; }

/* ===== Stamp book modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61, 40, 20, 0.42);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
}

.modal-card {
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: 0 8px 32px var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-points {
    font-size: 13px;
    color: var(--text-muted);
}

.modal-points b { color: var(--gold); font-size: 15px; }

#exchange-ticket {
    padding: 9px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: rgba(232, 149, 109, 0.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

#exchange-ticket:hover:enabled { background: rgba(232, 149, 109, 0.22); }

#exchange-ticket:disabled {
    color: var(--disabled);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.7;
}

#stamp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stamp-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.7;
    padding: 16px 0;
}

.stamp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(61, 40, 20, 0.04);
}

.stamp-dot { color: var(--gold); font-size: 13px; }

.stamp-name {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    word-break: keep-all;
}

.stamp-date {
    font-size: 11px;
    color: var(--text-light);
}

/* ===== Responsive ===== */
@media screen and (min-width: 480px) {
    #title         { font-size: 22px; }
    #result        { font-size: 20px; }
    #destiny-report { font-size: 13px; }
    .button-container { height: 148px; }
    #find-restaurants, #start, #navigate { font-size: 13px; }
}

@media screen and (max-width: 360px) {
    body { padding: 8px 4px; }
    .cat-btn { font-size: 10px; padding: 5px 2px; }
    .button-container { height: 108px; }
    #result { font-size: 16px; }
}

@media screen and (max-width: 280px) {
    .buttons-wrapper { flex-wrap: wrap; }
    .button-container { width: calc(50% - 3px); flex: none; height: 100px; }
}
