:root {
    --magenta: #ff2a6d;
    --gold: #ffd700;
    --dark-gold: #b8860b;
    --parchment: #eae1c4;
    --parchment-dark: #c5b68d;
    --charcoal: #331a08;
    --charcoal-light: #502e15;
    --bg-dark: #090a0d;
    --grey-btn: #4f535c;
    --grey-btn-border: #2c2e35;
    --font-pixel: 'Press Start 2P', cursive;
    --font-sans: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 10%, rgba(255, 42, 109, 0.08), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(255, 215, 0, 0.06), transparent 45%);
    color: #fff;
    font-family: var(--font-sans);
    min-height: 100vh;
}

a {
    color: inherit;
}

/* ---------- Header ---------- */
.guild-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 76px;
    border-bottom: 2px solid var(--charcoal-light);
    background: rgba(9, 10, 13, 0.85);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.guild-header .brand {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.guild-header .brand span {
    color: var(--magenta);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--parchment-dark);
}

.user-chip img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid var(--charcoal-light);
}

/* ---------- Pixel buttons ---------- */
.pixel-btn {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: #fff;
    background: var(--grey-btn);
    border: 4px solid var(--grey-btn-border);
    border-radius: 0;
    padding: 10px 18px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.08s ease;
}

.pixel-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.pixel-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.pixel-btn.magenta {
    background: var(--magenta);
    border-color: #8a0e37;
}

.pixel-btn.gold {
    background: var(--dark-gold);
    border-color: #4a3506;
    color: #1a1200;
}

.pixel-btn.danger {
    background: #7a1f1f;
    border-color: #3a0d0d;
}

.pixel-btn.small {
    font-size: 9px;
    padding: 6px 10px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

/* ---------- Timeline ---------- */
.timeline-hero {
    text-align: center;
    padding: 56px 20px 24px;
}

.timeline-hero h1 {
    font-family: var(--font-pixel);
    font-size: 22px;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
    margin: 0 0 12px;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--parchment-dark);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    border: 2px solid var(--charcoal);
}

.legend-dot.major {
    background: var(--magenta);
    box-shadow: 0 0 8px var(--magenta);
}

.legend-dot.minor {
    background: var(--gold);
}

.legend-dot.footnote {
    background: var(--parchment-dark);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.timeline {
    position: relative;
    max-width: 980px;
    margin: 40px auto 120px;
    padding: 0 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, var(--gold), var(--dark-gold) 30%, var(--magenta) 70%, var(--charcoal-light));
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

.timeline-year {
    position: relative;
    text-align: center;
    margin: 56px 0 28px;
}

.timeline-year span {
    font-family: var(--font-pixel);
    font-size: 14px;
    color: var(--bg-dark);
    background: var(--gold);
    border: 3px solid var(--charcoal);
    padding: 8px 16px;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
    display: inline-block;
}

.timeline-row {
    position: relative;
    display: flex;
    width: 100%;
    margin: 18px 0;
}

.timeline-row.side-left {
    justify-content: flex-start;
}

.timeline-row.side-right {
    justify-content: flex-end;
}

.timeline-node {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 2;
}

.timeline-row.level-major .timeline-node {
    width: 20px;
    height: 20px;
    background: var(--magenta);
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 14px var(--magenta);
}

.timeline-row.level-minor .timeline-node {
    width: 14px;
    height: 14px;
    background: var(--gold);
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.timeline-row.level-footnote .timeline-node {
    width: 8px;
    height: 8px;
    background: var(--parchment-dark);
    border: 2px solid var(--bg-dark);
}

.event-card {
    width: calc(50% - 48px);
    background: var(--parchment);
    color: var(--charcoal);
    border: 4px double var(--charcoal);
    border-radius: 4px;
    padding: 16px 18px;
    position: relative;
}

.timeline-row.level-major .event-card {
    box-shadow: 0 0 18px rgba(255, 42, 109, 0.45);
    border-color: var(--magenta);
}

.timeline-row.level-minor .event-card {
    width: calc(50% - 64px);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    padding: 12px 14px;
}

.timeline-row.level-footnote {
    margin: 6px 0;
}

.timeline-row.level-footnote .event-card {
    width: auto;
    max-width: calc(50% - 60px);
    background: transparent;
    border: 1px dashed var(--charcoal-light);
    color: var(--parchment-dark);
    padding: 4px 10px;
    font-size: 12px;
    box-shadow: none;
}

.event-date {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--dark-gold);
    margin-bottom: 6px;
    display: block;
}

.timeline-row.level-footnote .event-date {
    display: inline;
    margin-right: 6px;
}

.event-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 6px;
}

.timeline-row.level-major .event-title {
    font-family: var(--font-pixel);
    font-size: 13px;
    line-height: 1.6;
}

.timeline-row.level-footnote .event-title {
    display: inline;
    font-size: 12px;
    font-weight: 600;
}

.event-description {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.empty-state {
    text-align: center;
    color: var(--parchment-dark);
    padding: 60px 20px;
    font-family: var(--font-pixel);
    font-size: 12px;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 18px;
    }

    .timeline-row,
    .timeline-row.side-left,
    .timeline-row.side-right {
        justify-content: flex-start;
        padding-left: 44px;
    }

    .timeline-node {
        left: 18px;
    }

    .event-card,
    .timeline-row.level-minor .event-card,
    .timeline-row.level-footnote .event-card {
        width: 100%;
        max-width: 100%;
    }
}

/* ---------- Admin ---------- */
.admin-wrap {
    max-width: 1100px;
    margin: 40px auto 100px;
    padding: 0 20px;
}

.admin-instruction-overlay {
    background: rgba(18, 19, 25, 0.85);
    border: 2px solid var(--charcoal);
    border-radius: 4px;
    padding: 12px 18px;
    margin-bottom: 24px;
}

.admin-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header-row h1 {
    font-family: var(--font-pixel);
    font-size: 16px;
    color: var(--gold);
    margin: 0;
}

.status-banner {
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid #2ecc71;
    color: #b6f3ce;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(20, 21, 27, 0.6);
    border: 2px solid var(--charcoal-light);
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--charcoal-light);
    font-size: 13px;
}

.admin-table th {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--gold);
    text-transform: uppercase;
}

.level-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-family: var(--font-pixel);
    text-transform: uppercase;
}

.level-badge.major {
    background: var(--magenta);
    color: #fff;
}

.level-badge.minor {
    background: var(--dark-gold);
    color: #1a1200;
}

.level-badge.footnote {
    background: var(--grey-btn);
    color: #fff;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.admin-form {
    background: var(--parchment);
    color: var(--charcoal);
    border: 4px double var(--charcoal);
    border-radius: 4px;
    padding: 28px;
    max-width: 640px;
}

.admin-form label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin: 16px 0 6px;
}

.admin-form label:first-child {
    margin-top: 0;
}

.admin-form input[type="text"],
.admin-form input[type="date"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--charcoal);
    border-radius: 3px;
    background: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
}

.admin-form textarea {
    resize: vertical;
    min-height: 110px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    gap: 20px;
    padding: 20px;
}

.login-wrap h1 {
    font-family: var(--font-pixel);
    font-size: 18px;
    color: var(--gold);
}

.login-wrap p {
    color: var(--parchment-dark);
    max-width: 420px;
}
