/* NEO九龍城砦 ～AI迷宮診断～ - Design System */

:root {
    /* Default theme (jade) - overridden by [data-theme] */
    --neon-pink: #00ff88;
    --neon-cyan: #00ff88;
    --neon-yellow: #ffd700;
    --neon-purple: #00cc6a;
    --neon-orange: #ffd700;
    --bg-dark: #080d14;
    --bg-deeper: #050a0f;
    --bg-card: rgba(8, 20, 16, 0.92);
    --surface: #0a1a14;
    --surface-light: #1a2a24;
    --surface-lighter: #2a3a34;
    --text-primary: #c8f0d8;
    --text-secondary: #80b098;
    --text-muted: #507060;
    --neon-primary: #00ff88;
    --neon-accent: #ffd700;
    --gradient-neon: linear-gradient(135deg, var(--neon-primary), var(--neon-accent));
    --gradient-warm: linear-gradient(135deg, var(--neon-accent), var(--neon-primary));
    --glow-pink: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-purple: 0 0 20px rgba(255, 215, 0, 0.4);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
}

/* === Theme: Jade Neon (翡翠ネオン) === */
[data-theme="jade"] {
    --neon-pink: #00ff88;
    --neon-cyan: #00ff88;
    --neon-yellow: #ffd700;
    --neon-purple: #00cc6a;
    --neon-orange: #ffd700;
    --bg-dark: #080d14;
    --bg-deeper: #050a0f;
    --bg-card: rgba(8, 20, 16, 0.92);
    --surface: #0a1a14;
    --surface-light: #1a2a24;
    --surface-lighter: #2a3a34;
    --text-primary: #c8f0d8;
    --text-secondary: #80b098;
    --text-muted: #507060;
    --neon-primary: #00ff88;
    --neon-accent: #ffd700;
    --gradient-neon: linear-gradient(135deg, #00ff88, #ffd700);
    --gradient-warm: linear-gradient(135deg, #ffd700, #00ff88);
    --glow-pink: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 255, 136, 0.4);
    --glow-purple: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* === Theme: Amber Circuit (琥珀回路) === */
[data-theme="amber"] {
    --neon-pink: #ffaa00;
    --neon-cyan: #00c8b4;
    --neon-yellow: #ffaa00;
    --neon-purple: #cc8800;
    --neon-orange: #ffaa00;
    --bg-dark: #0f0e0c;
    --bg-deeper: #0a0908;
    --bg-card: rgba(20, 16, 10, 0.92);
    --surface: #1a1610;
    --surface-light: #2a2620;
    --surface-lighter: #3a3630;
    --text-primary: #f0e6d0;
    --text-secondary: #b0a080;
    --text-muted: #706850;
    --neon-primary: #ffaa00;
    --neon-accent: #00c8b4;
    --gradient-neon: linear-gradient(135deg, #ffaa00, #00c8b4);
    --gradient-warm: linear-gradient(135deg, #ffaa00, #ff7700);
    --glow-pink: 0 0 20px rgba(255, 170, 0, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 200, 180, 0.4);
    --glow-purple: 0 0 20px rgba(255, 170, 0, 0.4);
}

/* === Theme: Red Lantern (紅燈) === */
[data-theme="red"] {
    --neon-pink: #ff3344;
    --neon-cyan: #ff6655;
    --neon-yellow: #ffe4b5;
    --neon-purple: #cc2233;
    --neon-orange: #ff3344;
    --bg-dark: #0a0608;
    --bg-deeper: #080406;
    --bg-card: rgba(20, 10, 12, 0.92);
    --surface: #1a0a0e;
    --surface-light: #2a1a1e;
    --surface-lighter: #3a2a2e;
    --text-primary: #f0d0d0;
    --text-secondary: #b08080;
    --text-muted: #705050;
    --neon-primary: #ff3344;
    --neon-accent: #ffe4b5;
    --gradient-neon: linear-gradient(135deg, #ff3344, #ffe4b5);
    --gradient-warm: linear-gradient(135deg, #ff3344, #ff6644);
    --glow-pink: 0 0 20px rgba(255, 51, 68, 0.4);
    --glow-cyan: 0 0 20px rgba(255, 228, 181, 0.3);
    --glow-purple: 0 0 20px rgba(255, 51, 68, 0.4);
}

/* === Theme: Electric Teal (電光碧) === */
[data-theme="teal"] {
    --neon-pink: #00e5ff;
    --neon-cyan: #00e5ff;
    --neon-yellow: #ff6b6b;
    --neon-purple: #00b8cc;
    --neon-orange: #ff6b6b;
    --bg-dark: #060a12;
    --bg-deeper: #040810;
    --bg-card: rgba(10, 16, 24, 0.92);
    --surface: #0a1420;
    --surface-light: #1a2430;
    --surface-lighter: #2a3440;
    --text-primary: #e0eef0;
    --text-secondary: #80a0b0;
    --text-muted: #506070;
    --neon-primary: #00e5ff;
    --neon-accent: #ff6b6b;
    --gradient-neon: linear-gradient(135deg, #00e5ff, #ff6b6b);
    --gradient-warm: linear-gradient(135deg, #ff6b6b, #00e5ff);
    --glow-pink: 0 0 20px rgba(0, 229, 255, 0.4);
    --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.4);
    --glow-purple: 0 0 20px rgba(255, 107, 107, 0.4);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
    background: var(--bg-deeper);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none !important;
}

.neon-text {
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(168, 85, 247, 0.35);
}

/* ========================================
   Screen System
   ======================================== */

.screen {
    display: none;
    animation: screenFadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   TITLE SCREEN
   ======================================== */

.title-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(78, 205, 196, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 107, 157, 0.1) 0%, transparent 50%),
        var(--bg-deeper);
}

.title-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.title-content {
    text-align: center;
    z-index: 1;
    padding: 2rem;
}

.title-logo-wrap {
    margin-bottom: 2.5rem;
}

.title-emoji-img {
    width: 192px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 0 20px rgba(255, 140, 40, 0.5));
    border-radius: 8px;
}

.btn-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
    border-radius: 3px;
    margin-right: 0.1em;
}

@keyframes titleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.title-main {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    background: var(--gradient-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-shadow: none;
    filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.3));
}

.title-sub {
    font-size: clamp(1rem, 3vw, 1.8rem);
    color: var(--neon-cyan);
    font-weight: 400;
    letter-spacing: 0.3em;
    margin-top: 0.5rem;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.title-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 2;
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.start-btn {
    position: relative;
    display: inline-block;
    padding: 1.2rem 4rem;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(255, 107, 157, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 40px rgba(255, 107, 157, 0.5);
}

.start-btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: btnShimmer 2.5s infinite;
}

@keyframes btnShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.title-hint {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.arch-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    text-decoration: none;
    transition: all 0.2s;
}

.arch-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   TRAVELER CREATION SCREEN
   ======================================== */

.traveler-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    text-align: center;
}

.section-desc {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.traveler-input-wrap {
    margin-bottom: 1.5rem;
}

.traveler-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--surface);
    border: 2px solid var(--surface-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    transition: all 0.3s ease;
    line-height: 1.6;
}

.traveler-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.traveler-input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.traveler-examples {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.example-chip {
    padding: 0.5rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.example-chip:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    transform: translateY(-2px);
}

.generate-traveler-btn {
    display: block;
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.generate-traveler-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-pink);
}

/* Traveler Result */
.traveler-result {
    text-align: center;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.traveler-avatar {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: titleFloat 3s ease-in-out infinite;
}

.traveler-name {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

.traveler-title {
    color: var(--neon-cyan);
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.traveler-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.traveler-detail {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
}

.detail-label {
    color: var(--neon-yellow);
    font-weight: 700;
    white-space: nowrap;
    min-width: 5rem;
}

.detail-value {
    color: var(--text-secondary);
}

.traveler-greeting {
    font-size: 1.1rem;
    color: var(--neon-pink);
    font-style: italic;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 107, 157, 0.08);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--neon-pink);
}

.embark-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--neon-cyan), #3ba3a0);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
}

.embark-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(78, 205, 196, 0.5);
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
        var(--bg-deeper);
}

.loading-animation {
    text-align: center;
}

.loading-icon {
    font-size: 4.5rem;
    animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.15) rotate(5deg);
    }
}

.loading-text {
    font-size: 1.6rem;
    color: var(--neon-cyan);
    margin: 1.5rem 0;
    font-weight: 700;
}

.loading-bar {
    width: 320px;
    height: 6px;
    background: var(--surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--gradient-neon);
    transition: width 0.5s ease;
    border-radius: var(--radius-full);
}

.loading-status {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 1.3rem;
}

/* ========================================
   ERROR SCREEN
   ======================================== */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 60, 60, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 70%, rgba(255, 150, 50, 0.05) 0%, transparent 50%),
        var(--bg-deeper);
    padding: 2rem;
}

.error-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: 3rem 2rem;
    animation: errorSlideIn 0.5s ease-out;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.error-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neon-yellow);
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.error-message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.error-return-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    border: none;
    border-radius: var(--radius-full);
    color: var(--bg-dark);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.error-return-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5);
}

/* ========================================
   COMMUNITY MAP SCREEN
   ======================================== */

.map-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.map-back-btn {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.map-back-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.map-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.map-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.map-viewport {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--surface-light);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.map-image {
    width: 100%;
    display: block;
}

.map-pins {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-pin {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    transform: translate(-50%, -100%);
    transition: transform 0.2s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-pin:hover {
    transform: translate(-50%, -100%) scale(1.15);
    z-index: 10;
}

.map-pin-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
    display: block;
    line-height: 1;
    color: #e53e3e;
}

.map-pin-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    border: 1px solid rgba(229, 62, 62, 0.5);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pinDrop {
    0% {
        opacity: 0;
        transform: translate(-50%, -300%);
    }

    60% {
        transform: translate(-50%, -90%);
    }

    80% {
        transform: translate(-50%, -105%);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

.map-pin.animated {
    animation: pinDrop 0.5s ease-out forwards;
}

/* Preset shop pins (gold/amber) */
.map-pin-preset .map-pin-icon {
    color: #d4a017;
    font-size: 1.2rem;
}

.map-pin-preset .map-pin-label {
    border-color: rgba(212, 160, 23, 0.5);
    color: #ffe082;
}

/* Created shop pins (red) */
.map-pin-created .map-pin-icon {
    color: #e53e3e;
}

.map-pin-created .map-pin-label {
    border-color: rgba(229, 62, 62, 0.5);
}

.map-empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 1rem;
}

/* Map Button (Title Screen) */
.map-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-btn:hover {
    background: var(--surface);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

/* Register Button (Result Screen) */
.register-map-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-dark);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
}

.register-map-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(78, 205, 196, 0.5);
}

.register-map-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   SHOP DETAIL MODAL
   ======================================== */

.shop-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    padding: 1.5rem;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.shop-modal {
    max-width: 480px;
    width: 100%;
    padding: 1.5rem;
    position: relative;
    margin: 2rem auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
}

/* Modal Images */
.modal-shop-image-wrap,
.modal-keeper-image-wrap {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
}

.modal-shop-image,
.modal-keeper-image {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

.modal-image-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 2.5rem;
}

.modal-header {
    text-align: center;
    margin-bottom: 1rem;
}

.modal-shop-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.modal-shop-type {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: center;
}

/* Thumbnail row for shop + menu images */
.modal-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-thumb-wrap {
    flex: 1;
    text-align: center;
}

.modal-thumb-img {
    width: 100%;
    border-radius: var(--radius-sm);
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.modal-thumb-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
}

.modal-thumb-caption {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Menu "visit to see more" */
.modal-menu-more {
    text-align: center;
    color: #d4a017;
    font-size: 0.8rem;
    padding: 0.6rem;
    margin-top: 0.3rem;
    border-top: 1px dashed rgba(212, 160, 23, 0.3);
    font-style: italic;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1rem;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--surface-light);
}

.modal-detail-row:last-child {
    border-bottom: none;
}

.modal-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.modal-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-keeper-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-align: center;
    font-style: italic;
}

/* Modal Menu */
.modal-menu,
.modal-travel-log {
    margin-bottom: 1rem;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-menu-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.modal-menu-item-name {
    color: var(--text-primary);
}

.modal-menu-item-price {
    color: var(--neon-yellow);
    font-weight: 600;
}

/* Modal Travel Log */
.modal-travel-log-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Modal Radar Chart */
.modal-radar-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

#modal-radar-chart {
    width: 260px;
    height: 260px;
}

/* Modal Traveler */
.modal-traveler {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid var(--surface-light);
}

/* ========================================
   ADVENTURE SCREEN
   ======================================== */

.adventure-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Progress Bar */
.progress-bar-wrap {
    margin-bottom: 1.5rem;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    opacity: 0.4;
}

.progress-step.active {
    opacity: 1;
    background: rgba(168, 85, 247, 0.15);
}

.progress-step.completed {
    opacity: 0.8;
}

.progress-step.completed .step-icon {
    filter: saturate(0.5);
}

.step-icon {
    font-size: 1.5rem;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-step.active .step-label {
    color: var(--neon-cyan);
    font-weight: 700;
}

.progress-connector {
    width: 40px;
    height: 2px;
    background: var(--surface-light);
    transition: background 0.3s ease;
}

.progress-connector.completed {
    background: var(--neon-purple);
}

/* Shop Arrival */
.shop-arrival {
    text-align: center;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(168, 85, 247, 0.25);
    position: relative;
    overflow: hidden;
}

.shop-arrival::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-neon);
}

.shop-arrival.arriving {
    animation: arrivalPulse 0.8s ease;
}

@keyframes arrivalPulse {
    0% {
        border-color: transparent;
        transform: scale(0.95);
        opacity: 0;
    }

    50% {
        border-color: var(--neon-pink);
    }

    100% {
        border-color: rgba(168, 85, 247, 0.25);
        transform: scale(1);
        opacity: 1;
    }
}

.shop-arrival-emoji {
    font-size: 4rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.4));
}

.shop-arrival-name {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

.shop-arrival-type {
    color: var(--neon-cyan);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.shop-arrival-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Dialogue Area */
.dialogue-area {
    max-height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

.dialogue-area::-webkit-scrollbar {
    width: 4px;
}

.dialogue-area::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 2px;
}

.dialogue-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dialogue-msg {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    animation: msgAppear 0.4s ease;
}

@keyframes msgAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dialogue-msg.npc {
    align-self: flex-start;
    background: var(--surface);
    border-left: 3px solid var(--neon-purple);
}

.dialogue-msg.player {
    align-self: flex-end;
    background: rgba(78, 205, 196, 0.12);
    border-right: 3px solid var(--neon-cyan);
    text-align: right;
}

.msg-speaker {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.dialogue-msg.npc .msg-speaker {
    color: var(--neon-pink);
}

.dialogue-msg.player .msg-speaker {
    color: var(--neon-cyan);
}

.msg-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Typing animation */
.typing-dots span {
    animation: typingBlink 1.4s infinite;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBlink {

    0%,
    60%,
    100% {
        opacity: 0.3;
    }

    30% {
        opacity: 1;
    }
}

/* Action Area */
.action-area {
    margin-top: 1rem;
}

.choices-label {
    text-align: center;
    color: var(--neon-yellow);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.choices-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.choice-btn:hover {
    border-color: var(--neon-pink);
    background: rgba(255, 107, 157, 0.08);
    transform: translateX(6px);
    box-shadow: -3px 0 15px rgba(255, 107, 157, 0.15);
}

.choice-btn:active {
    transform: translateX(3px) scale(0.98);
}

/* Free Input */
.free-input-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.free-input-divider::before,
.free-input-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface-light);
}

.free-input-wrap {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.free-input {
    flex: 1;
    padding: 0.85rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.3s ease;
}

.free-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.15);
}

.free-input::placeholder {
    color: var(--text-muted);
}

.free-input-send {
    padding: 0.85rem 1.5rem;
    background: var(--neon-cyan);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-dark);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.free-input-send:hover {
    background: #5dddd4;
    box-shadow: var(--glow-cyan);
}

/* Next Shop Button */
.next-shop-wrap {
    text-align: center;
    margin-top: 1.5rem;
}

.next-shop-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
    }

    50% {
        box-shadow: 0 4px 35px rgba(255, 107, 157, 0.5);
    }
}

.next-shop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5);
}

/* ========================================
   RESULT SCREEN
   ======================================== */

.result-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.result-card {
    text-align: center;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 107, 157, 0.2);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.1) 0%, transparent 60%),
        var(--bg-card);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-neon);
}

.result-header {
    margin-bottom: 2rem;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
}

.result-attribute {
    margin-bottom: 1.5rem;
}

.result-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 30px rgba(255, 107, 157, 0.5));
    animation: titleFloat 3s ease-in-out infinite;
}

.result-title {
    font-size: 2.2rem;
    font-weight: 900;
}

.result-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Result Details */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
}

.result-detail-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1.2rem;
    background: var(--surface);
    border-radius: var(--radius-md);
}

.result-detail-label {
    color: var(--neon-yellow);
    font-weight: 700;
    white-space: nowrap;
    min-width: 10rem;
}

.result-detail-value {
    color: var(--text-secondary);
}

/* Travel Log */
.result-travel-log {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(78, 205, 196, 0.06);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--neon-cyan);
    text-align: left;
}

.travel-log-title {
    color: var(--neon-cyan);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.travel-log-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-style: italic;
}

/* Attribute Chart */
.result-attributes-chart {
    margin: 2rem 0;
    text-align: left;
}

.chart-title {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.attribute-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attr-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.attr-bar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 8rem;
    text-align: right;
}

.attr-bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.attr-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1.5s ease;
    min-width: 4px;
}

.attr-bar-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 1.5rem;
    text-align: center;
}

/* Visited Shops */
.result-visited-shops {
    margin-top: 2rem;
    text-align: left;
}

.visited-title {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.visited-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.visited-shop-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--neon-purple);
}

.visited-shop-emoji {
    font-size: 2rem;
}

.visited-shop-info {
    display: flex;
    flex-direction: column;
}

.visited-shop-name {
    font-weight: 700;
    color: var(--text-primary);
}

.visited-shop-owner {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Result Actions */
.result-actions {
    text-align: center;
    margin-top: 1rem;
}

.retry-btn {
    padding: 1rem 3rem;
    background: transparent;
    border: 2px solid var(--neon-purple);
    border-radius: var(--radius-full);
    color: var(--neon-purple);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--neon-purple);
    color: white;
    box-shadow: var(--glow-purple);
    transform: translateY(-2px);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .title-desc {
        font-size: 0.9rem;
        line-height: 1.9;
    }

    .start-btn {
        padding: 1rem 3rem;
        font-size: 1.1rem;
    }

    .traveler-container {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .traveler-examples {
        gap: 0.5rem;
    }

    .example-chip {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }

    .adventure-container {
        padding: 1rem;
    }

    .progress-step {
        padding: 0.3rem 0.5rem;
    }

    .step-icon {
        font-size: 1.2rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .progress-connector {
        width: 20px;
    }

    .shop-arrival {
        padding: 1.5rem 1rem;
    }

    .shop-arrival-emoji {
        font-size: 3rem;
    }

    .shop-arrival-name {
        font-size: 1.5rem;
    }

    .dialogue-msg {
        max-width: 90%;
    }

    .result-container {
        padding: 2rem 1rem;
    }

    .result-card {
        padding: 2rem 1.25rem;
    }

    .result-emoji {
        font-size: 4rem;
    }

    .result-title {
        font-size: 1.6rem;
    }

    .result-detail-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .result-detail-label {
        min-width: auto;
    }

    .attr-bar-row {
        flex-wrap: wrap;
    }

    .attr-bar-label {
        min-width: 100%;
        text-align: left;
        margin-bottom: -0.3rem;
    }
}

@media (max-width: 480px) {
    .traveler-container {
        padding: 1.5rem 0.75rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .free-input-wrap {
        flex-direction: column;
    }

    .free-input-send {
        width: 100%;
    }
}

/* ========================================
   TRAVELER PORTRAIT
   ======================================== */

.traveler-portrait-wrap {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.traveler-portrait-placeholder {
    width: 200px;
    height: 260px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: placeholderPulse 1.5s ease-in-out infinite;
    border: 2px solid var(--surface-light);
}

.traveler-portrait-placeholder span {
    font-size: 3rem;
}

.traveler-portrait-placeholder small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.traveler-portrait {
    width: 200px;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.3);
}

/* ========================================
   SHOP IMAGE GRID
   ======================================== */

.shop-images-area {
    padding: 1.5rem;
}

.shop-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.shop-image-slot {
    text-align: center;
}

.image-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.image-frame {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    animation: placeholderPulse 1.5s ease-in-out infinite;
}

.image-placeholder span {
    font-size: 2rem;
}

.image-placeholder small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

@keyframes placeholderPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.generated-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.generated-image.fade-in {
    animation: imageFadeIn 0.6s ease;
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   SHOP OWNER INFO
   ======================================== */

.shop-owner-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1.25rem;
    background: rgba(168, 85, 247, 0.08);
    border-radius: var(--radius-full);
    display: inline-flex;
}

.owner-info-emoji {
    font-size: 1.3rem;
}

.owner-info-name {
    color: var(--neon-pink);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ========================================
   SHOP MENU
   ======================================== */

.shop-menu {
    padding: 1.25rem 1.5rem;
}

.menu-title {
    font-size: 1rem;
    color: var(--neon-yellow);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 1rem;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--neon-orange);
}

.menu-item-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.menu-item-price {
    font-size: 0.85rem;
    color: var(--neon-yellow);
    font-weight: 700;
    text-align: right;
}

.menu-item-desc {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   RESULT PORTRAIT
   ======================================== */

.result-portrait-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.result-portrait {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 3px solid var(--neon-primary);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Responsive (image additions)
   ======================================== */

@media (max-width: 768px) {
    .shop-image-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .image-frame {
        aspect-ratio: 16 / 9;
    }

    .traveler-portrait,
    .traveler-portrait-placeholder {
        width: 160px;
        height: 210px;
    }
}

@media (max-width: 480px) {

    .traveler-portrait,
    .traveler-portrait-placeholder {
        width: 140px;
        height: 180px;
    }
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--surface-light);
    border-top-color: var(--neon-primary);
    border-right-color: var(--neon-accent);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

.loading-tips {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    animation: fadeInOut 4s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ========================================
   PORTRAIT GENERATING ANIMATION
   ======================================== */

.portrait-generating {
    font-size: 3rem;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

.traveler-portrait-placeholder small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    animation: fadeInOut 3s ease-in-out infinite;
}

/* ========================================
   RESULT DIAGNOSIS
   ======================================== */

.result-diagnosis {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, rgba(153, 102, 255, 0.1), rgba(255, 102, 136, 0.05));
    border-left: 3px solid var(--neon-primary);
    border-radius: var(--radius-sm);
}

.diagnosis-title {
    font-size: 1.1rem;
    color: var(--neon-primary);
    margin-bottom: 0.6rem;
}

.diagnosis-type {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-accent);
    margin-bottom: 0.4rem;
}

.diagnosis-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.result-shop-header {
    text-align: center;
    margin: 1rem 0 0.5rem;
}

.result-shop-type {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.2rem 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.radar-chart-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.skill-descriptions {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-desc-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.skill-desc-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.skill-val {
    font-size: 0.8rem;
    color: var(--neon-primary);
    margin-left: 0.3rem;
}

.skill-desc-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ========================================
   RESULT SHOP IMAGE & MENU
   ======================================== */

.result-shop-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    background: var(--surface-dark);
}

.result-shop-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-dark);
    animation: portrait-generating 2s ease-in-out infinite;
}

.result-shop-image-placeholder .generating-icon {
    font-size: 3rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.result-shop-image-placeholder small {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-shop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Shopkeeper portrait */
.result-keeper-image-wrap {
    width: 200px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem auto;
    position: relative;
    background: var(--surface-dark);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.result-keeper-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-dark);
    animation: portrait-generating 2s ease-in-out infinite;
}

.result-keeper-image-placeholder .generating-icon {
    font-size: 2.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.result-keeper-image-placeholder small {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-keeper-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}


.result-shop-menu {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-light);
}

.shop-menu-title {
    font-size: 1.1rem;
    color: var(--neon-accent);
    margin-bottom: 0.8rem;
}

.shop-menu-list .menu-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--surface-light);
}

.shop-menu-list .menu-item:last-child {
    border-bottom: none;
}

/* ========================================
   X SHARE BUTTON
   ======================================== */

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.share-x-btn {
    padding: 1rem 2rem;
    background: #000;
    color: #fff;
    border: 2px solid #333;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.share-x-btn:hover {
    background: #1a1a1a;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .glass-card {
        padding: 1.2rem;
        border-radius: var(--radius-md);
    }

    .title-emoji-img {
        width: 156px;
    }

    .title-sub {
        font-size: 1.2rem;
    }

    .title-desc {
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }

    .title-hint {
        font-size: 0.75rem;
    }

    .start-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    /* Traveler creation */
    .traveler-section h2 {
        font-size: 1.2rem;
    }

    .prompt-input {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .generate-btn,
    .skip-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .traveler-portrait-container {
        max-height: 250px;
    }

    /* Shop screen */
    .shop-header h2 {
        font-size: 1.3rem;
    }

    .shop-greeting {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .shop-images-grid {
        gap: 0.5rem;
    }

    .shop-choice-btn {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .free-input-area {
        flex-direction: column;
    }

    .free-input-area textarea {
        font-size: 0.9rem;
    }

    .next-shop-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Menu grid */
    .shop-menu-grid {
        gap: 0.5rem;
    }

    .menu-item-card {
        padding: 0.6rem;
    }

    /* Result screen */
    .result-card {
        padding: 1rem;
    }

    .result-label {
        font-size: 0.85rem;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .result-description {
        font-size: 0.9rem;
    }

    .result-shop-image-wrap {
        margin-bottom: 1rem;
    }

    .result-diagnosis {
        padding: 0.8rem 1rem;
    }

    .result-shop-menu {
        padding: 0.8rem;
    }

    .attr-bar-label {
        font-size: 0.75rem;
        min-width: 4.5rem;
    }

    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .share-x-btn,
    .retry-btn {
        width: 100%;
        padding: 0.9rem;
    }

    /* Loading */
    .loading-emoji {
        font-size: 3rem;
    }

    .loading-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .title-content {
        padding: 1rem;
    }

    .title-emoji-img {
        width: 128px;
    }

    .title-logo-wrap {
        margin-bottom: 1.5rem;
    }

    .glass-card {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }

    .traveler-portrait-container {
        max-height: 200px;
    }

    .shop-images-grid {
        grid-template-columns: 1fr;
    }

    .result-title {
        font-size: 1.3rem;
    }

    .result-details {
        gap: 0.5rem;
    }

    .result-detail-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .visited-shop-item {
        padding: 0.5rem;
    }
}

/* ========================================
   SHARE PREVIEW OVERLAY (mobile save)
   ======================================== */

.share-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.share-preview-content {
    max-width: 500px;
    width: 100%;
    text-align: center;
    position: relative;
}

.share-preview-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.share-preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.share-preview-hint {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    animation: pulse 2s ease-in-out infinite;
}

.share-preview-img {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.share-preview-tweet {
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    background: #000;
    color: #fff;
    border: 2px solid #333;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.share-preview-tweet:hover {
    background: #1a1a1a;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* ========================================
   SHOP LIST PAGE
   ======================================== */

.map-list-btn {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.map-list-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
}

.shop-list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.shop-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.shop-list-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.shop-list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.shop-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.shop-list-table thead th {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.6rem 0.8rem;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.shop-list-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.shop-list-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.shop-list-table tbody td {
    padding: 0.55rem 0.8rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.shop-list-table .shop-link {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
}

.shop-list-table .shop-link:hover {
    color: var(--neon-primary);
    text-decoration: underline;
}

.shop-list-table .shop-no {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.shop-list-table .shop-map-label {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    white-space: nowrap;
    color: var(--text-secondary);
}

.shop-list-table .shop-date {
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .shop-list-container {
        padding: 1rem 0.5rem;
    }

    .shop-list-table {
        font-size: 0.78rem;
    }

    .shop-list-table thead th,
    .shop-list-table tbody td {
        padding: 0.45rem 0.5rem;
    }
}

/* ========== トップ画面ボタン行 ========== */
.title-btn-row {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ========== ギャラリー画面 ========== */
.gallery-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

.gallery-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.gallery-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gallery-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
}

.gallery-tab {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.gallery-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.gallery-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item .gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.3rem 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

/* ギャラリーフルスクリーンオーバーレイ */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 0.8rem;
}

.gallery-overlay img {
    max-width: 92vw;
    max-height: 75vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.gallery-overlay-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.gallery-overlay-shop-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.03em;
}

.gallery-overlay-shop-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(153, 102, 255, 0.5);
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.4rem;
    }

    .gallery-container {
        padding: 1rem 0.5rem;
    }

    .gallery-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ========== ランキング画面 ========== */
.ranking-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.ranking-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ranking-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.ranking-top1 {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 165, 0, 0.04));
}

.ranking-top2 {
    border-color: rgba(192, 192, 192, 0.3);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.06), transparent);
}

.ranking-top3 {
    border-color: rgba(205, 127, 50, 0.3);
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.06), transparent);
}

.ranking-rank {
    font-size: 1.5rem;
    min-width: 2.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
}

.ranking-top1 .ranking-rank {
    color: #ffd700;
}

.ranking-top2 .ranking-rank {
    color: #c0c0c0;
}

.ranking-top3 .ranking-rank {
    color: #cd7f32;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-shop-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-popular-menu {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.ranking-revenue {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--neon-accent);
    white-space: nowrap;
}

.ranking-revenue small {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

.ranking-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.ranking-btn {
    width: 100%;
}

@media (max-width: 600px) {
    .ranking-container {
        padding: 1rem 0.5rem;
    }

    .ranking-item {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .ranking-rank {
        font-size: 1.2rem;
        min-width: 2rem;
    }

    .ranking-shop-name {
        font-size: 0.9rem;
    }

    .ranking-revenue {
        font-size: 0.95rem;
    }
}

/* ========================================
   MAP PAGINATION DOTS
   ======================================== */

.map-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 0;
    flex-wrap: wrap;
}

.map-page-dot {
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.map-page-dot:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
}

.map-page-dot.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(153, 102, 255, 0.4);
}

/* ========================================
   SALES PANEL (Shop Modal)
   ======================================== */

.modal-sales {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--surface-dark);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sales-summary {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.sales-stat {
    text-align: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 80px;
}

.sales-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sales-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-accent);
}

.sales-log-title {
    margin-top: 1rem;
}

/* 売上ログリスト（最近のお客さん） */
.sales-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.sales-log-item {
    padding: 0.7rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
}

.sales-log-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sales-log-visitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.sales-log-visitor-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sales-log-visitor-link {
    padding: 0.2rem 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sales-log-visitor-link:hover {
    background: rgba(96, 165, 250, 0.15);
    border-color: #60a5fa;
    color: #93bbfc;
}

.sales-log-purchase {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.sales-log-price {
    font-weight: 700;
    color: var(--neon-accent);
    white-space: nowrap;
}

.sales-log-comment {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-style: italic;
}

.sales-log-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.3rem;
}

.sales-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.sales-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 1rem;
    font-size: 0.88rem;
}

/* ========================================
   MAP PAGE LABEL (street name)
   ======================================== */

.map-page-label {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* レスポンシブ調整 */
@media (max-width: 600px) {
    .sales-summary {
        gap: 0.5rem;
    }

    .sales-stat {
        min-width: 70px;
        padding: 0.5rem 0.6rem;
    }

    .sales-stat-value {
        font-size: 1rem;
    }

    .sales-log-list {
        max-height: 300px;
    }

    .map-pagination {
        gap: 0.3rem;
    }

    .map-page-dot {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ========================================
   MAP NAVIGATION ARROWS (‹ ›)
   ======================================== */

.map-viewport {
    position: relative;
    overflow: hidden;
}

.map-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2.5rem;
    height: 3.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1;
}

.map-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.map-arrow-left {
    left: 0.5rem;
}

.map-arrow-right {
    right: 0.5rem;
}

.map-arrow-disabled {
    opacity: 0.25;
    pointer-events: none;
    cursor: default;
}

@media (max-width: 600px) {
    .map-arrow {
        width: 2rem;
        height: 2.8rem;
        font-size: 1.3rem;
    }

    .map-arrow-left {
        left: 0.3rem;
    }

    .map-arrow-right {
        right: 0.3rem;
    }
}

/* ========================================
   内蔵ブラウザ警告バナー
   ======================================== */
.inapp-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(180deg, rgba(20, 10, 0, 0.97) 0%, rgba(15, 8, 0, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 170, 0, 0.5);
    padding: 12px 16px 14px;
    animation: bannerSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 30px rgba(255, 140, 0, 0.15), 0 1px 0 rgba(255, 170, 0, 0.3);
}

.inapp-banner.hidden {
    display: none;
}

@keyframes bannerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.banner-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.banner-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.banner-text-wrap {
    flex: 1;
}

.banner-title {
    font-size: 0.85rem;
    font-weight: 900;
    color: #ffbb33;
    line-height: 1.4;
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.banner-sub {
    font-size: 0.72rem;
    color: #aa8844;
    margin-top: 2px;
    line-height: 1.4;
}

.banner-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #777;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #bbb;
}

.banner-btn {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: linear-gradient(135deg, #00cc88, #00aa66);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 20px rgba(0, 204, 136, 0.35);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.banner-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: bannerShimmer 3s infinite;
}

@keyframes bannerShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.banner-btn:active {
    transform: scale(0.98);
}

.banner-btn-emoji {
    margin-right: 4px;
}