:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: rgba(22, 27, 34, 0.95);
    --bg-card-hover: rgba(30, 38, 50, 0.95);
    --bg-input: rgba(13, 17, 23, 0.8);
    --border-color: rgba(48, 54, 61, 0.8);
    --border-hover: rgba(0, 200, 200, 0.4);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-primary: #00d4d4;
    --accent-secondary: #00b8b8;
    --accent-gradient: linear-gradient(135deg, #00d4d4, #00b8b8);
    --accent-glow: rgba(0, 212, 212, 0.2);
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
    --kw-1: #f43f5e;
    --kw-2: #3b82f6;
    --kw-3: #10b981;
    --kw-4: #f59e0b;
    --kw-5: #a78bfa;
    --kw-6: #ec4899;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
.background-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.08;
    animation: float 25s ease-in-out infinite;
}
.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
}
.orb-2 {
    width: 350px;
    height: 350px;
    background: #3b82f6;
    bottom: -100px;
    left: -50px;
    animation-delay: -8s;
}
.orb-3 {
    width: 250px;
    height: 250px;
    background: #a78bfa;
    top: 50%;
    left: 50%;
    animation-delay: -16s;
}
@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}
.container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}
.header {
    text-align: center;
    margin-bottom: 20px;
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d1117;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.logo-icon svg {
    width: 20px;
    height: 20px;
}
.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
}
.card:hover {
    border-color: var(--border-hover);
}
.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 10px;
}
.label-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
}
.form-input::placeholder {
    color: var(--text-muted);
}
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.url-card {
    padding: 16px 20px;
}
.two-column {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}
.keywords-card {
    display: flex;
    flex-direction: column;
}
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.keyword-input {
    padding: 8px 12px;
    font-size: 0.85rem;
}
@media (max-width: 500px) {
    .keywords-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.recaptcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: #0d1117;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
    filter: brightness(1.1);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-icon {
    font-size: 1.1rem;
}
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(13, 17, 23, 0.3);
    border-top-color: #0d1117;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.player-card {
    display: flex;
    flex-direction: column;
}
.video-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 260px;
    aspect-ratio: 16 / 9;
}
.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.error-card {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}
.error-icon {
    font-size: 1.1rem;
}
.error-card p {
    color: #fca5a5;
    font-size: 0.88rem;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.loading-card {
    text-align: center;
    padding: 40px 20px;
}
.loading-animation {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    height: 50px;
    margin-bottom: 20px;
}
.loading-bar {
    width: 8px;
    background: var(--accent-gradient);
    border-radius: 3px;
    animation: loadingPulse 1.2s ease-in-out infinite;
}
.loading-bar:nth-child(1) {
    height: 16px;
    animation-delay: 0s;
}
.loading-bar:nth-child(2) {
    height: 28px;
    animation-delay: 0.15s;
}
.loading-bar:nth-child(3) {
    height: 42px;
    animation-delay: 0.3s;
}
.loading-bar:nth-child(4) {
    height: 28px;
    animation-delay: 0.45s;
}
.loading-bar:nth-child(5) {
    height: 16px;
    animation-delay: 0.6s;
}
@keyframes loadingPulse {
    0%,
    100% {
        transform: scaleY(0.5);
        opacity: 0.4;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}
.loading-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.loading-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.stats-card {
    padding: 16px 20px;
    animation: slideIn 0.4s ease;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.stat-item {
    text-align: center;
    padding: 14px 12px;
    background: rgba(0, 212, 212, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 212, 212, 0.1);
}
.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
.chart-card {
    animation: slideIn 0.4s ease 0.1s both;
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}
.legend-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.legend-item.hidden {
    opacity: 0.3;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    cursor: pointer;
}
.chart-wrapper::-webkit-scrollbar {
    height: 5px;
}
.chart-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.chart-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}
.chart-wrapper canvas {
    height: 190px !important;
}
.chart-hint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}
.footer {
    text-align: center;
    padding: 24px 0 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
}
@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }
    .header h1 {
        font-size: 1.2rem;
    }
    .card {
        padding: 16px;
    }
}
.queue-info {
    text-align: center;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 212, 212, 0.08);
    border: 1px solid rgba(0, 212, 212, 0.2);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease;
}
.cache-badge-row {
    text-align: right;
    margin-bottom: 8px;
    min-height: 24px;
}
.cache-badge {
    background: linear-gradient(135deg, rgba(0, 212, 212, 0.15), rgba(0, 184, 184, 0.15));
    border: 1px solid rgba(0, 212, 212, 0.3);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.embed-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(255, 171, 0, 0.08);
    border: 1px solid rgba(255, 171, 0, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}
.embed-notice-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.embed-notice-link {
    margin-left: auto;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.embed-notice-link:hover {
    text-decoration: underline;
}