/* =============================================================================
   WOS Tundra Tracker — Dark Game UI
   Self-contained. No Tailwind. Montserrat loaded via WordPress enqueue.
   ============================================================================= */

/* --- Custom Properties --- */
:root {
    --t-bg:           #050a14;
    --t-bg-card:      #1e293b;
    --t-bg-deep:      #0f172a;
    --t-bg-input:     #0f172a;
    --t-border:       #334155;
    --t-border-light: #475569;
    --t-text:         #e2e8f0;
    --t-text-muted:   #94a3b8;
    --t-text-faint:   #64748b;
    --t-primary:      #2563eb;
    --t-primary-dark: #1d4ed8;
    --t-primary-glow: rgba(37, 99, 235, 0.4);
    --t-sky:          #38bdf8;
    --t-sky-glow:     rgba(56, 189, 248, 0.3);
    --t-green:        #4ade80;
    --t-amber:        #f59e0b;
    --t-amber-glow:   rgba(245, 158, 11, 0.2);
    --t-red:          #ef4444;
    --t-radius:       10px;
    --t-radius-lg:    16px;
}

/* --- Base Reset --- */
#wos-tundra-app *,
#wos-tundra-app *::before,
#wos-tundra-app *::after {
    box-sizing: border-box;
}

#wos-tundra-app {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: none;
    color: var(--t-text);
    min-height: 80vh;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* Prevent iOS zoom on input focus */
#wos-tundra-app input[type="text"],
#wos-tundra-app input[type="password"],
#wos-tundra-app input[type="number"] {
    font-size: 16px !important;
}

/* Scrollbar */
#wos-tundra-app ::-webkit-scrollbar { width: 4px; }
#wos-tundra-app ::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
#wos-tundra-app ::-webkit-scrollbar-thumb { background: var(--t-border); border-radius: 10px; }

/* --- Main Content Area --- */
#content-area {
    flex: 1;
    padding: 0;
    padding-bottom: 120px;
    overflow-y: auto;
}

/* --- Game Button --- */
.wos-game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border: 2px solid #60a5fa;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.15);
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
    min-height: 36px;
}
.wos-game-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.wos-game-btn:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

/* Standard action button (auth forms etc.) */
.wos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: var(--t-primary);
    color: #fff;
    border: none;
    border-radius: var(--t-radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}
.wos-btn:hover { background: var(--t-primary-dark); }
.wos-btn:active { transform: scale(0.98); }
.wos-btn.secondary {
    background: var(--t-bg-card);
    border: 1px solid var(--t-border);
    color: var(--t-text);
}

/* --- Progress Bar --- */
.wos-progress-track {
    background: rgba(0,0,0,0.5);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    height: 10px;
    position: relative;
}
.wos-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.wos-progress-fill.complete {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

/* --- Commander Summary Box --- */
.wos-commander-box {
    background: var(--t-bg-card);
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.wos-commander-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,0.12) 0%, transparent 60%);
    pointer-events: none;
}
.wos-commander-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}
.wos-commander-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}
.wos-commander-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--t-bg-deep);
    border: 2px solid var(--t-sky);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--t-sky-glow);
}
.wos-commander-label {
    font-size: 10px;
    color: var(--t-sky);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.wos-commander-name {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--t-text);
    line-height: 1;
    margin-bottom: 6px;
}
.wos-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    color: var(--t-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wos-verified-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--t-green);
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.wos-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wos-stat-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 72px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.wos-stat-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
}
.wos-stat-box.blue::after  { background: var(--t-sky); }
.wos-stat-box.green::after { background: var(--t-green); }
.wos-stat-box.amber::after { background: var(--t-amber); }
.wos-stat-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--t-text-faint);
    margin-bottom: 4px;
}
.wos-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
    color: var(--t-text);
}
.wos-stat-value.blue  { color: var(--t-sky); }
.wos-stat-value.green { color: var(--t-green); }
.wos-stat-value.amber { color: var(--t-amber); }
.wos-stat-value .sub {
    font-size: 0.75rem;
    color: var(--t-text-faint);
    font-weight: 600;
}
.wos-global-progress {
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

/* --- Section Title --- */
.wos-section-title {
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: transparent;
    background: linear-gradient(90deg, var(--t-sky), var(--t-primary));
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 16px;
}

/* --- Album Banner Cards --- */
.wos-albums-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .wos-albums-grid { grid-template-columns: repeat(3, 1fr); }
}
.wos-album-card {
    background-color: var(--t-bg-card);
    background-image: linear-gradient(45deg, #1e3a8a, #0ea5e9);
    border-radius: var(--t-radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--t-border);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.wos-album-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15,23,42,0.92), rgba(15,23,42,0.5));
}
.wos-album-card:hover {
    transform: translateY(-3px);
    border-color: var(--t-sky);
    box-shadow: 0 0 20px var(--t-sky-glow);
}
.wos-album-card:active { transform: translateY(-1px); }
.wos-album-card-inner {
    position: relative;
    z-index: 1;
}
.wos-album-eyebrow {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--t-sky);
    margin-bottom: 4px;
}
.wos-album-name {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.wos-album-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--t-text-muted);
}
.wos-album-progress-label .count {
    color: var(--t-text);
}

/* --- Puzzle List Cards --- */
.wos-puzzles-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .wos-puzzles-list { grid-template-columns: repeat(3, 1fr); }
}
.wos-puzzle-card {
    background: linear-gradient(90deg, var(--t-bg-deep) 0%, var(--t-bg-card) 100%);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    padding: 12px;
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.wos-puzzle-card:hover {
    border-color: var(--t-border-light);
    background: linear-gradient(90deg, var(--t-bg-card) 0%, var(--t-border) 100%);
}
.wos-puzzle-icon {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--t-bg-deep);
    border: 2px solid var(--t-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.wos-puzzle-icon.complete {
    border-color: #16a34a;
    box-shadow: 0 0 10px rgba(22,163,74,0.3);
}
.wos-puzzle-done-label {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #16a34a;
    text-align: center;
    font-size: 7px;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
    line-height: 1.4;
    padding: 1px 0;
}
.wos-puzzle-info { flex: 1; min-width: 0; }
.wos-puzzle-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--t-text);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wos-puzzle-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: var(--t-text-faint);
    margin-bottom: 5px;
}
.wos-puzzle-meta .collected { color: var(--t-sky); }
.wos-puzzle-meta .collected.done { color: var(--t-green); }
.wos-puzzle-chevron {
    color: var(--t-text-faint);
    flex-shrink: 0;
    font-size: 1rem;
}

/* --- Pieces Header Box --- */
.wos-pieces-header {
    background: var(--t-bg-card);
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-lg);
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.wos-pieces-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15,23,42,0.9), transparent);
    pointer-events: none;
}
.wos-pieces-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    min-width: 0;
}
.wos-back-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(71, 85, 105, 0.5);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    color: var(--t-text);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}
.wos-back-btn:hover { background: var(--t-border); }
.wos-pieces-breadcrumb { min-width: 0; }
.wos-pieces-album-label {
    font-size: 9px;
    color: var(--t-sky);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wos-pieces-puzzle-name {
    font-size: 1rem;
    font-weight: 900;
    color: var(--t-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wos-pieces-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.wos-pieces-counter {
    background: rgba(15,23,42,0.8);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    min-width: 56px;
}
.wos-pieces-counter .count {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--t-text);
}
.wos-pieces-counter .count.done { color: var(--t-green); }
.wos-pieces-counter .total {
    font-size: 11px;
    color: var(--t-text-faint);
}

/* --- Inter-Puzzle Navigation Arrows --- */
.wos-puzzle-nav-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 16px;
    /* Allow arrows to sit outside the grid without being clipped */
    overflow: visible;
}
.wos-puzzle-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.92);
    border: 2px solid var(--t-border);
    color: var(--t-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.wos-puzzle-nav-btn:hover { background: var(--t-bg-card); border-color: var(--t-border-light); }
.wos-puzzle-nav-btn.prev { left: 8px; }
.wos-puzzle-nav-btn.next { right: 8px; }

/* --- Piece Cards Grid --- */
.wos-pieces-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 4px;
}
@media (min-width: 480px) {
    .wos-pieces-grid { gap: 12px; padding: 0 24px; }
}
@media (min-width: 768px) {
    .wos-pieces-grid {
        grid-template-columns: repeat(3, 120px);
        justify-content: center;
        padding: 0 32px;
        gap: 12px;
    }
}

.wos-piece-card {
    border-radius: 8px;
    background: var(--t-bg-deep);
    border: 2px solid var(--t-border);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px 6px 6px;
    transition: all 0.15s ease;
    user-select: none;
    aspect-ratio: 1 / 1.15;
}
.wos-piece-card.state-need {
    opacity: 0.65;
    filter: grayscale(70%);
}
.wos-piece-card.state-have {
    border-color: var(--t-sky);
    background: linear-gradient(135deg, var(--t-bg-deep), #1e3a8a);
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px var(--t-sky-glow);
}
.wos-piece-card.state-dup {
    border-color: var(--t-amber);
    background: linear-gradient(135deg, var(--t-bg-card), #78350f);
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px var(--t-amber-glow);
}
.wos-piece-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    padding-top: 4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.wos-piece-body:hover {
    opacity: 0.82;
    transition: opacity 0.15s;
}
.wos-badge-check,
.wos-badge-qty {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--t-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}
.wos-badge-check { background: #10b981; color: #fff; }
.wos-badge-qty   { background: var(--t-red); color: #fff; }
.wos-piece-number {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--t-text);
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.wos-piece-stars {
    color: var(--t-amber);
    font-size: 0.7rem;
    letter-spacing: -1px;
    line-height: 1;
}
.wos-no-trade-label {
    font-size: 7px;
    font-weight: 700;
    color: var(--t-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
    opacity: 0.6;
}

/* --- Piece Controls (+/-) --- */
.wos-piece-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    background: var(--t-bg-deep);
    border-radius: 6px;
    border: 1px solid var(--t-border);
    overflow: hidden;
    width: 100%;
    height: 28px;
}
.wos-piece-controls button {
    width: 28px;
    height: 100%;
    background: rgba(71,85,105,0.4);
    border: none;
    color: var(--t-text);
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}
.wos-piece-controls button:hover { background: var(--t-primary); }
.wos-dupe-count {
    flex: 1;
    text-align: center;
    color: var(--t-text);
    font-size: 13px;
    font-weight: 900;
    font-family: inherit;
    line-height: 28px;
    pointer-events: none;
}

/* --- Floating Vertical Nav Pill --- */
#nav-area {
    position: fixed;
    left: 12px;
    bottom: 16px;
    z-index: 50;
}
.wos-nav-pill {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--t-border);
    border-radius: 9999px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.wos-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--t-border);
    background: var(--t-bg-card);
    color: var(--t-text-faint);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: inherit;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
    position: relative;
}
.wos-nav-btn .nav-icon { font-size: 1.1rem; line-height: 1; }
.wos-nav-btn:hover { color: var(--t-text); border-color: var(--t-border-light); }
.wos-nav-btn.active {
    background: linear-gradient(180deg, var(--t-primary) 0%, var(--t-primary-dark) 100%);
    border-color: #60a5fa;
    color: #fff;
    box-shadow: 0 0 14px var(--t-primary-glow);
}
.wos-nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--t-red);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    border: 2px solid var(--t-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* --- Exchange Center --- */
.wos-exchange-header {
    background: var(--t-bg-card);
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.wos-exchange-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(37,99,235,0.15), transparent);
    pointer-events: none;
}
.wos-exchange-title {
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: transparent;
    background: linear-gradient(90deg, var(--t-sky), var(--t-primary));
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}
.wos-exchange-subtitle {
    font-size: 13px;
    color: var(--t-text-muted);
    position: relative;
    z-index: 1;
}
.wos-tab-switcher {
    display: flex;
    background: rgba(15,23,42,0.8);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: 4px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}
.wos-tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--t-text-faint);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}
.wos-tab-btn.active {
    background: var(--t-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.4);
}
.wos-tab-btn:hover:not(.active) { color: var(--t-text); }

/* Match Cards Grid */
.wos-matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px)  { .wos-matches-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .wos-matches-grid { grid-template-columns: repeat(3, 1fr); } }

.wos-match-card {
    background: var(--t-bg-card);
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-lg);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.wos-match-card:hover {
    border-color: var(--t-sky);
    background: rgba(30,41,59,0.8);
}
.wos-match-piece-badge {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--t-bg-deep);
    border: 1px solid var(--t-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.wos-match-piece-num {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--t-sky);
    line-height: 1;
}
.wos-match-piece-stars {
    color: var(--t-amber);
    font-size: 7px;
    letter-spacing: -0.5px;
    margin-top: 3px;
}
.wos-match-info { flex: 1; min-width: 0; }
.wos-match-album {
    font-size: 9px;
    color: var(--t-sky);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wos-match-puzzle {
    font-size: 13px;
    font-weight: 700;
    color: var(--t-text);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wos-match-user-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--t-text-muted);
}
.wos-match-user-count .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wos-match-user-count .dot.green { background: var(--t-green); box-shadow: 0 0 4px var(--t-green); }
.wos-match-user-count .dot.amber { background: var(--t-amber); box-shadow: 0 0 4px var(--t-amber); }
.wos-match-chevron { color: var(--t-text-faint); font-size: 1rem; }
.wos-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed var(--t-border);
    border-radius: var(--t-radius-lg);
    color: var(--t-text-faint);
    font-weight: 700;
    font-size: 13px;
}

/* --- Trade Modal --- */
.wos-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5,10,20,0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.2s;
}
.wos-modal-overlay.visible { opacity: 1; }
.wos-modal-content {
    background: var(--t-bg-card);
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.92);
    transition: transform 0.2s;
    overflow: hidden;
}
.wos-modal-overlay.visible .wos-modal-content { transform: scale(1); }
.wos-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--t-border);
    background: rgba(15,23,42,0.5);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.wos-modal-piece-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wos-modal-piece-badge {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--t-bg-deep);
    border: 1px solid var(--t-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wos-modal-piece-badge .num {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--t-text);
    line-height: 1;
}
.wos-modal-piece-details .album {
    font-size: 9px;
    color: var(--t-sky);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 3px;
}
.wos-modal-piece-details .puzzle {
    font-size: 1rem;
    font-weight: 900;
    color: var(--t-text);
    line-height: 1.2;
}
.wos-modal-piece-details .stars {
    color: var(--t-amber);
    font-size: 11px;
    letter-spacing: -0.5px;
    margin-top: 3px;
}
.wos-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--t-bg-card);
    border: 1px solid var(--t-border);
    color: var(--t-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.wos-modal-close:hover { background: var(--t-border); color: var(--t-text); }
.wos-modal-body {
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-width: 0;
}
.wos-modal-list-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--t-text-faint);
    margin-bottom: 10px;
}
.wos-modal-member-row {
    width: 100%;
    box-sizing: border-box;
    background: rgba(71,85,105,0.2);
    border: 1px solid var(--t-border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 8px;
    text-align: left;
    min-width: 0;
    overflow: hidden;
}
.wos-modal-member-row:hover {
    background: rgba(71,85,105,0.4);
    border-color: var(--t-sky);
}
.wos-member-identity { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; overflow: hidden; }
.wos-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--t-bg-deep);
    border: 1px solid var(--t-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.wos-member-name { font-size: 13px; font-weight: 700; color: var(--t-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wos-member-fid  { font-size: 11px; color: var(--t-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wos-copy-btn {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--t-sky);
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.25);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.wos-copy-btn:hover {
    background: var(--t-sky);
    color: #0f172a;
    border-color: transparent;
}
.wos-modal-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 8px;
    font-size: 11px;
    color: #fbbf24;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* --- Toast Notification --- */
.wos-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--t-bg-card);
    border: 1px solid var(--t-border);
    color: var(--t-text);
    padding: 10px 20px;
    border-radius: 9999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
}
.wos-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.wos-toast .toast-icon { color: var(--t-green); font-size: 1rem; }

/* --- Auth Form --- */
.wos-auth-wrap {
    max-width: 380px;
    margin: 40px auto;
    padding: 28px 24px;
    background: var(--t-bg-card);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-lg);
}
.wos-auth-wrap h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 900;
    text-align: center;
    color: var(--t-text);
}
.wos-auth-wrap p {
    text-align: center;
    font-size: 13px;
    color: var(--t-text-faint);
    margin-bottom: 24px;
}
.wos-auth-wrap input {
    width: 100%;
    padding: 12px 14px;
    background: var(--t-bg-deep);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius);
    color: var(--t-text);
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.wos-auth-wrap input:focus { border-color: var(--t-primary); }
.wos-auth-wrap input::placeholder { color: var(--t-text-faint); }
.wos-auth-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.wos-auth-btn-row .wos-btn { flex: 1; }
.wos-auth-msg {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--t-red);
    min-height: 18px;
}

/* --- Verification Box --- */
.wos-verify-box {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.25), rgba(30, 41, 59, 0.9));
    border: 1px solid var(--t-amber);
    border-radius: var(--t-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.wos-verify-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(245,158,11,0.06), transparent);
    pointer-events: none;
}
.wos-verify-box-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.wos-verify-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.wos-verify-title {
    font-size: 13px;
    font-weight: 900;
    color: var(--t-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}
.wos-verify-msg {
    font-size: 13px;
    color: var(--t-text);
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}
.wos-verify-hint {
    font-size: 11px;
    color: var(--t-text-muted);
    line-height: 1.4;
}
.wos-verify-cta {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4), inset 0 1px 3px rgba(255,255,255,0.2);
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
}
.wos-verify-cta:hover {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}
.wos-verify-cta:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* --- PIN Banner (legacy, unused) --- */
.wos-pin-banner {
    background: rgba(30,41,59,0.95);
    border-bottom: 1px solid var(--t-amber);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
}
.wos-pin-banner strong {
    display: block;
    font-size: 12px;
    color: var(--t-amber);
    margin-bottom: 2px;
}
.wos-pin-banner span { font-size: 11px; color: var(--t-text-muted); }
.wos-pin-input-row {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.wos-pin-banner input {
    width: 60px;
    padding: 8px;
    text-align: center;
    background: var(--t-bg-deep);
    border: 1px solid var(--t-border);
    border-radius: 6px;
    color: var(--t-text);
    font-family: inherit;
    font-size: 16px;
    margin-bottom: 0 !important;
    outline: none;
}
.wos-pin-banner .wos-btn {
    padding: 8px 14px;
    min-height: 38px;
    font-size: 12px;
    width: auto;
}

/* --- Loading State --- */
.wos-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--t-text-muted);
    font-size: 13px;
    font-weight: 600;
}
.wos-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--t-border);
    border-top-color: var(--t-primary);
    border-radius: 50%;
    margin: 16px auto 0;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
