:root {
    --bg: #080809;
    --surface: #0e0e10;
    --card: #111113;
    --card-hover: #161618;
    --border: rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.15);
    --text: #f0f0f0;
    --text-main: #f0f0f0;
    --text-secondary: #888;
    --text-muted: #888;
    --text-tertiary: #555;
    --accent: #c8ff57;
    --accent-dim: rgba(200,255,87,0.12);
    --accent-border: rgba(200,255,87,0.25);
    --red: #ff5757;
    --red-dim: rgba(255,87,87,0.1);
    --amber: #ffc857;
    --amber-dim: rgba(255,200,87,0.1);
    --green: #57ffb8;
    --green-dim: rgba(87,255,184,0.1);
    --radius: 10px;
    --font: 'DM Sans', system-ui, sans-serif;
    --mono: 'DM Mono', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ─── Header ────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8,8,9,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-brand {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.search-wrap {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-bar {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.search-bar::placeholder { color: var(--text-tertiary); }
.search-bar:focus {
    border-color: var(--accent-border);
    background: var(--card);
}

.pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.pill {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}

.pill:hover { color: var(--text); border-color: var(--border-hover); }

.pill.active-done {
    background: var(--green-dim);
    border-color: rgba(87,255,184,0.3);
    color: var(--green);
}

.pill.active-notfound {
    background: var(--red-dim);
    border-color: rgba(255,87,87,0.3);
    color: var(--red);
}

.pill-reset {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 6px 10px;
}

.pill-reset:hover { color: var(--red); border-color: rgba(255,87,87,0.4); }

.info-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.info-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

a.info-btn {
    text-decoration: none;
}

/* ─── Result count bar ──────────────────────── */
.results-bar {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.results-count {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

.results-count span {
    color: var(--accent);
    font-weight: 500;
}

/* ─── Grid ──────────────────────────────────── */
.grid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 60px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 80px 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ─── Card ──────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.2s;
    background: radial-gradient(400px circle at var(--mx,50%) var(--my,50%), rgba(200,255,87,0.04), transparent 60%);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-hover);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(200,255,87,0.05);
}

.card:hover::after { opacity: 1; }

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s;
}

.card:hover .card-thumb img { transform: scale(1.03); }

.thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-family: var(--mono);
    letter-spacing: 0.05em;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.card:hover .play-overlay { opacity: 1; }

.play-icon {
    width: 44px;
    height: 44px;
    background: rgba(200,255,87,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1rem;
    padding-left: 3px;
    transform: scale(0.85);
    transition: transform 0.2s;
}

.card:hover .play-icon { transform: scale(1); }

.card-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-code {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.03em;
}

.badge {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.badge-done { background: var(--green-dim); color: var(--green); }
.badge-working { background: var(--amber-dim); color: var(--amber); }
.badge-notfound { background: var(--red-dim); color: var(--red); }

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--mono);
}

.card-links {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.775rem;
    font-weight: 500;
    transition: all 0.15s;
}

.link-chip:hover {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

.link-chip svg { flex-shrink: 0; }

/* ─── Modal base ────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    animation: modal-in 0.2s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--mono);
    margin-top: 2px;
}

.close-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.close-btn:hover { color: var(--text); border-color: var(--border-hover); }

.player-list { display: flex; flex-direction: column; gap: 8px; }

.player-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
}

.player-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
    transform: translateX(3px);
}

.player-arrow {
    font-size: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
}

.player-btn:hover .player-arrow { opacity: 1; transform: translateX(2px); }

.no-players {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 20px 0;
}

.info-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.info-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

.info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-text strong { color: var(--text); font-weight: 600; }

/* ─── Footer ────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-contact {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.footer-contact a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-contact a:hover { color: var(--accent); }

.revoke-btn, .remove-consent-btn {
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.revoke-btn:hover, .remove-consent-btn:hover {
    color: var(--red);
    border-color: rgba(255,87,87,0.35);
}

/* ─── Warning Page ───────────────────────────── */
.warning-container {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    margin: auto;
}

body:has(.warning-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.warning-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.warning-container h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.025em;
}

.warning-container p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-yes {
    background: var(--accent);
    color: #000;
}

.btn-yes:hover {
    background: #d4ff6f;
    transform: translateY(-2px);
}

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

.btn-no:hover {
    color: var(--red);
    border-color: rgba(255,87,87,0.35);
    transform: translateY(-2px);
}

/* ─── Info Page ──────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 20px;
}

.container header {
    margin-bottom: 40px;
    text-align: center;
    position: static;
    background: transparent;
    border: none;
}

.container h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    color: var(--text);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.container .grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.container .card {
    padding: 24px;
    cursor: default;
}

.container .card:hover {
    transform: none;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.container p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.container p:last-child {
    margin-bottom: 0;
}

.alias-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alias-tag {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    border: 1px solid var(--border);
}

.link-item:hover {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

.link-name {
    font-weight: 500;
}

.link-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: var(--surface);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-family: var(--mono);
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.full-width {
    grid-column: 1 / -1;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--accent);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-email {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.footer-email a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-email a:hover {
    color: var(--accent);
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 700px) {
    .header-inner { flex-wrap: wrap; gap: 10px; }
    .header-brand, .header-divider { display: none; }
    .pills { margin-left: 0; }
    .grid { padding: 16px 16px 60px; gap: 12px; }
}

@media (max-width: 600px) {
    .warning-container { padding: 30px; }
    .button-group { flex-direction: column; }
    .btn { width: 100%; }
    .container .grid { grid-template-columns: 1fr; }
    .link-url { display: none; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .pills { flex-wrap: wrap; }
}
