/* ============================================
   JoinGY — Elegant Minimal UI
   Font: Space Grotesk (Grotesque Sans-Serif)
   Dark/Light Theme Support
   ============================================ */

/* ---- Dark Theme (default) ---- */
:root,
[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-surface: #141419;
    --bg-elevated: #1a1a22;
    --bg-hover: #1f1f2a;
    --bg-input: #111116;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(139, 124, 246, 0.5);
    --text: #e8e8ec;
    --text-dim: #7a7a8c;
    --text-faint: #4e4e5e;
    --accent: #8b7cf6;
    --accent-hover: #9d90f8;
    --accent-glow: rgba(139, 124, 246, 0.15);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.12);
    --amber: #fbbf24;
    --amber-dim: rgba(251, 191, 36, 0.12);
    --rose: #f472b6;
    --self-bg: #8b7cf6;
    --stranger-bg: #1a1a22;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(139, 124, 246, 0.1);
    --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --toggle-thumb-x: 2px;
    --toggle-track-bg: #1f1f2a;
    --toggle-thumb-bg: #2a2a38;
}

/* ---- Light Theme ---- */
[data-theme="light"] {
    --bg: #f4f3f0;
    --bg-surface: #ffffff;
    --bg-elevated: #fafaf8;
    --bg-hover: #eeedea;
    --bg-input: #f0efec;
    --border: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.13);
    --border-focus: rgba(109, 90, 220, 0.45);
    --text: #1a1a2e;
    --text-dim: #6b6b80;
    --text-faint: #9b9baf;
    --accent: #6d5adc;
    --accent-hover: #5b47cc;
    --accent-glow: rgba(109, 90, 220, 0.12);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.1);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.08);
    --amber: #d97706;
    --amber-dim: rgba(217, 119, 6, 0.08);
    --rose: #ec4899;
    --self-bg: #6d5adc;
    --stranger-bg: #ffffff;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(109, 90, 220, 0.08);
    --toggle-thumb-x: 26px;
    --toggle-track-bg: #e8e7e4;
    --toggle-thumb-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.18);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes subtleFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.06;
    }

    50% {
        transform: translate(10px, -15px) scale(1.03);
        opacity: 0.09;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.92);
    }
}

@keyframes dotBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.25;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(139, 124, 246, 0.2);
        box-shadow: 0 0 15px rgba(139, 124, 246, 0.05);
    }

    50% {
        border-color: rgba(139, 124, 246, 0.4);
        box-shadow: 0 0 25px rgba(139, 124, 246, 0.1);
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 2px 16px rgba(139, 124, 246, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 24px rgba(139, 124, 246, 0.35);
    transform: translateY(-2px);
}

.btn-glow {
    position: relative;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(139, 124, 246, 0.4), rgba(244, 114, 182, 0.3), rgba(139, 124, 246, 0.4));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-glow:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-action {
    background: var(--red);
    color: #fff;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
    border: none;
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.2);
}

.btn-action:hover {
    box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3);
    transform: translateY(-1px);
}

.btn-action.btn-new-chat {
    background: var(--green);
    box-shadow: 0 2px 12px rgba(52, 211, 153, 0.2);
}

.btn-action.btn-new-chat:hover {
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

.btn-action.btn-waiting {
    background: var(--bg-surface);
    color: var(--text-faint);
    border: 1px solid var(--border);
    cursor: default;
    box-shadow: none;
}

.btn-action.btn-confirm {
    background: var(--amber);
    color: #111;
}

.btn-send {
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(139, 124, 246, 0.2);
    transition: all var(--transition);
}

.btn-send:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-send:not(:disabled):hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(139, 124, 246, 0.3);
    transform: translateY(-1px);
}

.coming-soon-tag {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-faint);
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

/* ============================================
   LANDING PAGE
   ============================================ */
#landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    background: var(--bg);
}

/* Ambient background — subtle gradient orbs */
.landing-bg-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -180px;
    left: -120px;
    animation: subtleFloat 20s ease-in-out infinite;
    opacity: 0.05;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--rose);
    bottom: -150px;
    right: -100px;
    animation: subtleFloat 25s ease-in-out infinite reverse;
    opacity: 0.04;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--green);
    top: 50%;
    left: 65%;
    animation: subtleFloat 18s ease-in-out infinite 5s;
    opacity: 0.03;
}

/* Header */
.landing-header {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 36px;
    z-index: 1;
    animation: fadeIn 0.8s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    opacity: 0.9;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-sm .logo-icon {
    font-size: 20px;
}

.logo-sm .logo-text {
    font-size: 18px;
}

.online-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: pulse 2.5s ease-in-out infinite;
}

/* Hero */
.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
    z-index: 1;
    max-width: 660px;
}

.hero-title {
    font-size: clamp(38px, 6vw, 60px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text);
    animation: fadeInUp 0.7s ease both;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--rose) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 440px;
    font-weight: 400;
    animation: fadeInUp 0.7s ease 0.1s both;
}

/* Terms */
.terms-box {
    margin-bottom: 28px;
    animation: fadeInUp 0.7s ease 0.2s both;
}

.terms-box.shake {
    animation: shake 0.4s ease;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-hover);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    background: var(--bg-surface);
}

.checkbox-container input:checked+.checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-container input:checked+.checkmark::after {
    content: '✓';
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.terms-text a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.terms-text a:hover {
    color: var(--accent-hover);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 56px;
    animation: fadeInUp 0.7s ease 0.3s both;
}

/* Features */
.features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.7s ease 0.45s both;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: default;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    background: var(--bg-elevated);
}

.feature-icon {
    font-size: 22px;
}

.feature-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ============================================
   CHAT PAGE
   ============================================ */
#chat-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    z-index: 10;
    backdrop-filter: blur(12px);
}

.chat-header-left,
.chat-header-right {
    flex: 1;
}

.chat-header-right {
    display: flex;
    justify-content: flex-end;
}

.chat-header-center {
    flex: 0 0 auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all var(--transition);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transition: all var(--transition);
}

.status-waiting {
    background: var(--amber-dim);
    color: var(--amber);
}

.status-waiting .status-dot {
    background: var(--amber);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-connected {
    background: var(--green-dim);
    color: var(--green);
}

.status-connected .status-dot {
    background: var(--green);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.status-disconnected {
    background: var(--red-dim);
    color: var(--red);
}

.status-disconnected .status-dot {
    background: var(--red);
}

/* Chatroom */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chatroom {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Messages */
.msg {
    max-width: 72%;
    padding: 11px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    animation: msgIn 0.3s ease;
    word-wrap: break-word;
}

.msg-self {
    align-self: flex-end;
    background: var(--self-bg);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 14px rgba(139, 124, 246, 0.2);
}

.msg-stranger {
    align-self: flex-start;
    background: var(--stranger-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 6px;
}

.msg-system {
    align-self: center;
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    padding: 10px 0;
    max-width: 100%;
    letter-spacing: 0.02em;
}

.msg-system.connected {
    color: var(--green);
    font-weight: 600;
}

.msg-system.disconnected {
    color: var(--red);
    font-weight: 600;
}

.msg-system.waiting {
    color: var(--amber);
}

.msg-system.error-msg {
    color: var(--red);
}

/* Typing indicator */
.typing-indicator {
    padding: 8px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Input bar */
.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    flex: 1;
}

.input-wrapper textarea {
    width: 100%;
    padding: 12px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    max-height: 120px;
    line-height: 1.5;
}

.input-wrapper textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-surface);
}

.input-wrapper textarea::placeholder {
    color: var(--text-faint);
}

.input-wrapper textarea:disabled {
    opacity: 0.3;
}

/* Report link */
.report-link {
    color: var(--text-faint);
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition);
    letter-spacing: 0.02em;
}

.report-link:hover {
    color: var(--rose);
}

.report-done {
    color: var(--green) !important;
    cursor: default;
}

/* ============================================
   AD CONTAINER
   ============================================ */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 64px;
    min-width: 468px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 16px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    overflow: hidden;
    opacity: 0.85;
    transition: opacity var(--transition);
    z-index: 1;
}

.ad-container:hover {
    opacity: 1;
}

/* Ensure the injected iframe fills properly */
.ad-container iframe {
    display: block;
    max-width: 100%;
    border: none;
}

/* ============================================
   STATIC PAGES (Privacy, Rules, Blog)
   ============================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
}

/* Page Header / Nav */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 36px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.page-header .logo {
    text-decoration: none;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.page-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
    letter-spacing: 0.01em;
}

.page-nav a:hover {
    color: var(--text);
}

/* Page Content Area */
.page-content {
    flex: 1;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.page-hero {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease both;
}

.page-hero h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--text);
    margin-bottom: 8px;
}

.page-hero-sub {
    font-size: 14px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

/* Content Cards */
.content-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease both;
}

.content-card:nth-child(2) {
    animation-delay: 0.05s;
}

.content-card:nth-child(3) {
    animation-delay: 0.1s;
}

.content-card:nth-child(4) {
    animation-delay: 0.15s;
}

.content-card:nth-child(5) {
    animation-delay: 0.2s;
}

.content-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.content-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 8px;
}

.content-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.content-card ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.content-card ul li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    padding: 4px 0 4px 20px;
    position: relative;
}

.content-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

.content-card a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

.content-card a:hover {
    color: var(--accent-hover);
}

/* Rules Highlight Card */
.rules-highlight {
    border-color: rgba(251, 191, 36, 0.2);
    background: var(--amber-dim);
}

.rules-highlight .rule-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.rules-highlight h2 {
    color: var(--amber);
}

/* Numbered Rule Items */
.rule-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.rule-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rule-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.rule-item h3 {
    margin-top: 0;
    margin-bottom: 4px;
}

.rule-item p {
    margin-bottom: 0;
}

/* ============================================
   BLOG
   ============================================ */
.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    transition: all var(--transition);
    animation: fadeInUp 0.5s ease both;
    position: relative;
}

.blog-card:nth-child(1) {
    animation-delay: 0.0s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.06s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.12s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.18s;
}

.blog-card:nth-child(5) {
    animation-delay: 0.24s;
}

.blog-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.blog-card-badge {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 3px 10px;
    border-radius: 20px;
}

.blog-card-date {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.blog-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.blog-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.blog-card a {
    color: var(--accent);
    text-decoration: none;
}

.blog-card a:hover {
    color: var(--accent-hover);
}

.blog-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.blog-list li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    padding: 3px 0 3px 18px;
    position: relative;
}

.blog-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

.blog-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.blog-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-faint);
    background: var(--bg-hover);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

/* ============================================
   FOOTER
   ============================================ */
.page-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 40px 36px 0;
    margin-top: auto;
}

.footer-content {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    padding-bottom: 32px;
}

.footer-brand {
    flex: 1;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-faint);
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 48px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.footer-col a {
    font-size: 13px;
    color: var(--text-faint);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

/* Landing page footer */
.landing-footer {
    z-index: 1;
    position: relative;
    width: 100%;
    padding: 20px 36px;
    display: flex;
    justify-content: center;
    gap: 24px;
    animation: fadeIn 0.8s ease 0.6s both;
}

.landing-footer a {
    font-size: 12px;
    color: var(--text-faint);
    text-decoration: none;
    transition: color var(--transition);
    letter-spacing: 0.02em;
}

.landing-footer a:hover {
    color: var(--text-dim);
}

/* ============================================
   STATIC PAGES — RESPONSIVE
   (merged into main responsive section below)
   ============================================ */

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.header-right-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle-track {
    width: 50px;
    height: 26px;
    border-radius: 50px;
    background: var(--toggle-track-bg);
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: var(--toggle-thumb-x);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--toggle-thumb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Sun icon — visible in light mode */
.icon-sun {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #f59e0b;
}

/* Moon icon — visible in dark mode */
.icon-moon {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent);
}

/* Dark mode: show moon, hide sun */
:root .icon-moon,
[data-theme="dark"] .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

:root .icon-sun,
[data-theme="dark"] .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Light mode: show sun, hide moon */
[data-theme="light"] .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* Smaller toggle for chat header */
.theme-toggle-sm .theme-toggle-track {
    width: 42px;
    height: 22px;
}

.theme-toggle-sm .theme-toggle-thumb {
    width: 16px;
    height: 16px;
    top: 2px;
}

[data-theme="light"] .theme-toggle-sm .theme-toggle-thumb {
    left: 22px;
}

/* Hover effect on toggle */
.theme-toggle:hover .theme-toggle-track {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.theme-toggle:active .theme-toggle-thumb {
    width: 24px;
}

.theme-toggle-sm:active .theme-toggle-thumb {
    width: 20px;
}

/* ============================================
   SMOOTH THEME TRANSITION
   ============================================ */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        fill 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        stroke 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Light mode gradient text tweak */
[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #6d5adc 0%, #d946a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light mode orb adjustments */
[data-theme="light"] .orb-1 {
    background: var(--accent);
    opacity: 0.06;
}

[data-theme="light"] .orb-2 {
    background: var(--rose);
    opacity: 0.05;
}

[data-theme="light"] .orb-3 {
    background: var(--green);
    opacity: 0.04;
}

/* ============================================
   RESPONSIVE — ALL BREAKPOINTS
   ============================================ */

/* ---- Tablet / Small Desktop (≤ 1024px) ---- */
@media (max-width: 1024px) {
    .landing-header {
        max-width: 100%;
        padding: 22px 28px;
    }

    .landing-main {
        max-width: 580px;
    }

    .page-content {
        max-width: 680px;
    }

    .footer-content {
        max-width: 680px;
    }
}

/* ---- Small Tablet (≤ 768px) ---- */
@media (max-width: 768px) {
    .landing-header {
        padding: 20px 24px;
    }

    .hero-title {
        font-size: 40px;
        letter-spacing: -1.5px;
    }

    .hero-subtitle {
        font-size: 15px;
        max-width: 400px;
    }

    .landing-main {
        max-width: 520px;
        padding: 0 20px;
    }

    .features {
        gap: 10px;
    }

    .feature-card {
        padding: 16px 22px;
    }

    /* Chat page */
    .chat-header {
        padding: 12px 16px;
    }

    .chatroom {
        padding: 18px;
    }

    .chat-input-bar {
        padding: 12px 14px;
    }

    /* Static pages */
    .page-header {
        padding: 18px 24px;
    }

    .page-content {
        padding: 40px 20px 56px;
    }

    .page-hero h1 {
        font-size: 36px;
    }

    .content-card,
    .blog-card {
        padding: 24px 28px;
    }

    /* Footer */
    .page-footer {
        padding: 32px 24px 0;
    }

    .footer-content {
        gap: 32px;
    }

    .footer-links {
        gap: 36px;
    }

    .landing-footer {
        padding: 18px 24px;
        gap: 20px;
    }

    /* Ad */
    .ad-container {
        min-width: 0;
        max-width: 100%;
    }
}

/* ---- Large Phone (≤ 480px) ---- */
@media (max-width: 480px) {
    .landing-header {
        padding: 16px 18px;
    }

    .header-right-group {
        gap: 8px;
    }

    .online-badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .hero-title {
        font-size: 32px;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .landing-main {
        padding: 0 16px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin-bottom: 40px;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .features {
        gap: 8px;
    }

    .feature-card {
        padding: 14px 18px;
    }

    .terms-box {
        margin-bottom: 22px;
    }

    .checkbox-container {
        font-size: 12px;
    }

    /* Chat page */
    .chat-header {
        padding: 10px 14px;
    }

    .logo-sm .logo-text {
        font-size: 16px;
    }

    .logo-sm .logo-icon {
        font-size: 18px;
    }

    .status-badge {
        padding: 5px 12px;
        font-size: 11px;
    }

    .chatroom {
        padding: 14px;
        gap: 5px;
    }

    .msg {
        max-width: 88%;
        padding: 10px 14px;
        font-size: 13.5px;
        border-radius: 16px;
    }

    .msg-system {
        font-size: 11px;
    }

    .chat-input-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .input-wrapper textarea {
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .btn-action {
        min-width: auto;
        padding: 10px 14px;
        font-size: 13px;
    }

    .btn-send {
        padding: 10px 14px;
    }

    .btn-sm {
        padding: 7px 12px;
        font-size: 12px;
    }

    .typing-indicator {
        padding: 6px 14px;
        font-size: 11px;
    }

    /* Static pages */
    .page-header {
        padding: 14px 18px;
    }

    .page-nav {
        gap: 12px;
    }

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

    .page-nav .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .page-content {
        padding: 28px 16px 40px;
    }

    .page-hero {
        margin-bottom: 28px;
    }

    .page-hero h1 {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .page-hero-sub {
        font-size: 13px;
    }

    .content-card,
    .blog-card {
        padding: 20px;
        border-radius: var(--radius);
    }

    .content-card h2,
    .blog-card h2 {
        font-size: 16px;
    }

    .rule-item {
        gap: 12px;
    }

    .rule-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .blog-card-badge {
        top: 16px;
        right: 16px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .footer-links {
        gap: 28px;
    }

    .page-footer {
        padding: 28px 18px 0;
    }

    .landing-footer {
        padding: 16px 18px;
        gap: 16px;
    }

    .landing-footer a {
        font-size: 11px;
    }

    /* Theme toggle */
    .theme-toggle-track {
        width: 42px;
        height: 22px;
    }

    .theme-toggle-thumb {
        width: 16px;
        height: 16px;
        top: 2px;
    }

    [data-theme="light"] .theme-toggle-thumb {
        left: 22px;
    }

    /* Ad */
    .ad-container {
        min-width: 0;
        max-width: 100%;
        margin: 0 16px;
        padding: 8px;
    }
}

/* ---- Small Phone (≤ 360px) ---- */
@media (max-width: 360px) {
    .landing-header {
        padding: 14px 14px;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-icon {
        font-size: 20px;
    }

    .online-badge {
        padding: 5px 10px;
        font-size: 10px;
        gap: 6px;
    }

    .hero-title {
        font-size: 26px;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    .action-buttons {
        max-width: 260px;
    }

    .btn {
        padding: 11px 18px;
        font-size: 13px;
    }

    .feature-card {
        padding: 12px 14px;
    }

    .feature-icon {
        font-size: 18px;
    }

    .feature-label {
        font-size: 10px;
    }

    /* Chat */
    .chat-header {
        padding: 8px 12px;
    }

    .msg {
        max-width: 92%;
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-input-bar {
        padding: 8px 10px;
        gap: 6px;
    }

    .input-wrapper textarea {
        padding: 9px 12px;
        font-size: 13px;
    }

    .btn-action {
        padding: 9px 12px;
        font-size: 12px;
        min-width: 90px;
    }

    /* Static pages */
    .page-header {
        padding: 12px 14px;
    }

    .page-nav {
        gap: 8px;
    }

    .page-nav a {
        font-size: 11px;
    }

    .page-content {
        padding: 24px 14px 36px;
    }

    .page-hero h1 {
        font-size: 24px;
    }

    .content-card,
    .blog-card {
        padding: 16px;
    }

    .content-card h2,
    .blog-card h2 {
        font-size: 15px;
    }

    .content-card p,
    .content-card ul li,
    .blog-card p,
    .blog-list li {
        font-size: 13px;
    }

    .rule-item {
        gap: 10px;
    }

    .rule-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
        border-radius: 6px;
    }

    .footer-links {
        gap: 20px;
    }

    .landing-footer {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
}