/* =====================================================================
 * Loocation web app — dark theme, mirroring the iOS look.
 * Layered on top of /styles.css (which provides the colour variables).
 * ===================================================================== */

:root {
    /* Force dark for the app, regardless of OS preference. */
    --bg:        #0E0A1A;
    --card:      #1B1530;
    --card-soft: #221B3D;
    --text:      #F1ECFF;
    --text-soft: #A39BC3;
    --divider:   #2A2444;

    --primary:      #7B5BFF;
    --primary-dark: #5A3FD9;
    --accent:       #FF6B6B;
    --gold:         #FFD23F;
    --mint:         #4ECDC4;

    --header-h: 64px;
    --footer-h: 36px;
    --sidebar-w: 360px;
    --detail-w: 420px;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-soft: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-pop:  0 10px 40px rgba(0, 0, 0, 0.55);
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    overflow: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ======================== Mobile splash ======================== */

/* The `hidden` HTML attribute defaults to `display: none`, but ID
 * selectors win on specificity — explicit override so JS-toggled
 * hidden actually hides the splash on desktop. */
[hidden] { display: none !important; }

#mobile-splash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 0%, rgba(123, 91, 255, 0.18), transparent 60%),
                radial-gradient(circle at 80% 100%, rgba(255, 107, 107, 0.12), transparent 50%),
                var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.splash-card {
    max-width: 420px;
    text-align: center;
}

.splash-emoji {
    font-size: 64px;
    line-height: 1;
}

.splash-card h1 {
    font-size: 36px;
    margin: 12px 0 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.splash-card .lead {
    font-size: 16px;
    color: var(--text);
    margin: 0 0 12px;
}

.splash-card .muted {
    color: var(--text-soft);
    font-size: 13px;
    margin: 0 0 24px;
    line-height: 1.55;
}

.splash-card .cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 12px 26px rgba(123, 91, 255, 0.35);
}
.splash-card .cta:hover { text-decoration: none; opacity: 0.94; }

.splash-links {
    margin-top: 28px;
    color: var(--text-soft);
    font-size: 13px;
}
.splash-links a { color: var(--text-soft); margin: 0 6px; }

/* ======================== App shell ============================== */

#app {
    display: grid;
    grid-template-rows: var(--header-h) 1fr var(--footer-h);
    height: 100vh;
}

/* Header ------------------------------------------------------------ */

.app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 22px;
    background: var(--card);
    border-bottom: 1px solid var(--divider);
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-emoji { font-size: 22px; line-height: 1; }
.brand-name {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.2px;
}

.header-search {
    max-width: 520px;
    width: 100%;
    justify-self: center;
}
.header-search input {
    width: 100%;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid var(--divider);
    background: var(--card-soft);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.header-search input::placeholder { color: var(--text-soft); }
.header-search input:focus { border-color: var(--primary); }

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-soft);
    font-size: 14px;
}
.header-nav a { color: var(--text-soft); }
.header-nav a:hover { color: var(--text); text-decoration: none; }

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(123, 91, 255, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(123, 91, 255, 0.5); }

.user-menu { position: relative; }
.user-menu > button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    color: var(--text);
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    font-size: 13px;
}
.user-menu > button img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--divider);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    min-width: 160px;
    box-shadow: var(--shadow-pop);
    padding: 6px;
    z-index: 5;
}
.user-dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
}
.user-dropdown a:hover { background: var(--divider); text-decoration: none; }

/* Main grid: sidebar + map ----------------------------------------- */

.app-main {
    position: relative;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    overflow: hidden;
}

.sidebar {
    background: var(--card);
    border-right: 1px solid var(--divider);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--divider);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 1;
}
.sidebar-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--text);
}
.muted { color: var(--text-soft); font-size: 12px; margin: 0; }

.throne-list { padding: 8px 12px 24px; }

.throne-card {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--card-soft);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.12s, transform 0.12s;
    align-items: center;
    border: 1px solid transparent;
}
.throne-card:hover {
    background: var(--divider);
    border-color: var(--primary);
    transform: translateX(-2px);
}
.throne-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(123, 91, 255, 0.25);
}
.throne-card .thumb {
    width: 80px;
    height: 64px;
    border-radius: 10px;
    background: var(--divider);
    background-size: cover;
    background-position: center;
}
.throne-card .info h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 3px;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.throne-card .info .meta {
    font-size: 11px;
    color: var(--text-soft);
    display: flex;
    gap: 8px;
    align-items: center;
}
.throne-card .rating {
    font-size: 14px;
    font-weight: 700;
    color: var(--mint);
    background: rgba(78, 205, 196, 0.12);
    border-radius: 12px;
    padding: 6px 10px;
    min-width: 36px;
    text-align: center;
}

/* Map -------------------------------------------------------------- */

.map-pane { position: relative; }

#map { width: 100%; height: 100%; background: var(--card); }

.map-controls {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 4;
}

.filter-chips {
    display: inline-flex;
    background: var(--card);
    border: 1px solid var(--divider);
    border-radius: 999px;
    padding: 4px;
    box-shadow: var(--shadow-soft);
}
.chip {
    background: transparent;
    border: none;
    color: var(--text-soft);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

/* Detail panel ----------------------------------------------------- */

.detail-panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: var(--detail-w);
    background: var(--card);
    border-left: 1px solid var(--divider);
    box-shadow: var(--shadow-pop);
    overflow-y: auto;
    z-index: 6;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.detail-panel.open { transform: translateX(0); }

.close-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    z-index: 2;
}
.close-btn:hover { background: rgba(0, 0, 0, 0.65); }

.detail-photos {
    width: 100%;
    height: 240px;
    background: var(--divider);
    background-size: cover;
    background-position: center;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.detail-photos img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: pointer;
}
.detail-photos.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.detail-photos.empty::after {
    content: "🚽";
    font-size: 80px;
}

.detail-body { padding: 20px 22px 32px; }

.detail-body h1 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--text);
}

.detail-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--divider);
    color: var(--text-soft);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    margin-bottom: 12px;
}

.detail-distance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(123, 91, 255, 0.15);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.detail-section {
    margin-top: 22px;
}
.detail-section h2 {
    font-size: 15px;
    margin: 0 0 10px;
    color: var(--text);
}

.rating-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.rating-pill {
    background: var(--card-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-soft);
}
.rating-pill .value {
    color: var(--gold);
    font-weight: 700;
}

.amenities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.amenity-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(78, 205, 196, 0.15);
    color: var(--mint);
}
.amenity-badge.absent {
    background: rgba(42, 36, 68, 0.6);
    color: var(--text-soft);
    text-decoration: line-through;
    text-decoration-color: var(--text-soft);
}
.amenity-badge.cost-paid {
    background: rgba(255, 210, 63, 0.18);
    color: var(--gold);
}

.review-card {
    background: var(--card-soft);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.review-card .author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.review-card .author img,
.review-card .author .anon {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--divider);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-soft);
    font-size: 14px;
}
.review-card .author .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.review-card .author .when {
    color: var(--text-soft);
    font-size: 11px;
}
.review-card .rating-bubble {
    margin-left: auto;
    background: rgba(78, 205, 196, 0.18);
    color: var(--mint);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.review-card .comment {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    margin: 6px 0 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Footer ----------------------------------------------------------- */

.app-footer {
    height: var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--card);
    border-top: 1px solid var(--divider);
    color: var(--text-soft);
    font-size: 12px;
}
.app-footer a { color: var(--text-soft); }
.app-footer a:hover { color: var(--text); text-decoration: none; }
.footer-copyright { margin-left: 12px; opacity: 0.6; }

/* Modal ------------------------------------------------------------ */

.modal {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-pop);
    max-width: 380px;
    width: calc(100% - 32px);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
.modal-close {
    position: absolute;
    top: 10px; right: 10px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--divider);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
}
.modal-body { padding: 28px 28px 22px; text-align: center; }
.modal-emoji { font-size: 44px; margin-bottom: 12px; }
.modal-body h2 {
    margin: 0 0 6px;
    font-size: 20px;
}
.modal-body .muted { font-size: 13px; line-height: 1.5; margin-bottom: 20px; }

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--divider);
    background: var(--card-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.oauth-btn:hover { background: var(--divider); }
.oauth-btn svg { width: 20px; height: 20px; }
.oauth-btn.apple    { background: #000; color: #fff; border-color: #000; }
.oauth-btn.apple:hover { background: #1a1a1a; }
.oauth-btn.google   { background: #fff; color: #1f1f1f; border-color: #d4d4d4; }
.oauth-btn.facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.oauth-btn.facebook:hover { background: #166fe5; }

.modal-fineprint {
    color: var(--text-soft);
    font-size: 11px;
    margin: 0;
}
.modal-fineprint a { color: var(--text-soft); text-decoration: underline; }

/* Empty / loading / error helpers --------------------------------- */

.empty-state {
    text-align: center;
    color: var(--text-soft);
    padding: 40px 20px;
    font-size: 13px;
}

/* Responsive: shrink sidebar / hide it on narrow desktops --------- */

@media (max-width: 980px) {
    :root { --sidebar-w: 280px; --detail-w: 360px; }
    .header-search { display: none; }
}

/* ================== "Add throne" + creation flow ================== */

.add-throne-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
}
.add-throne-btn span:first-child {
    font-size: 16px;
    line-height: 1;
}

/* Map-pick hint banner */
.map-pick-hint {
    position: fixed;
    top: calc(var(--header-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-pop);
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}
.map-pick-hint button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* Wider modal for the form */
.modal.modal-wide {
    max-width: 540px;
}
.modal.modal-wide .modal-body {
    text-align: left;
    padding: 28px 28px 26px;
    max-height: 78vh;
    overflow-y: auto;
}

.create-form-body h2 {
    margin: 0 0 4px;
}
.address-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 16px;
    padding: 10px 12px;
    background: var(--card-soft);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.link-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 13px;
    padding: 4px 8px;
}
.link-btn.danger { color: var(--accent); }
.link-btn:hover { text-decoration: underline; }

/* Kind picker grid */
.kind-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    text-align: left;
}
.kind-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    color: inherit;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    text-align: left;
    transition: border-color 0.15s, transform 0.15s;
}
.kind-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.kind-card.disabled { opacity: 0.55; pointer-events: none; }
.kind-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(123, 91, 255, 0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.kind-text strong { display: block; font-size: 14px; color: var(--text); }
.kind-text span  { display: block; font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* Form internals */
.private-banner {
    background: rgba(123, 91, 255, 0.15);
    border: 1px solid rgba(123, 91, 255, 0.3);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin: 6px 0 16px;
}

.form-section {
    margin-bottom: 18px;
}
.field-label {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 6px;
}
input[type="text"],
input[type="search"],
textarea,
select {
    width: 100%;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
}

/* Photo strip + drop zone */
.photo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--card-soft);
    border: 2px dashed transparent;
    min-height: 80px;
    align-items: center;
    transition: border-color 0.15s, background 0.15s;
}
.photo-strip.drop {
    border-color: var(--primary);
    background: rgba(123, 91, 255, 0.10);
}
.photo-tile {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--divider);
}
.photo-tile img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.photo-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
}
.photo-add {
    width: 80px; height: 80px;
    border-radius: 10px;
    border: 2px dashed var(--divider);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 11px;
}
.photo-add span { font-size: 22px; line-height: 1; color: var(--primary); }
.photo-add:hover { border-color: var(--primary); color: var(--text); }

/* Place-type chip row */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-pick {
    background: var(--divider);
    border: 1px solid transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
}
.chip-pick:hover { border-color: var(--primary); }
.chip-pick.selected {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: transparent;
}

/* Amenity toggle grid */
.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    font-size: 13px;
}
.toggle-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    cursor: pointer;
}
.toggle-grid input[type=checkbox] {
    accent-color: var(--primary);
    width: 16px; height: 16px;
}

/* Cost */
.cost-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cost-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}
.cost-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.price-input {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}
.price-input input { flex: 1; }
.price-input select { width: auto; }

/* Slider stack */
.slider-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.slider-row {
    display: grid;
    grid-template-columns: 130px 1fr 30px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.slider-label { color: var(--text); }
.slider-value {
    text-align: right;
    color: var(--gold);
    font-weight: 700;
}
input[type=range] {
    accent-color: var(--primary);
}

/* Anonymous toggle row */
.anon-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--card-soft);
}
.anon-row input { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; }
.anon-row strong { display: block; font-size: 14px; color: var(--text); }
.anon-row .muted { display: block; font-size: 12px; margin-top: 2px; }

/* Form error */
.form-error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Wide CTA inside the modal */
.primary-btn.wide {
    width: 100%;
    padding: 14px;
    font-size: 14px;
}

/* Review bottom strip — like button + own actions */
.review-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    border-top: 1px solid var(--divider);
    padding-top: 10px;
}
.review-own-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--divider);
    color: var(--text-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.like-btn:hover { color: var(--accent); border-color: var(--accent); }
.like-btn .heart {
    font-size: 14px;
    line-height: 1;
    transition: transform 0.15s;
}
.like-btn.liked {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255, 107, 107, 0.10);
}
.like-btn.liked .heart {
    animation: like-pop 0.25s ease;
}
.like-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@keyframes like-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Inline name editor */
.inline-edit {
    flex: 1;
    background: var(--card-soft);
    border: 1px solid var(--primary);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 14px;
    box-sizing: border-box;
}
.inline-err {
    display: block !important;
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 12px;
}

/* Avatar upload button */
.avatar-button {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}
.avatar-button .avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 50%;
}
.avatar-button:hover .avatar-overlay { opacity: 1; }

/* ================== Profile panel ================== */

#profile-panel {
    width: 460px;
    max-width: 100vw;
    z-index: 7;
}

#profile-body { padding: 18px 22px 60px; }

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px 18px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 6px;
}
.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
}
.profile-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.profile-avatar .avatar-placeholder {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
}
.profile-name h2 { margin: 0; font-size: 18px; }
.profile-name .small { font-size: 12px; }

.profile-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--divider);
}
.profile-section:last-of-type { border-bottom: none; }
.profile-section h3 {
    font-size: 14px;
    margin: 0 0 12px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}
.profile-row .row-label {
    color: var(--text-soft);
    font-size: 13px;
    min-width: 110px;
}
.profile-row .row-value {
    flex: 1;
    color: var(--text);
    font-size: 14px;
    word-break: break-all;
}
.profile-row .hint { font-size: 11px; }

.toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(42, 36, 68, 0.4);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row strong { display: block; font-size: 14px; color: var(--text); }
.toggle-row small { display: block; font-size: 11px; margin-top: 2px; line-height: 1.45; }
.toggle-row input { accent-color: var(--primary); width: 18px; height: 18px; margin-top: 2px; }

.profile-action {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    color: var(--text);
    font-size: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.profile-action:hover { background: var(--divider); border-color: var(--primary); }
.profile-action.danger {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.35);
    color: var(--accent);
}
.profile-action.danger:hover { background: rgba(255, 107, 107, 0.16); }
.profile-action .small { font-size: 11px; opacity: 0.8; }

.danger-zone h3 { color: var(--accent); }

/* My thrones list inside the profile */
.my-thrones-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.my-throne-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.my-throne-card:hover { border-color: var(--primary); transform: translateX(-2px); }
.my-throne-card .throne-thumb {
    width: 64px; height: 56px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--divider);
}
.my-throne-card .throne-thumb.gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.my-throne-card h4 {
    margin: 0 0 3px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.my-throne-card .rating-bubble {
    background: rgba(78, 205, 196, 0.16);
    color: var(--mint);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    min-width: 36px;
    text-align: center;
}

/* Delete-account modal */
#delete-modal .step-warning,
#delete-modal .step-otp {
    text-align: center;
}
#delete-otp {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-family: -apple-system, "SF Mono", Menlo, monospace;
    letter-spacing: 6px;
    padding: 14px;
    margin: 16px 0 14px;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    color: var(--text);
    box-sizing: border-box;
}
.primary-btn.danger {
    background: linear-gradient(135deg, var(--accent), #D92626);
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.35);
}

/* ================== Onboarding ================== */

.onboarding-modal::backdrop { background: rgba(0, 0, 0, 0.85); }
.onboarding-modal { max-width: 460px; }
.onboarding-modal .modal-emoji { font-size: 50px; margin-bottom: 16px; }
.onboarding-modal h2 { margin-bottom: 6px; }
.onboarding-modal .step-name,
.onboarding-modal .step-user { text-align: center; }

.username-input {
    display: flex;
    align-items: center;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.15s;
}
.username-input:focus-within { border-color: var(--primary); }
.username-input .prefix {
    color: var(--text-soft);
    padding: 0 4px 0 14px;
    font-size: 16px;
}
.username-input input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 10px 12px 10px 4px;
    color: var(--text);
    font-size: 16px;
    outline: none;
}
.muted.small.available {
    color: var(--mint);
}
.form-error.inline {
    background: transparent;
    border: none;
    padding: 6px 0 0;
    margin: 0;
    font-size: 12px;
    text-align: left;
}

/* ================== Visit log ================== */

.visit-btn {
    background: linear-gradient(135deg, var(--mint), #2dbab1);
    color: #0E0A1A;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    box-shadow: 0 4px 14px rgba(78, 205, 196, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.visit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(78, 205, 196, 0.5); }
.visit-btn:disabled { opacity: 0.7; transform: none; cursor: not-allowed; }

.visits-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.visit-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--card-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.visit-row:hover { border-color: var(--primary); transform: translateX(-2px); }
.visit-row[data-disabled="1"] {
    opacity: 0.5;
    cursor: default;
}
.visit-row[data-disabled="1"]:hover { transform: none; border-color: var(--divider); }
.visit-row .visit-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 210, 63, 0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.visit-row .visit-info { display: flex; flex-direction: column; gap: 2px; }
.visit-row strong {
    font-size: 13px;
    color: var(--text);
    line-height: 1.3;
}

/* ================== Friends panel ================== */

#friends-panel { width: 460px; max-width: 100vw; z-index: 7; }
.friends-body { padding: 18px 22px 60px; }
.friends-body h2 { margin: 6px 0 8px; font-size: 22px; }
.friends-body .muted.small { font-size: 12px; line-height: 1.5; }
.friends-list-header {
    margin: 24px 0 10px;
    font-size: 13px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#friends-results,
#friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#friends-results { margin-top: 10px; }

.friend-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    background: var(--card-soft);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.friend-avatar img,
.friend-avatar .comment-avatar-placeholder {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--divider);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-soft);
    font-weight: 600;
}
.friend-info { display: flex; flex-direction: column; gap: 2px; }
.friend-info strong { font-size: 14px; color: var(--text); }
.friend-info .small { font-size: 11px; }

.secondary-btn {
    background: var(--card-soft);
    color: var(--text);
    border: 1px solid var(--divider);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s;
}
.secondary-btn:hover { border-color: var(--accent); color: var(--accent); }

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(123, 91, 255, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(123, 91, 255, 0.5); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ================== Comment thread ================== */

.comments-list {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 14px;
    padding-right: 6px;
}
.comment-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
}
.comment-row:last-child { border-bottom: none; }
.comment-avatar img,
.comment-avatar .comment-avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--divider);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-meta strong {
    font-size: 13px;
    color: var(--text);
}
.comment-meta .small { font-size: 11px; }
.comment-meta .link-btn {
    margin-left: auto;
}
.comment-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.comment-compose textarea {
    flex: 1;
    min-height: 50px;
    resize: vertical;
}
.comment-compose .primary-btn {
    flex-shrink: 0;
    padding: 11px 18px;
}
.comment-compose .primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Comment button on review cards */
.comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--divider);
    color: var(--text-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    transition: color 0.15s, border-color 0.15s;
}
.comment-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Mobile / narrow viewports → splash */

@media (max-width: 720px) {
    #app { display: none !important; }
}
