:root {
    --bg: #0f1115;
    --bg-soft: rgba(255,255,255,0.06);
    --panel: rgba(255,255,255,0.96);
    --panel-soft: rgba(255,255,255,0.92);
    --text: #111827;
    --text-soft: #4b5563;
    --text-light: #f9fafb;
    --line: #d9dde5;
    --shadow-lg: 0 18px 40px rgba(0,0,0,0.16);
    --shadow-md: 0 12px 28px rgba(0,0,0,0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pin-wall-page,
.pin-wall-app,
.pin-wall-viewport {
    width: 100vw;
    height: 100vh;
}

.pin-wall-page--home {
    position: relative;
}

.pin-wall-viewport {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(180deg, #11141a 0%, #0d1015 100%);
    background-size: 22px 22px, auto;
    touch-action: none;
}

.pin-wall-canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 4000px;
    height: 4000px;
    transform-origin: 0 0;
}

.wall-loading {
    color: #fff;
    padding: 20px;
    font-size: 14px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
    background: rgba(10,12,16,0.62);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.site-nav a:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.site-nav__button {
    background: #fff;
    color: #111 !important;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.wall-topbar {
    position: fixed;
    top: 96px;
    left: 24px;
    z-index: 900;
    max-width: 420px;
    pointer-events: none;
}

.wall-topbar__card {
    background: rgba(10,12,16,0.62);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 18px 18px 16px;
    color: #fff;
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}

.wall-topbar__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
    margin-bottom: 8px;
}

.wall-topbar__title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.1;
    color: #fff;
}

.wall-topbar__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.82);
}

.pin-item {
    position: absolute;
    width: 96px;
    cursor: pointer;
    text-align: center;
    color: #fff;
    user-select: none;
}

.pin-thumb-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pin-item:hover .pin-thumb-wrap {
    transform: scale(1.05);
    box-shadow: 0 14px 28px rgba(0,0,0,0.45);
}

.pin-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pin-title {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
    color: #f3f4f6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    word-break: break-word;
}

.pin-rank-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #111;
    background: #facc15;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.pin-wall-toolbar {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
}

.toolball-toggle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.toolball-panel {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: rgba(255,255,255,.98);
    border-radius: 18px;
    min-width: 240px;
    box-shadow: var(--shadow-lg);
}

.toolball-panel__title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.toolball-panel button,
.toolball-panel input {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.toolball-panel button {
    border: none;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 11px 12px;
    cursor: pointer;
    font-weight: 600;
}

.toolball-panel input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
}

.pin-wall-toolbar.open .toolball-panel {
    display: block;
}

.pin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 1000;
    padding: 16px;
    box-sizing: border-box;
}

.pin-modal-content {
    width: 100%;
    max-width: 920px;
    margin: 4vh auto;
    background: #fff;
    padding: 24px;
    border-radius: 22px;
    position: relative;
    box-sizing: border-box;
    box-shadow: var(--shadow-lg);
    max-height: 88vh;
    overflow: auto;
}

#pin-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.pin-modal-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

.pin-modal-media {
    position: sticky;
    top: 0;
}

.pin-modal-image-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.pin-modal-image {
    width: 100%;
    max-width: 320px;
    border-radius: 16px;
    display: block;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
    background: #f3f4f6;
}

.pin-modal-sale-badge {
    position: absolute;
    top: 14px;
    left: -10px;
    z-index: 3;
    padding: 9px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(0,0,0,0.22);
    letter-spacing: 0.02em;
}

.pin-modal-sale-badge.display-only {
    background: #6b7280;
}

.pin-modal-sale-badge.open-for-trade {
    background: #2563eb;
}

.pin-modal-sale-badge.available-for-sale {
    background: #dc2626;
}

.pin-modal-image--placeholder {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.pin-modal-heading {
    margin-bottom: 14px;
}

.pin-modal-heading h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    color: #111827;
}

.pin-modal-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 8px;
}

.pin-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.pin-modal-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
}

.pin-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.pin-modal-card {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 14px;
    padding: 14px;
}

.pin-modal-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 6px;
}

.pin-modal-card__value {
    font-size: 15px;
    color: #111827;
    line-height: 1.5;
    word-break: break-word;
}

.pin-modal-description {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    padding: 16px;
}

.pin-modal-description p {
    margin: 8px 0 0;
    color: #374151;
    line-height: 1.7;
    font-size: 14px;
}

.pin-modal-link a {
    display: inline-block;
    margin-top: 16px;
    color: #111;
    font-weight: 700;
    text-decoration: none;
}

.pin-modal-link a:hover {
    text-decoration: underline;
}

.pin-item.is-draggable {
    cursor: grab;
}

.pin-item.is-dragging {
    z-index: 20;
    cursor: grabbing;
}

.pin-item.is-dragging .pin-thumb-wrap {
    transform: scale(1.06);
    box-shadow: 0 16px 28px rgba(0,0,0,0.5);
}

.wall-edit-tip {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 999;
    background: rgba(0,0,0,0.72);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    max-width: 280px;
}

.balele-auth-wrap {
    max-width: 480px;
    margin: 120px auto 40px;
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.balele-auth-wrap h1 {
    margin-top: 0;
    margin-bottom: 18px;
    color: var(--text);
    font-size: 30px;
}

.balele-auth-form p {
    margin-bottom: 14px;
}

.balele-auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
}

.balele-auth-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.balele-auth-form button {
    border: none;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
}

.balele-auth-message {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.balele-auth-error {
    background: #fee2e2;
    color: #991b1b;
}

.balele-auth-success {
    background: #dcfce7;
    color: #166534;
}

.balele-auth-links {
    margin-top: 16px;
    color: #222;
}

.balele-inline-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
}

.balele-inline-check input {
    width: auto;
}

.balele-account-wrap {
    max-width: 1160px;
    margin: 120px auto 40px;
    padding: 0 20px;
    box-sizing: border-box;
    overflow: auto;
    max-height: calc(100vh - 120px);
}

.balele-account-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 26px;
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow-lg);
}

.balele-account-hero h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 32px;
}

.balele-account-hero p {
    margin: 0;
    color: var(--text-soft);
}

.balele-account-meta {
    min-width: 240px;
    color: #222;
    font-size: 14px;
    line-height: 1.8;
}

.balele-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.balele-account-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.balele-account-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.balele-account-card h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 22px;
}

.balele-account-card p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.balele-account-note {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--panel-soft);
    color: #333;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.balele-my-pins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.balele-my-pin-card {
    background: var(--panel);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow-md);
}

.balele-my-pin-card img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    margin-bottom: 12px;
}

.balele-my-pin-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
}

.balele-my-pin-card h2 a {
    text-decoration: none;
    color: #111;
}

.balele-my-pin-meta {
    color: #444;
    font-size: 14px;
    line-height: 1.8;
}

.balele-my-pin-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.balele-inline-button {
    display: inline-block;
    text-decoration: none;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
}

.balele-inline-button-danger {
    background: #b91c1c;
}

.balele-submit-form {
    background: var(--panel);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.balele-submit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.balele-submit-form p {
    margin: 0 0 16px;
}

.balele-submit-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #111;
}

.balele-submit-form input,
.balele-submit-form select,
.balele-submit-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.balele-submit-form button {
    border: none;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .site-header__inner {
        padding: 12px 16px;
    }

    .wall-topbar {
        max-width: 360px;
    }

    .pin-modal-content {
        max-width: 860px;
    }
}

@media (max-width: 900px) {
    html, body {
        overflow: auto;
    }

    .balele-my-pins-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .balele-submit-grid {
        grid-template-columns: 1fr;
    }

    .wall-topbar {
        max-width: 300px;
        top: 82px;
        left: 12px;
    }

    .wall-topbar__card {
        padding: 14px 14px 13px;
    }

    .wall-topbar__title {
        font-size: 22px;
    }

    .wall-topbar__text {
        font-size: 13px;
        line-height: 1.5;
    }

    .pin-modal-layout {
        grid-template-columns: 1fr;
    }

    .pin-modal-media {
        position: static;
    }

    .pin-modal-image-wrap,
    .pin-modal-image {
        max-width: 100%;
    }

    .balele-account-wrap {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .site-nav {
        gap: 8px 10px;
        width: 100%;
        justify-content: flex-start;
    }

    .site-nav a {
        font-size: 13px;
    }

    .site-nav__button {
        padding: 8px 11px;
    }

    .balele-account-hero {
        flex-direction: column;
        padding: 22px;
    }

    .balele-account-grid {
        grid-template-columns: 1fr;
    }

    .wall-topbar {
        top: 106px;
        left: 12px;
        right: auto;
        max-width: 240px;
    }

    .pin-wall-toolbar {
        right: 14px;
        bottom: 14px;
    }

    .toolball-panel {
        min-width: 190px;
    }

    .wall-edit-tip {
        left: 12px;
        bottom: 12px;
        max-width: calc(100vw - 92px);
        font-size: 12px;
        padding: 9px 12px;
    }

    .pin-modal {
        padding: 10px;
    }

    .pin-modal-content {
        width: 100%;
        margin: 1vh auto;
        padding: 14px;
        max-height: 92vh;
        border-radius: 18px;
    }

    .pin-modal-heading h2 {
        font-size: 22px;
    }

    .pin-modal-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pin-modal-card {
        padding: 12px;
    }

    .pin-modal-sale-badge {
        top: 10px;
        left: -6px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .balele-auth-wrap {
        margin: 110px 12px 24px;
        max-width: none;
        padding: 18px;
        border-radius: 18px;
    }

    .balele-account-wrap {
        margin: 118px auto 24px;
        padding: 0 12px;
    }

    .balele-account-hero h1 {
        font-size: 26px;
    }
}

@media (max-width: 640px) {
    .pin-wall-page,
    .pin-wall-app,
    .pin-wall-viewport {
        width: 100vw;
        height: 100dvh;
    }

    .balele-my-pins-grid {
        grid-template-columns: 1fr;
    }

    .toolball-panel {
        min-width: 170px;
        padding: 10px;
        border-radius: 14px;
    }

    .toolball-toggle {
        width: 54px;
        height: 54px;
        font-size: 21px;
    }

    .pin-item {
        width: 84px;
    }

    .pin-thumb-wrap {
        width: 84px;
        height: 84px;
        border-radius: 14px;
    }

    .pin-title {
        font-size: 11px;
        margin-top: 6px;
    }

    .wall-topbar {
        max-width: 220px;
    }

    .wall-topbar__eyebrow {
        font-size: 10px;
    }

    .wall-topbar__title {
        font-size: 20px;
    }

    .wall-topbar__text {
        font-size: 12px;
    }

    .pin-modal-content {
        padding: 12px;
    }

    .pin-modal-kicker {
        font-size: 10px;
    }

    .pin-modal-heading h2 {
        font-size: 20px;
    }

    .site-nav a {
        font-size: 12px;
    }

    .site-nav__button {
        padding: 8px 10px;
    }

    .balele-submit-form,
    .balele-my-pin-card,
    .balele-account-card {
        padding: 14px;
        border-radius: 18px;
    }
}