/* ============================================
   CardHunter — Premium Dark Theme
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-base: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a28;
    --bg-hover: #22223a;
    --bg-input: #15152a;

    --border-subtle: rgba(139, 92, 246, 0.12);
    --border-default: rgba(139, 92, 246, 0.2);
    --border-strong: rgba(139, 92, 246, 0.35);

    --text-primary: #f0eef6;
    --text-secondary: #9896a8;
    --text-muted: #5d5b6e;
    --text-inverse: #0a0a0f;

    --accent-primary: #8B5CF6;
    --accent-primary-hover: #7C3AED;
    --accent-secondary: #06B6D4;
    --accent-success: #10B981;
    --accent-warning: #F59E0B;
    --accent-danger: #EF4444;

    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    --gradient-surface: linear-gradient(180deg, rgba(139, 92, 246, 0.04) 0%, rgba(6, 182, 212, 0.02) 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Ambient Background --- */
.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    top: 40%;
    right: -150px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 30s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.03); }
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Countdown Badge --- */
.countdown-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    overflow: hidden;
    min-width: 180px;
}

.countdown-icon {
    color: var(--accent-primary);
    opacity: 0.8;
    flex-shrink: 0;
    animation: countdownPulse 2s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.countdown-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.countdown-time {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    min-width: 36px;
    text-align: right;
}

.countdown-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transition: width 1s linear;
    width: 100%;
}

.countdown-badge.scanning {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.06);
}

.countdown-badge.scanning .countdown-time {
    color: var(--accent-success);
}

.countdown-badge.scanning .countdown-icon {
    color: var(--accent-success);
    animation: spin 1s linear infinite;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.45rem 0.65rem;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
}

.btn-add {
    padding: 0.55rem 1.2rem;
}

/* --- Stats Bar --- */
.stats-bar {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- Main Content --- */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 1.5rem auto 3rem;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Sections --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-header h2 svg {
    color: var(--accent-primary);
    opacity: 0.8;
}

/* --- Add Card Section --- */
.add-card-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    background-image: var(--gradient-surface);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 150px auto;
    gap: 0.85rem;
    align-items: end;
}

.form-row-url {
    grid-template-columns: 1fr 150px auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-control-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

.form-control-mono {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239896a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
}

/* --- URL Input --- */
.url-input-wrapper {
    position: relative;
}

.url-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.url-input-wrapper .form-control {
    padding-left: 2.2rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.section-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- Search Wrapper --- */
.search-wrapper {
    position: relative;
}

.search-spinner {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.search-result-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(139, 92, 246, 0.08);
}

.search-result-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-result-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-success);
    white-space: nowrap;
}

/* --- Price Input --- */
.price-input-wrapper {
    position: relative;
}

.price-prefix {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.price-input-wrapper .form-control {
    padding-left: 1.5rem;
}

/* --- Selected Card Preview --- */
.selected-card-preview {
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.preview-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    color: white;
}

.preview-expansion {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.preview-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-id {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.preview-id code {
    font-family: var(--font-mono);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

/* --- Watchlist Controls --- */
.watchlist-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Watchlist Section --- */
.watchlist-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.watchlist-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.watchlist-table {
    width: 100%;
    border-collapse: collapse;
}

.watchlist-table th {
    text-align: left;
    padding: 0.65rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.watchlist-table td {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.watchlist-table tbody tr {
    transition: background var(--transition-fast);
}

.watchlist-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.04);
}

.watchlist-table tbody tr:last-child td {
    border-bottom: none;
}

.th-game { width: 100px; }
.th-target, .th-current { width: 110px; }
.th-status { width: 110px; }
.th-actions { width: 90px; text-align: center; }

/* Game badges */
.game-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.game-badge[data-game="pokemon"] {
    background: rgba(255, 203, 5, 0.12);
    color: #FFCB05;
    border: 1px solid rgba(255, 203, 5, 0.2);
}
.game-badge[data-game="yugioh"] {
    background: rgba(156, 39, 176, 0.12);
    color: #CE93D8;
    border: 1px solid rgba(156, 39, 176, 0.2);
}
.game-badge[data-game="digimon"] {
    background: rgba(33, 150, 243, 0.12);
    color: #64B5F6;
    border: 1px solid rgba(33, 150, 243, 0.2);
}
.game-badge[data-game="onepiece"] {
    background: rgba(244, 67, 54, 0.12);
    color: #EF5350;
    border: 1px solid rgba(244, 67, 54, 0.2);
}
.game-badge[data-game="unionarena"] {
    background: rgba(76, 175, 80, 0.12);
    color: #81C784;
    border: 1px solid rgba(76, 175, 80, 0.2);
}
.game-badge[data-game="starwars"] {
    background: rgba(255, 235, 59, 0.12);
    color: #FFF176;
    border: 1px solid rgba(255, 235, 59, 0.2);
}
.game-badge[data-game="magic"] {
    background: rgba(139, 92, 246, 0.12);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Card name in table */
.card-name-cell {
    font-weight: 600;
}

.card-name-cell a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.card-name-cell a:hover {
    color: var(--accent-primary);
}

/* Price cells */
.price-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
}

.price-target {
    color: var(--text-secondary);
}

.price-current {
    color: var(--text-primary);
}

.price-current.below-target {
    color: var(--accent-success);
}

.price-current.above-target {
    color: var(--accent-danger);
}

.price-unknown {
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 0.78rem;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-below {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.status-above {
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.status-badge.status-unknown {
    background: rgba(245, 158, 11, 0.08);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Action buttons in table */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
}

.btn-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.btn-icon.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-danger);
}

.btn-icon.spinning svg {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 95%;
    max-width: 560px;
    max-height: 85vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.25s ease-out;
    overflow: hidden;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.modal-header h2 svg {
    color: var(--accent-primary);
}

.modal-close {
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
}

.settings-group h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.5;
}

.form-hint a {
    color: var(--accent-primary);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.form-hint code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.token-input-wrapper {
    display: flex;
    gap: 0.35rem;
}

.token-input-wrapper .form-control {
    flex: 1;
}

.api-test-result {
    margin-top: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 500;
    animation: slideIn 0.2s ease-out;
}

.api-test-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.api-test-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toastSlide 0.3s ease-out;
    max-width: 380px;
}

.toast.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.toast-info {
    border-color: rgba(139, 92, 246, 0.3);
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.toast.removing {
    animation: toastRemove 0.25s ease-in forwards;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastRemove {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* --- Editable Price --- */
.editable-price {
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.editable-price:hover {
    background: rgba(139, 92, 246, 0.1);
}

.edit-price-input {
    width: 80px;
    padding: 0.2rem 0.4rem;
    background: var(--bg-input);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* --- Expansion text --- */
.expansion-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.65rem 1rem;
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .stats-bar {
        padding: 0 1rem;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .main-content {
        padding: 0 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .watchlist-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .status-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

/* --- No select for interactive elements --- */
.btn, .search-result-item, .game-badge, .status-badge {
    user-select: none;
}
