/* ============================================
   PachiBoard - パチンココミュニティ
   Premium Dark Theme with Neon Accents
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700;900&family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Background */
    --bg-primary: #06060e;
    --bg-secondary: #0c0c1a;
    --bg-tertiary: #12122a;
    --bg-card: rgba(16, 16, 36, 0.85);
    --bg-card-hover: rgba(24, 24, 52, 0.95);
    --bg-glass: rgba(12, 12, 30, 0.6);
    --bg-input: rgba(20, 20, 44, 0.8);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(255, 215, 0, 0.3);

    /* Accent Colors */
    --accent-gold: #ffd700;
    --accent-gold-dim: rgba(255, 215, 0, 0.15);
    --accent-red: #ff2d55;
    --accent-red-dim: rgba(255, 45, 85, 0.15);
    --accent-cyan: #00e5ff;
    --accent-cyan-dim: rgba(0, 229, 255, 0.12);
    --accent-neon: #7c4dff;
    --accent-neon-dim: rgba(124, 77, 255, 0.15);
    --accent-green: #00e676;
    --accent-green-dim: rgba(0, 230, 118, 0.12);
    --accent-pink: #ff4081;
    --accent-orange: #ff9100;

    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: rgba(232, 232, 240, 0.6);
    --text-tertiary: rgba(232, 232, 240, 0.35);
    --text-inverse: #06060e;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
    --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.2);
    --shadow-glow-red: 0 0 20px rgba(255, 45, 85, 0.2);
    --shadow-glow-neon: 0 0 20px rgba(124, 77, 255, 0.2);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-dropdown: 100;
    --z-modal-backdrop: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-tooltip: 500;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(124, 77, 255, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 600px 500px at 80% 70%, rgba(0, 229, 255, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 400px at 50% 90%, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-gold);
}

img {
    max-width: 100%;
    display: block;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Layout ---- */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header / Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
    background: rgba(6, 6, 14, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.navbar-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.navbar-logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.2rem;
    position: relative;
}
.nav-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}
.nav-btn.active {
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.nav-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.nav-user:hover {
    border-color: var(--border-medium);
    background: var(--bg-card-hover);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-neon), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

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

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Page Views ---- */
.page-view {
    display: none;
    animation: fadeInUp 0.3s ease;
}
.page-view.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition: all var(--transition-normal);
}
.card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

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

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- Thread Card ---- */
.thread-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.thread-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}
.thread-card:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow-gold);
    transform: translateY(-2px);
}

.thread-card-cover {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    position: relative;
    overflow: hidden;
}
.thread-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thread-card-cover .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    opacity: 0.3;
}

.thread-card-visibility {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.thread-card-visibility.public {
    background: var(--accent-green-dim);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.3);
}
.thread-card-visibility.private {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    border: 1px solid rgba(255, 45, 85, 0.3);
}

.thread-card-type {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.thread-card-type.pachinko {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.thread-card-type.pachislot {
    background: var(--accent-neon-dim);
    color: var(--accent-neon);
    border: 1px solid rgba(124, 77, 255, 0.3);
}

.thread-card-info {
    padding: 1rem 1.25rem;
}

.thread-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-card-machine {
    font-size: 0.8rem;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.thread-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.thread-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.thread-card-hall {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    color: var(--text-inverse);
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-1px);
}

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

.btn-danger {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    border: 1px solid rgba(255, 45, 85, 0.3);
}
.btn-danger:hover {
    background: rgba(255, 45, 85, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.4rem;
    z-index: var(--z-dropdown);
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-size: 0.92rem;
    line-height: 1.5;
}
.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}
.form-input::placeholder {
    color: var(--text-tertiary);
}

.input-modern {
    width: 100%;
    padding: 0.75rem 1.2rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-size: 0.92rem;
    line-height: 1.5;
}
.input-modern:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}
.input-modern::placeholder {
    color: var(--text-tertiary);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    border-radius: var(--radius-md);
}

.form-select {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2rem;
}
.form-select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.form-switch input[type="checkbox"] {
    display: none;
}

.form-switch .switch-track {
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-fast);
}

.form-switch .switch-thumb {
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all var(--transition-fast);
}

.form-switch input:checked + .switch-track {
    background: var(--accent-gold-dim);
    border-color: var(--accent-gold);
}

.form-switch input:checked + .switch-track .switch-thumb {
    background: var(--accent-gold);
    transform: translateX(20px);
}

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-lg {
    max-width: 720px;
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}
.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-body {
    padding: 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.5rem;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Chat ---- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    max-width: 100%;
}

.chat-header {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.chat-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}
.chat-tabs::-webkit-scrollbar { display: none; }

.chat-tab {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.chat-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.chat-tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
    animation: messageIn 0.2s ease;
}
.chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-neon), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    position: relative;
}
.chat-message.own .chat-bubble {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(124, 77, 255, 0.08));
    border-color: rgba(0, 229, 255, 0.2);
}

.chat-bubble-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 0.15rem;
}

.chat-bubble-text {
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-bubble-time {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
    text-align: right;
}

.chat-bubble-image {
    max-width: 280px;
    border-radius: var(--radius-sm);
    margin-top: 0.3rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.chat-bubble-image:hover {
    transform: scale(1.02);
}

.chat-system-message {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: 0.5rem 1rem;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    align-self: center;
    max-width: 70%;
}

.chat-bonus-record {
    background: var(--accent-gold-dim);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    align-self: center;
    text-align: center;
    max-width: 80%;
}

.chat-bonus-record .bonus-type {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.chat-bonus-record .bonus-detail {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Chat Input */
.chat-input-area {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.chat-input-actions {
    display: flex;
    gap: 0.25rem;
}

.chat-input-wrapper {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    padding: 0.3rem 0.5rem;
    transition: border-color var(--transition-fast);
}
.chat-input-wrapper:focus-within {
    border-color: var(--accent-gold);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.4rem 0.5rem;
    resize: none;
    max-height: 120px;
    min-height: 1.5rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow-gold);
}

/* ---- Album / Photo Grid ---- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform var(--transition-fast);
}
.photo-item:hover {
    transform: scale(1.03);
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Bonus Tracker ---- */
.bonus-tracker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.bonus-counter {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}
.bonus-counter:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow-gold);
}
.bonus-counter:active {
    transform: scale(0.96);
}

.bonus-counter-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.bonus-counter-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.bonus-counter.big .bonus-counter-label { color: var(--accent-red); }
.bonus-counter.big .bonus-counter-value { color: var(--accent-red); }
.bonus-counter.reg .bonus-counter-label { color: var(--accent-cyan); }
.bonus-counter.reg .bonus-counter-value { color: var(--accent-cyan); }
.bonus-counter.at .bonus-counter-label { color: var(--accent-neon); }
.bonus-counter.at .bonus-counter-value { color: var(--accent-neon); }
.bonus-counter.art .bonus-counter-label { color: var(--accent-green); }
.bonus-counter.art .bonus-counter-value { color: var(--accent-green); }
.bonus-counter.rush .bonus-counter-label { color: var(--accent-gold); }
.bonus-counter.rush .bonus-counter-value { color: var(--accent-gold); }
.bonus-counter.rare .bonus-counter-label { color: var(--accent-pink); }
.bonus-counter.rare .bonus-counter-value { color: var(--accent-pink); }

.bonus-game-counter {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bonus-game-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bonus-game-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.bonus-game-controls {
    display: flex;
    gap: 0.25rem;
}

/* ---- Dashboard / Charts ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--transition-normal);
}
.stat-card:hover {
    border-color: var(--border-medium);
}

.stat-card-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.stat-card-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card-change {
    font-size: 0.78rem;
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.stat-card-change.positive {
    color: var(--accent-green);
}
.stat-card-change.negative {
    color: var(--accent-red);
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* ---- Login Page ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    text-align: center;
}

.login-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange), var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
}

.login-error {
    background: var(--accent-red-dim);
    color: var(--accent-red);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 45, 85, 0.2);
}

.login-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 1.5rem;
}

.login-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.login-tab.active {
    background: var(--accent-gold);
    color: var(--text-inverse);
}

/* ---- Dropdown Menu ---- */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    display: none;
    animation: scaleIn 0.15s ease;
    overflow: hidden;
}
.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background: var(--bg-card);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.25rem 0;
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    top: 72px;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideInRight 0.3s ease;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-cyan); }
.toast.warning { border-left: 3px solid var(--accent-orange); }

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.82rem;
    font-weight: 600;
}

.toast-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title-icon {
    font-size: 1.3rem;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.empty-state-text {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ---- Upload Area ---- */
.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.upload-area:hover {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
}
.upload-area.dragover {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
    transform: scale(1.01);
}

.upload-area-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.upload-area-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-area-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.3rem;
}

.upload-preview {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.upload-preview-item {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- AI Analysis Result ---- */
.ai-result {
    background: linear-gradient(135deg, var(--accent-neon-dim), var(--accent-cyan-dim));
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.ai-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-neon);
}

.ai-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ai-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ai-result-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-result-value {
    font-size: 0.88rem;
    font-weight: 500;
}

/* ---- DMM Link Badge ---- */
.dmm-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: #90caf9;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.dmm-link:hover {
    background: linear-gradient(135deg, #283593, #1565c0);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.3);
    color: #bbdefb;
}

/* ---- Loading / Spinner ---- */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- Tabs ---- */
.tab-list {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.tab-item {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tab-item:hover {
    color: var(--text-primary);
}
.tab-item.active {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

/* ---- Utility ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-lg { gap: 1rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-cyan { color: var(--accent-cyan); }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Orbitron', monospace; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .thread-grid {
        grid-template-columns: 1fr;
    }

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

    .chat-message {
        max-width: 90%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .bonus-tracker {
        grid-template-columns: repeat(3, 1fr);
    }

    .navbar {
        padding: 0 1rem;
    }

    .nav-user-name {
        display: none;
    }

    .modal {
        border-radius: var(--radius-lg);
        max-height: 85vh;
    }

    .login-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .bonus-tracker {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-result-grid {
        grid-template-columns: 1fr;
    }
}
