:root {
    --bg-dark: #090b10;
    --bg-panel: rgba(16, 20, 28, 0.65);
    --border-color: rgba(66, 220, 255, 0.2);
    --neon-cyan: #00f0ff;
    --neon-pink: #ff0055;
    --neon-purple: #b026ff;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
    --glass-blur: blur(16px);
}

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

html {
    font-size: 18px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Effects */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.cyber-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px); }
}

.glowing-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--neon-cyan);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--neon-purple);
    bottom: -50px;
    right: -50px;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0.75rem;
    border-top: 2px solid var(--neon-cyan);
}

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

.logo h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.highlight {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.subtitle {
    font-size: 0.6rem;
    color: var(--neon-cyan);
    letter-spacing: 3px;
    opacity: 0.7;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(0, 240, 255, 0.3);
}

.neon-icon {
    color: var(--neon-cyan);
    font-size: 1.4rem;
    filter: drop-shadow(0 0 5px var(--neon-cyan));
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blue-badge {
    background: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
    border: 1px solid rgba(29, 155, 240, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== MAIN LAYOUT (PC: 2-column, Mobile: stacked) ===== */
.app-main {
    display: flex;
    gap: 1rem;
    padding: 0 0.75rem 1rem 0.75rem;
    min-height: 0;
}

.left-panel {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    padding-right: 0.5rem;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.feed-container, .results-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

/* ===== SECTION HEADERS ===== */
h2 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 i {
    color: var(--neon-cyan);
}

.control-group {
    padding: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover, .btn:active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.btn-grid .btn:nth-child(1) { grid-column: span 2; }

.w-100 { width: 100%; }
.mt-3 { margin-top: 1rem; }

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

.tone-grid .btn-tone:first-child {
    grid-column: span 2;
}

.btn-tone {
    font-size: 1rem;
    padding: 0.8rem 0.6rem;
    text-align: center;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-tone.tone-active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
    font-weight: 800;
}

.btn-setup {
    background: rgba(176, 38, 255, 0.1);
    border-color: rgba(176, 38, 255, 0.3);
    color: #df9aff;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}
.btn-setup:hover {
    background: rgba(176, 38, 255, 0.2);
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.3);
    color: #fff;
}


.btn-generate {
    background: linear-gradient(45deg, rgba(0,240,255,0.1), rgba(255,0,85,0.1));
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-size: 1.15rem;
    padding: 1.3rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

.btn-generate:hover, .btn-generate:active {
    background: linear-gradient(45deg, rgba(0,240,255,0.2), rgba(255,0,85,0.2));
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 10px rgba(255, 0, 85, 0.2);
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.btn-primary {
    background: var(--neon-cyan);
    color: #000;
    font-weight: 800;
}
.btn-primary:hover, .btn-primary:active {
    background: #fff;
    box-shadow: 0 0 15px var(--neon-cyan);
}

.btn-icon {
    padding: 0.6rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* ===== ACCORDION & CHECKBOXES ===== */
.style-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.style-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.style-group summary {
    padding: 0.9rem 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    user-select: none;
    transition: background 0.2s;
}

.style-group summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.style-options {
    padding: 0.5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cyber-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.3rem 0;
}

.cyber-checkbox:hover {
    color: var(--text-main);
}

.cyber-checkbox input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.cyber-checkbox input:checked {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

.cyber-checkbox input:checked::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2.5px 2.5px 0;
    top: 2px;
    left: 6px;
    transform: rotate(45deg);
}

.cyber-checkbox input:checked + span {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

/* ===== SEGMENTED CONTROL ===== */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.segmented-control input {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.segmented-control label:last-of-type {
    border-right: none;
}

.segmented-control input:checked + label {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
    box-shadow: inset 0 -2px 0 var(--neon-cyan);
}

/* ===== LISTS AND EMPTY STATES ===== */
.feed-list, .results-list {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.neon-dim {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.1);
}

/* ===== ANIMATIONS ===== */
.pulse-effect {
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.6);
}

/* ===== FEED PANEL ===== */
.feed-header-info h3 {
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin-bottom: 1rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.feed-link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.btn-feed-link {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    padding: 0.85rem 1.4rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-feed-link:hover, .btn-feed-link:active {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.btn-feed-link i.fa-arrow-up-right-from-square {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ===== ACCOUNT CHIPS ===== */
.account-chips {
    margin-top: 0.5rem;
}

.chip-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.account-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.account-chip:hover, .account-chip:active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90vw;
    width: 420px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESULT GUIDE ===== */
.result-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
    text-align: center;
}

.guide-icon {
    font-size: 3rem;
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 10px var(--neon-cyan));
}

.result-guide h3 {
    font-size: 1.3rem;
    font-weight: 800;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    text-align: left;
    width: 100%;
    max-width: 500px;
}

.guide-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border-left: 3px solid var(--neon-cyan);
    font-size: 1rem;
}

.step-num {
    background: var(--neon-cyan);
    color: #000;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.guide-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-box {
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-box h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neon-cyan);
    font-size: 1.1rem;
}

.modal-box textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: 8px;
    resize: vertical;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ============================================
   MOBILE RESPONSIVE — スマホ最高の見やすさ
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 17px;
    }

    .app-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        margin: 0.5rem;
        text-align: center;
    }

    .logo {
        flex-direction: column;
        gap: 0.4rem;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        font-size: 0.6rem;
    }

    .user-info {
        gap: 0.75rem;
    }

    /* Stack everything vertically on mobile */
    .app-main {
        flex-direction: column;
        padding: 0 0.5rem 1rem 0.5rem;
        gap: 0.75rem;
        height: auto;
    }

    .left-panel {
        width: 100%;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }

    .content-area {
        width: 100%;
    }

    .feed-container, .results-container {
        min-height: 200px;
        height: auto;
        padding: 1.2rem;
    }

    .control-group {
        padding: 1.2rem;
    }

    /* Bigger tap targets on mobile */
    .btn {
        padding: 0.9rem 1.2rem;
        font-size: 1.05rem;
        min-height: 48px;
    }

    .btn-source {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .btn-grid {
        gap: 0.6rem;
    }

    .btn-generate {
        font-size: 1.2rem;
        padding: 1.4rem;
    }

    .btn-feed-link {
        font-size: 1.05rem;
        padding: 1rem 1.4rem;
        width: 100%;
        justify-content: center;
    }

    .feed-link-grid {
        flex-direction: column;
    }

    /* Larger checkboxes for mobile */
    .cyber-checkbox {
        font-size: 1.05rem;
        padding: 0.4rem 0;
    }

    .cyber-checkbox input {
        width: 24px;
        height: 24px;
    }

    .cyber-checkbox input:checked::after {
        width: 6px;
        height: 12px;
        top: 3px;
        left: 7px;
    }

    .style-group summary {
        font-size: 1.1rem;
        padding: 1rem;
    }

    /* Segmented control bigger */
    .segmented-control label {
        padding: 0.85rem 0;
        font-size: 1.05rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    .empty-state {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        padding: 2rem 0;
        font-size: 1rem;
    }

    .account-chip {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Guide steps */
    .guide-step {
        font-size: 1rem;
        padding: 1rem;
    }

    .result-guide h3 {
        font-size: 1.2rem;
    }

    .toast-notification {
        bottom: 1rem;
        width: 92vw;
        font-size: 0.95rem;
    }

    .modal-box {
        padding: 1.5rem;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    html {
        font-size: 16px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

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

    .btn-grid .btn:nth-child(1) {
        grid-column: span 1;
    }
}
