@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Sans+JP:wght@400;700&family=Syne:wght@400;700;800&display=swap');

/* ─── Variables ─── */
:root {
    --gold: #ffcc00;
    --gold-dim: rgba(255, 204, 0, 0.15);
    --gold-glow: rgba(255, 204, 0, 0.35);
    --bg: #0d0f14;
    --surface: #161a23;
    --surface-2: #1e2330;
    --border: rgba(255, 204, 0, 0.12);
    --text: #e8eaf0;
    --text-muted: #8a90a0;
    --blue-link: #7eb8f7;
    --radius: 14px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Syne', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 204, 0, 0.08) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.018'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─── */
header {
    background: linear-gradient(180deg, #000 0%, var(--surface) 100%);
    padding: 36px 24px 32px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255,204,0,0.06), transparent 70%);
    pointer-events: none;
}

header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: 0.06em;
    color: var(--gold);
    text-shadow: 0 0 32px var(--gold-glow), 0 2px 0 #000;
    position: relative;
}

/* ─── Content ─── */
.content {
    flex: 1 0 auto;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Section Title ─── */
h2 {
    font-family: 'Bebas Neue', sans-serif;
    text-align: center;
    color: var(--gold);
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.1em;
    margin-bottom: 28px;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 64px; height: 2px;
    background: var(--gold);
    margin: 10px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 8px var(--gold-glow);
}

/* ─── Search ─── */
#search {
    display: block;
    margin: 0 auto 24px;
    padding: 11px 18px;
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Syne', sans-serif;
    font-size: 0.97em;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

#search::placeholder { color: var(--text-muted); }

#search:focus {
    border-color: var(--gold);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px var(--gold-dim), 0 2px 12px rgba(0,0,0,0.3);
}

/* ─── Table ─── */
table, table#manga-table, table#files-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow:
        0 0 0 1px var(--border),
        0 8px 32px rgba(0,0,0,0.4);
    margin-bottom: 32px;
    font-size: 1em;
}

table th, table#manga-table th, table#files-table th {
    background: linear-gradient(90deg, var(--surface-2), #1a1f2e);
    color: var(--gold);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.05em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 16px 18px;
    border: none;
    border-bottom: 1px solid rgba(255,204,0,0.2);
    position: relative;
}

table th:first-child { border-radius: var(--radius) 0 0 0; }
table th:last-child  { border-radius: 0 var(--radius) 0 0; }

table td, table#manga-table td, table#files-table td {
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 14px 18px;
    color: var(--text);
    transition: background var(--transition);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.95em;
}

table tr:last-child td { border-bottom: none; }

table tr:nth-child(even) td { background: rgba(255,255,255,0.018); }

table tr:hover td {
    background: var(--gold-dim);
}

/* ─── Links ─── */
a {
    color: var(--blue-link);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ─── Download Icon ─── */
.centered-icon { text-align: center; }

.download-icon {
    width: 32px;
    height: auto;
    filter: brightness(0.9) drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    transition: transform var(--transition), filter var(--transition);
    vertical-align: middle;
}

.download-icon:hover {
    transform: scale(1.2) translateY(-2px);
    filter: drop-shadow(0 4px 14px var(--gold-glow)) brightness(1.1);
}

/* ─── Back Button ─── */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--gold);
    border: 1.5px solid rgba(255,204,0,0.4);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.05em;
    letter-spacing: 0.1em;
    padding: 13px 32px;
    border-radius: 10px;
    margin-top: 28px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.back-button::before {
    content: '←';
    font-size: 1.1em;
    margin-right: 4px;
    transition: transform var(--transition);
}

.back-button:hover {
    background: var(--gold);
    color: #0d0f14;
    border-color: var(--gold);
    box-shadow: 0 4px 20px var(--gold-glow);
    transform: translateY(-2px);
    text-decoration: none;
}

.back-button:hover::before { transform: translateX(-4px); }

/* ─── Footer ─── */
footer {
    flex-shrink: 0;
    background: #000;
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 18px;
    font-family: 'Syne', sans-serif;
    font-size: 0.82em;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .content { padding: 32px 16px; }
}

@media (max-width: 600px) {
    .content { padding: 20px 8px; }
    table th, table td { padding: 11px 10px; font-size: 0.9em; }
    header { padding: 24px 16px; }
}