/* ═══════════════════════════════════════
   Project Shining Star — Design System
   HUD + Bars + Universe Theme
   ═══════════════════════════════════════ */

/* ── Variables ── */
:root {
    --bg-deep: #090a0f;
    --bg-mid: #1b2735;
    --surface: rgba(255, 255, 255, 0.06);
    --glass: rgba(0, 0, 0, 0.6);
    --glass-light: rgba(255, 255, 255, 0.9);
    --accent-gold: #FFD700;
    --accent-orange: #ff9533;
    --accent-heart: #ff6b9d;
    --accent-blue: #64c8ff;
    --accent-green: #66ffaa;
    --text: #e8e8f0;
    --text-dim: #8888aa;
    --text-dark: #222;
    --tab-h: 60px;
    --hud-h: 110px;
    /* HUD height (top row + bar row) */
    --header-h: 54px;
    --max-w: 420px;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* ── Scrollbar Hide (전역) ── */
*::-webkit-scrollbar {
    display: none !important;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Body & Universe ── */
body {
    font-family: var(--font);
    background: radial-gradient(circle at center bottom, var(--bg-mid) 0%, var(--bg-deep) 100%);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    line-height: 1.5;
}

/* ── View Section (탭 콘텐츠 영역) ── */
.view-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding-top: 70px;
    padding-bottom: 80px;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.view-section::-webkit-scrollbar {
    display: none;
}

/* 홈 탭: HUD 영역 확보 */
#view-home.view-section {
    padding-top: 180px;
}

/* 미션/광장 탭: HUD 없으므로 헤더만큼 */
#view-mission.view-section,
#view-record.view-section {
    padding-top: 70px;
}

/* CSS Stars */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, .6), transparent),
        radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, .5), transparent),
        radial-gradient(1px 1px at 55% 15%, rgba(255, 255, 255, .7), transparent),
        radial-gradient(1px 1px at 70% 45%, rgba(255, 255, 255, .4), transparent),
        radial-gradient(1px 1px at 85% 80%, rgba(255, 255, 255, .6), transparent),
        radial-gradient(1px 1px at 15% 90%, rgba(255, 255, 255, .3), transparent),
        radial-gradient(2px 2px at 20% 75%, rgba(200, 220, 255, .8), transparent),
        radial-gradient(2px 2px at 60% 30%, rgba(255, 220, 180, .6), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, .5), transparent),
        radial-gradient(1px 1px at 45% 50%, rgba(255, 255, 255, .5), transparent);
    pointer-events: none;
    z-index: 0;
    animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: .7
    }

    100% {
        opacity: 1
    }
}

/* ── App Container ── */
#game-app {
    width: 100%;
    max-width: var(--max-w);
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* ══════════════════
   HEADER
   ══════════════════ */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-w);
    height: 60px;
    z-index: 1000;
    background: rgba(27, 39, 53, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.brand-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, .3);
}

.header-tools {
    display: flex;
    gap: 4px;
}

.tool-btn {
    position: relative;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    font-size: 18px;
    padding: 7px 8px;
    cursor: pointer;
    color: var(--text);
    transition: all .15s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, .14);
    transform: scale(1.05);
}

.tool-btn:active {
    transform: scale(.93);
}

/* Mail badge */
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b5c;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(255, 59, 92, .4);
}

/* ══════════════════
   STATUS HUD
   ══════════════════ */
.status-hud {
    position: fixed;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: calc(var(--max-w) - 24px);
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 18px;
    padding: 10px 16px;
    z-index: 999;
    box-shadow: 0 6px 25px rgba(0, 0, 0, .35);
    transition: opacity 0.2s, transform 0.2s;
}

.status-hud.hud-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.hud-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.day-pill,
.level-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
}

.day-pill {
    color: var(--accent-blue);
}

.level-pill {
    color: var(--accent-gold);
}

.name-pill {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 1px 5px rgba(0, 0, 0, .4);
}

.hud-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bar-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.progress-bg {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, .1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width .5s ease;
}

.progress-fill.orange {
    background: linear-gradient(90deg, #ff7b2e, #ffa040);
}

.progress-fill.yellow {
    background: linear-gradient(90deg, #e6c400, var(--accent-gold));
}

.heart-group {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-heart);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 52px;
    text-align: right;
}

/* ══════════════════
   VIEW SECTIONS
   ══════════════════ */
.view-section {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--header-h) + var(--hud-h) + 8px);
    padding-bottom: var(--tab-h);
    overflow-y: auto;
    transition: opacity .25s;
}

.view-section.hidden {
    display: none !important;
}

/* ══════════════════
   STAGE AREA
   ══════════════════ */
.stage-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
}

/* Floating Island */
.floating-island {
    width: 260px;
    height: 80px;
    background: rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow:
        0 0 30px rgba(100, 200, 255, .12),
        0 0 60px rgba(100, 200, 255, .04);
    backdrop-filter: blur(4px);
    animation: float 4s ease-in-out infinite;
    position: absolute;
    bottom: 22%;
    z-index: 1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

/* Pet wrapper */
.pet-wrapper {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: float 4s ease-in-out infinite;
    margin-bottom: -10px;
}

.pet-wrapper img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    transition: filter .5s ease, transform .15s;
    cursor: pointer;
}

.pet-wrapper img:active {
    transform: scale(.92);
}

/* Glow levels */
.glow-lv1 img {
    filter: brightness(.5) saturate(.6);
}

.glow-lv2 img {
    filter: brightness(.75) saturate(.85) drop-shadow(0 0 8px rgba(200, 200, 255, .3));
}

.glow-lv3 img {
    filter: brightness(.95) drop-shadow(0 0 15px rgba(255, 220, 100, .5));
}

.glow-lv4 img {
    filter: brightness(1.1) drop-shadow(0 0 25px gold) drop-shadow(0 0 50px rgba(255, 215, 0, .3));
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        filter: brightness(1.1) drop-shadow(0 0 20px gold);
    }

    50% {
        filter: brightness(1.25) drop-shadow(0 0 40px gold) drop-shadow(0 0 70px rgba(255, 215, 0, .3));
    }
}

/* Effect container (particles) */
#pet-effect-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

/* Speech Bubble */
.speech-bubble {
    position: relative;
    margin-top: 10px;
    background: rgba(255, 255, 255, .92);
    color: #333;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .15);
    white-space: nowrap;
    animation: popIn .3s ease-out;
    z-index: 6;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(255, 255, 255, .92);
}

@keyframes popIn {
    from {
        transform: scale(.5) translateY(8px);
        opacity: 0;
    }

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

/* ══════════════════
   INTERACTION DOCK
   ══════════════════ */
.interaction-dock {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 12px 20px 18px;
    z-index: 10;
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: var(--glass-light);
    color: var(--text-dark);
    border: none;
    border-radius: 18px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all .15s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    min-width: 72px;
}

.dock-btn .emoji {
    font-size: 22px;
    line-height: 1;
}

.dock-btn .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

.dock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.dock-btn:active {
    transform: scale(.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* ══════════════════
   TAB BAR
   ══════════════════ */
#tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-w);
    height: 70px;
    display: flex;
    background: rgba(27, 39, 53, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-family: var(--font);
    font-size: 10px;
    transition: color .2s;
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-weight: 600;
}

.tab-btn.active {
    color: var(--accent-gold);
}

.tab-btn.active .tab-icon {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, .4));
}

/* ══════════════════
   MODALS
   ══════════════════ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #1a1e2e;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    padding: 22px;
    width: 88%;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.close-modal {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dim);
    transition: color .2s;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* ── Buttons ── */
.primary-btn,
.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #f0a500);
    color: #111;
    border: none;
    border-radius: 50px;
    padding: 10px 22px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
    box-shadow: 0 4px 14px rgba(255, 215, 0, .25);
}

.primary-btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 215, 0, .35);
}

.primary-btn:active,
.btn-primary:active {
    transform: scale(.97);
}

.btn-secondary {
    background: rgba(255, 255, 255, .08);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50px;
    padding: 10px 22px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--text);
}

/* ── Inputs ── */
input[type="text"],
input[type="number"],
textarea {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: border-color .2s;
}

input:focus,
textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, .1);
}

/* ══════════════════
   TOAST
   ══════════════════ */
.toast {
    position: fixed;
    bottom: calc(var(--tab-h) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(255, 255, 255, .95);
    color: #222;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: all .35s cubic-bezier(.22, 1, .36, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ══════════════════
   CHATBOT
   ══════════════════ */
.chat-fab {
    position: fixed;
    bottom: calc(var(--tab-h) + 14px);
    right: 14px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 18px rgba(99, 102, 241, .3);
    transition: transform .15s;
}

.chat-fab:hover {
    transform: scale(1.1);
}

.chat-modal-inner {
    width: 100%;
    height: 80vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-row {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    gap: 8px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.message.user {
    align-self: flex-end;
    background: var(--accent-blue);
    color: #111;
    border-bottom-right-radius: 4px;
}

.message.pet {
    align-self: flex-start;
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

/* ══════════════════
   FAB (Write)
   ══════════════════ */
.fab-btn {
    position: fixed;
    bottom: calc(var(--tab-h) + 14px);
    right: 18px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #f0a500);
    color: #111;
    font-size: 22px;
    border: none;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 5px 18px rgba(255, 215, 0, .3);
    transition: transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: scale(1.1);
}

.fab-btn:active {
    transform: scale(.93);
}

/* ══════════════════
   MAIL / ITEMS
   ══════════════════ */
.mail-item {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color .2s;
}

.mail-item:hover {
    border-color: var(--accent-gold);
}

.mail-item__sender {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 13px;
}

.mail-item__date {
    color: var(--text-dim);
    font-size: 11px;
}

.mail-item__message {
    color: var(--text-dim);
    font-size: 13px;
    margin: 6px 0;
}

.mail-item__gift {
    color: var(--text);
    font-size: 14px;
}

.mail-claim-btn {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--accent-gold), #f0a500);
    color: #111;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s;
}

.mail-claim-btn:hover {
    transform: translateY(-2px);
}

.item-card {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.item-card:hover {
    background: rgba(255, 255, 255, .1);
    transform: translateY(-2px);
}

.item-card:active {
    transform: scale(.96);
    border-color: var(--accent-gold);
}

.item-quantity-wrapper {
    margin: 16px 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* ══════════════════
   MISSION
   ══════════════════ */
.mission-container {
    padding: 8px 16px 16px;
}

.mission-card,
.mission-header-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
}

.upload-zone-embedded,
.upload-placeholder {
    background: rgba(255, 255, 255, .04);
    border: 2px dashed rgba(255, 255, 255, .12);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s;
    color: var(--text-dim);
}

.upload-zone-embedded:hover,
.upload-placeholder:hover {
    border-color: var(--accent-gold);
}

.day-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-blue), #4090ff);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ══════════════════
   FEED
   ══════════════════ */
#feed-list {
    padding: 8px 16px 16px;
}

.feed-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.feed-photo {
    width: 100%;
    border-radius: 12px;
    margin-top: 10px;
}

/* ══════════════════
   ANIMATIONS
   ══════════════════ */
@keyframes jump {
    0% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-28px) scaleX(.95);
    }

    50% {
        transform: translateY(-32px) scaleX(.92);
    }

    70% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes squish {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scaleX(1.1) scaleY(.9);
    }

    60% {
        transform: scaleX(.95) scaleY(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(.3);
    }
}

@keyframes heartRise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-55px) scale(.5);
    }
}

.anim-jump {
    animation: jump .5s ease;
}

.anim-squish {
    animation: squish .4s ease;
}

/* Particles */
.heart-particle {
    position: absolute;
    font-size: 18px;
    pointer-events: none;
    animation: heartRise 1s ease-out forwards;
}

.sparkle-particle {
    position: absolute;
    font-size: 14px;
    pointer-events: none;
    animation: sparkle .8s ease-out forwards;
}

/* ══════════════════
   UTILITIES
   ══════════════════ */
.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 20px;
    font-size: 15px;
}

.empty-msg {
    color: var(--text-dim);
    text-align: center;
    padding: 30px 0;
}

/* ══════════════════
   INVENTORY GRID
   ══════════════════ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px 0;
}

.item-slot {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
}

.item-slot:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
}

.item-slot:active {
    transform: scale(.94);
    border-color: var(--accent-gold);
}

.item-emoji {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-count {
    font-size: 11px;
    color: var(--accent-gold);
    font-weight: 700;
}

/* ══════════════════
   MISSION UPLOAD
   ══════════════════ */
.camera-icon {
    font-size: 42px;
    display: block;
    margin-bottom: 8px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-gold), #ffa040);
    border-radius: 4px;
    transition: width 2s ease-in-out;
}

.mission-desc {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 6px;
}

.mission-reward-text {
    color: var(--accent-heart);
    font-size: 14px;
}

#m-preview-img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 8px;
}

#m-submit-btn {
    width: 100%;
    margin-top: 16px;
}

#m-submit-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ══════════════════
   MISSION SECTIONS
   ══════════════════ */
.mission-section {
    margin-bottom: 25px;
}

.mission-section h3 {
    font-size: 18px;
    color: #ffd700;
    margin-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.mission-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s;
}

.mission-card.completed {
    opacity: 0.5;
}

.mission-info {
    flex: 1;
}

.mission-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text);
}

.mission-info p {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #aaa;
}

.mission-reward-tag {
    display: inline-block;
    font-size: 11px;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
}

.mission-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}

.mission-btn:hover:not(:disabled) {
    background: #66BB6A;
    transform: scale(1.03);
}

.mission-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.mission-btn:disabled {
    background: #444;
    color: #777;
    cursor: default;
}

.sub-mission-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.sub-text-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    width: 140px;
}

.sub-text-input::placeholder {
    color: #666;
}

/* ══════════════════
   TOAST MESSAGE
   ══════════════════ */
.toast-msg {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ══════════════════
   SHARE CHECKBOX
   ══════════════════ */
.share-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    margin-bottom: 6px;
}

.share-check-label input[type="checkbox"] {
    accent-color: #ffd700;
    width: 16px;
    height: 16px;
}

/* ══════════════════
   WELCOME MODAL
   ══════════════════ */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.welcome-card {
    background: linear-gradient(135deg, #1b2735, #0f1923);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 32px 28px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.welcome-star {
    font-size: 48px;
    margin-bottom: 12px;
    animation: popIn 0.5s ease-out;
}

.welcome-card h2 {
    color: #ffd700;
    font-size: 22px;
    margin-bottom: 8px;
}

.welcome-card>p {
    color: #8899aa;
    font-size: 13px;
    margin-bottom: 20px;
}

.welcome-field {
    text-align: left;
    margin-bottom: 14px;
}

.welcome-field label {
    display: block;
    font-size: 12px;
    color: #8899aa;
    margin-bottom: 5px;
}

.welcome-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #e0e6ed;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.welcome-field input:focus {
    border-color: #ffd700;
}

.welcome-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.welcome-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.welcome-btn:active {
    transform: scale(0.97);
}

/* ══════════════════
   SETTINGS MODAL
   ══════════════════ */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(6px);
}

.settings-card {
    background: linear-gradient(135deg, #1b2735, #0f1923);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.settings-header h2 {
    font-size: 18px;
    color: var(--text);
}

.settings-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

.settings-profile {
    margin-bottom: 12px;
}

.settings-greeting {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text);
}

.settings-info {
    font-size: 13px;
    color: #8899aa;
    margin-bottom: 4px;
}

.settings-logout-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.settings-logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.5);
}

.settings-logout-btn:active {
    transform: scale(0.97);
}

.settings-note {
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 10px;
}

/* ══════════════════
   FEED (광장) CARDS
   ══════════════════ */
.feed-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.user-badge {
    font-weight: 700;
    font-size: 14px;
    color: #7ec8e3;
}

.feed-time {
    font-size: 12px;
    color: #888;
}

.feed-img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    display: block;
}

.feed-footer {
    padding: 12px 15px;
}

.feed-title {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: var(--text);
}

.btn-like {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-like:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-like.liked {
    border-color: #ff4d6d;
    color: #ff4d6d;
}

.feed-empty {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
    font-size: 15px;
}

/* FAB 버튼 */
.fab-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 26px;
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

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

/* ══════════════════
   TEXT-ONLY FEED CARD (텍스트 메모 스타일)
   ══════════════════ */
.text-only-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ffdde1 100%);
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(252, 182, 159, 0.3);
    position: relative;
}

.text-only-card .text-card-body {
    font-size: 16px;
    font-weight: 600;
    color: #4a3728;
    line-height: 1.6;
    word-break: break-word;
    margin-bottom: 12px;
}

.text-only-card .text-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8b6f5e;
}

.text-only-card .btn-like {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(139, 111, 94, 0.2);
    color: #4a3728;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
}

.text-only-card .btn-like.liked {
    border-color: #ff4d6d;
    color: #ff4d6d;
    background: rgba(255, 77, 109, 0.1);
}

/* ══════════════════
   RESPONSIVE
   ══════════════════ */
@media (min-width: 421px) {
    body {
        background-attachment: fixed;
    }

    #game-app {
        border-left: 1px solid rgba(255, 255, 255, .05);
        border-right: 1px solid rgba(255, 255, 255, .05);
        box-shadow: 0 0 60px rgba(0, 0, 0, .5);
    }
}