/* ==========================================================================
   LOTO6 HUMAN AVOIDER - Style System (With Optimized AdSense CSS)
   ========================================================================== */

:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(18, 26, 43, 0.75);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 229, 255, 0.3);

    --primary-cyan: #00e5ff;
    --primary-purple: #a855f7;
    --primary-pink: #ec4899;
    --accent-gold: #f59e0b;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-glow: 0 0 25px rgba(0, 229, 255, 0.25);
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 229, 255, 0.12) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    line-height: 1.6;
}

.app-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--primary-cyan);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.25);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.app-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 4px;
}

.app-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.app-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Advertisement Slots (Google AdSense 枠 - Flexbox競合を完全解消)
   ========================================================================== */
.ad-container {
    display: block;
    width: 100%;
    margin: 10px auto;
    text-align: center;
}

.ad-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.ad-box {
    display: block;
    width: 100%;
    min-height: 100px;
    margin: 0 auto;
    text-align: center;
    background: rgba(15, 23, 42, 0.3);
    border-radius: var(--radius-sm);
}

.ad-box ins.adsbygoogle {
    display: block !important;
    margin: 0 auto;
    width: 100%;
}

/* Tab Switcher */
.tab-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00e5ff 0%, #3b82f6 100%);
    color: #0b0f19;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.35);
}

/* Mode Selector Nav */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.mode-btn {
    background: transparent;
    border: none;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mode-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-name {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.mode-desc {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.5), transparent);
}

/* Numbers Container (Ball Roll) */
.numbers-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}

.number-ball {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a3859 0%, #111827 100%);
    border: 2px solid rgba(0, 229, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 8px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.number-ball.active {
    border-color: var(--primary-cyan);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.4);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.number-ball.high-number {
    border-color: var(--primary-purple);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 0 20px rgba(168, 85, 247, 0.4);
}

@keyframes popIn {
    0% { transform: scale(0.6) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.tool-btn .icon {
    width: 16px;
    height: 16px;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Score Box */
.score-box {
    background: rgba(10, 15, 26, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.score-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.score-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.score-num {
    font-family: 'Inter', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-max {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dim);
}

/* Analysis Box */
.analysis-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-bubble {
    background: rgba(0, 229, 255, 0.08);
    border: 1px dashed rgba(0, 229, 255, 0.3);
    color: var(--primary-cyan);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.reason-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 4px;
}

.reason-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* Main Generate Button */
.action-wrapper {
    margin-top: 8px;
}

.generate-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #00e5ff 0%, #7c3aed 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.25s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 229, 255, 0.45);
}

.btn-text {
    font-size: 1.25rem;
    font-weight: 900;
}

.btn-subtext {
    font-size: 0.78rem;
    opacity: 0.85;
}

/* Past Stats Section */
.stats-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.stats-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stats-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.sub-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-cyan);
    margin-bottom: 10px;
}

/* Recent Draws List */
.recent-draws-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(10, 15, 26, 0.6);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.recent-draw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-draw-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.draw-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #ffffff;
}

.draw-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.recent-draw-balls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid var(--primary-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
}

.mini-ball.bonus {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
}

/* Frequency Section */
.freq-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.freq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-group {
    display: flex;
    gap: 6px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: var(--primary-cyan);
    color: #0b0f19;
    border-color: var(--primary-cyan);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-cyan);
}

.stat-card.top-rank {
    border-color: rgba(245, 158, 11, 0.6);
    background: rgba(245, 158, 11, 0.08);
}

.stat-num {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #ffffff;
}

.stat-count {
    font-size: 0.85rem;
    color: var(--primary-cyan);
    font-weight: 700;
}

.stat-rank {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Footer */
.app-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 8px;
}

.concept-quote {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

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

@media (max-width: 580px) {
    .number-ball {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    .score-num {
        font-size: 2.8rem;
    }
    .app-title {
        font-size: 1.8rem;
    }
    .recent-draw-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
