/* ============================================================
   Federico Atzori — Personal Academic Website
   Shared Stylesheet
   ============================================================ */

/* Google Fonts — loaded via <link> in HTML for faster parallel loading */

/* ============================================================
   CSS Custom Properties (Paper Theme — default)
   ============================================================ */
:root {
    --bg:            #f5f0e8;
    --bg-subtle:     #ece6d9;
    --bg-card:       #fdf8f0;
    --bg-inset:      #ede7da;
    --text:          #2a2010;
    --text-body:     #3d3020;
    --text-muted:    #6b5840;
    --text-dim:      #9a8870;
    --accent:        #8b6000;
    --accent-soft:   rgba(139,96,0,0.12);
    --blue:          #4a5a8b;
    --blue-light:    #6a7aab;
    --blue-dim:      #9aa8cb;
    --border:        #d0c4b0;
    --border-strong: #b8a890;
    --header-bg:     #fdf8f0;
    --prefix:        #c8b890;
    --prefix-nav:    #b8a880;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   Base
   ============================================================ */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-body);
    background: var(--bg);
    transition: background 0.3s ease, color 0.3s ease;
}


/* ============================================================
   Header
   ============================================================ */
header {
    background: var(--header-bg);
    border-bottom: 2px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}


.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

/* ============================================================
   Navigation
   ============================================================ */
nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--blue);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

nav a[aria-current="page"] {
    color: var(--accent);
    font-weight: 500;
}



/* ============================================================
   Layout Containers
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.content-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border: 1px solid var(--border);
}

.content-box {
    margin-bottom: 2rem;
}

/* ============================================================
   Headings
   ============================================================ */
h2 {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 0.975rem;
    color: var(--blue);
    margin: 2rem 0 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

h4 {
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Subtitle variant (same style as h2, used in homepage columns) */
.subtitle {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   Typography
   ============================================================ */
p {
    color: var(--text-body);
}

strong {
    color: var(--blue);
    font-weight: 600;
}

em {
    color: var(--accent);
    font-style: italic;
}

a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Helper classes */
.text-blue   { color: var(--blue); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.mono        { font-family: 'Courier New', monospace; }

/* ============================================================
   Intro / Quote Box
   ============================================================ */
.intro-box {
    background: var(--bg-inset);
    padding: 1.5rem;
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ============================================================
   Recent News Section (homepage)
   ============================================================ */
.news-section {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 0 2rem;
}

.news-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.75rem 2.5rem;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
    font-size: 0.875rem;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-badge {
    flex-shrink: 0;
    padding: 0.1rem 0.5rem;
    font-size: 0.68rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 2px;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.badge-pub   { background: rgba(30,90,143,0.1); color: var(--blue); border: 1px solid rgba(30,90,143,0.2); }
.badge-event { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(184,134,11,0.25); }
.badge-paper { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.badge-pos   { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }


.news-text {
    color: var(--text-body);
    line-height: 1.5;
}

.news-text a {
    color: var(--blue);
    border-bottom-color: transparent;
}

.news-text a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Homepage Specific
   ============================================================ */
.pronunciation {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.village-note {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.825rem;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', monospace;
}

.bio-text {
    margin: 1.5rem 0;
    line-height: 1.85;
    color: var(--text-body);
    font-size: 0.9rem;
}

.section {
    margin: 2.5rem 0;
}

.section h2 {
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

.section h3 {
    font-size: 0.9rem;
    margin: 1.5rem 0 1rem;
}

/* Affiliations list */
.affiliations {
    list-style: none;
    padding-left: 0;
}

.affiliations li {
    padding: 0.45rem 0 0.45rem 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-body);
}

.affiliations li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.affiliations a,
.section a {
    color: var(--blue);
    border-bottom-color: transparent;
}

.affiliations a:hover,
.section a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Location box */
.location-box {
    background: var(--bg-inset);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.location-box h3 { margin-top: 0; }

.sardinia-info {
    margin-top: 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* Research interests box (homepage) */
.research-interests {
    background: var(--bg-inset);
    padding: 1.5rem;
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.85;
    font-family: 'Courier New', monospace;
    color: var(--text-body);
}

/* ============================================================
   Paper Table
   ============================================================ */
.paper-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.paper-table th {
    background: var(--bg-inset);
    padding: 0.75rem;
    text-align: left;
    font-weight: 400;
    border-bottom: 2px solid var(--border-strong);
    color: var(--accent);
}

.paper-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: var(--text-body);
}

.paper-table tr:hover {
    background: var(--bg-inset);
}

.paper-table a {
    color: var(--blue);
    border-bottom-color: transparent;
}

.paper-table a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   About Page — Job & Education Cards
   ============================================================ */
.job-entry {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-inset);
    border-left: 3px solid var(--accent);
}

.job-title {
    color: var(--blue);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.job-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.job-desc {
    color: var(--text-body);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 0.5rem;
}

.job-desc strong {
    color: var(--blue);
}

.education-entry {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: var(--bg-inset);
    border-left: 2px solid var(--border-strong);
    font-size: 0.9rem;
    color: var(--text-body);
}

.education-entry strong {
    color: var(--blue);
}

/* ============================================================
   Conference Lists
   ============================================================ */
.conference-list {
    list-style: none;
    padding-left: 0;
}

.conference-list li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-body);
}

.conference-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.year-section {
    margin: 1.5rem 0;
}

.year-title {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   Accordion (about page)
   ============================================================ */
.accordion {
    margin: 2rem 0;
}

.accordion-header {
    background: var(--bg-inset);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-header:hover {
    background: var(--bg-subtle);
    border-color: var(--accent);
}

.accordion-title {
    color: var(--blue);
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
}

.accordion-icon {
    color: var(--accent);
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.accordion-icon.open {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
}

.accordion-content.open {
    max-height: 2000px;
    padding: 1.5rem;
}

/* ============================================================
   Research Page
   ============================================================ */
.other-publications {
    list-style: none;
    padding-left: 0;
}

.other-publications li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-body);
}

.other-publications li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.other-publications a {
    color: var(--blue);
}

.project-section {
    margin: 2rem 0;
}

.project-item {
    margin: 1rem 0;
    padding: 1.5rem;
    background: var(--bg-inset);
    border-left: 3px solid var(--accent);
    font-size: 0.9rem;
}

.project-item strong {
    color: var(--blue);
    font-size: 1rem;
}

.project-item a {
    color: var(--blue);
    border-bottom-color: transparent;
}

.project-item a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.project-desc {
    color: var(--text-body);
    margin-top: 0.5rem;
    line-height: 1.65;
}

.project-label {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-left: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    vertical-align: middle;
}

.thesis-item {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: var(--bg-inset);
    border-left: 2px solid var(--border-strong);
    font-size: 0.9rem;
    color: var(--text-body);
}

.thesis-item strong {
    color: var(--blue);
}

.thesis-item a {
    color: var(--blue);
    border-bottom-color: transparent;
}

.thesis-item a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.section-subhead {
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    margin: 1.5rem 0 0.75rem;
}

.coming-soon {
    color: var(--text-dim);
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', monospace;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

/* ============================================================
   Teaching Page
   ============================================================ */
.year-section-card {
    margin: 2rem 0;
    padding: 1.25rem;
    background: var(--bg-inset);
    border-left: 3px solid var(--accent);
}

.institution {
    color: var(--blue);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.course-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.course-list li {
    padding: 0.3rem 0 0.3rem 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--text-body);
}

.course-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.lecture-entry {
    margin: 0.75rem 0;
    padding: 0.75rem 1.1rem;
    background: var(--bg-card);
    border-left: 2px solid var(--border-strong);
    transition: border-color 0.2s;
}

.lecture-entry:hover {
    border-left-color: var(--accent);
}

.lecture-title {
    color: var(--blue);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.lecture-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   Events Page
   ============================================================ */
.intro-text {
    color: var(--text-body);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.event-card {
    padding: 0;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    transition: all 0.25s;
    overflow: hidden;
}

.event-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}


/* Replaces the [event poster] placeholder */
.event-banner {
    padding: 1.5rem 1rem;
    background: var(--bg-subtle);
    border-bottom: 2px solid var(--accent);
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.4;
}

.event-banner .event-year {
    display: block;
    font-size: 1.2rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-top: 0.4rem;
}

.event-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.event-title {
    color: var(--blue);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.event-title a {
    color: var(--blue);
    border-bottom: none;
}

.event-title a:hover {
    color: var(--accent);
}

.event-date {
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    font-family: 'Courier New', monospace;
}

.event-location {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

/* ============================================================
   oTree Page
   ============================================================ */
.citation {
    background: var(--bg-inset);
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--border-strong);
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

.code-card {
    margin: 2rem 0;
    padding: 1.75rem;
    background: var(--bg-inset);
    border-left: 4px solid var(--accent);
}

.code-title {
    color: var(--blue);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
}

.code-description {
    color: var(--text-body);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.code-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.code-link:hover {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.code-link::after {
    content: " →";
}

/* ============================================================
   Timeline Page — Static Vertical Layout
   ============================================================ */
.tl-wrapper {
    padding: 1.5rem 0;
}

.tl-item {
    display: grid;
    grid-template-columns: 68px 32px 1fr;
    margin-bottom: 0;
    align-items: stretch;
}

/* Year column */
.tl-year-col {
    text-align: right;
    padding-right: 0;
    padding-top: 0.15rem;
}

.tl-year {
    color: var(--accent);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

/* Centre column: dot + vertical line */
.tl-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tl-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-top: 0.2rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    border: 2px solid var(--bg);
}

.tl-dot--edu      { background: var(--blue); }
.tl-dot--research { background: var(--accent); }
.tl-dot--position { background: var(--text-muted); }

.tl-vline {
    width: 1px;
    flex-grow: 1;
    background: var(--border);
    margin-top: 5px;
}

/* Content column */
.tl-content {
    padding: 0 0 2rem 1.25rem;
}

/* Last item — no bottom padding / no line */
.tl-item:last-child .tl-content { padding-bottom: 0; }
.tl-item:last-child .tl-vline   { display: none; }

.tl-type {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    margin-bottom: 0.35rem;
    border-radius: 2px;
}

.tl-type--edu {
    background: rgba(30, 90, 143, 0.1);
    color: var(--blue);
    border: 1px solid rgba(30, 90, 143, 0.2);
}

.tl-type--research {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(184, 134, 11, 0.25);
}


.tl-type--position {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tl-title {
    display: block;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
}

.tl-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

/* Map */
.heatmap-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    margin: 3rem 0;
}

.world-map {
    width: 100%;
    height: 500px;
    position: relative;
    background: var(--bg-inset);
    border: 1px solid var(--border);
}

.map-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    animation: pulse-academic 2.5s infinite;
}


.map-marker:hover {
    width: 18px;
    height: 18px;
    background: var(--blue);
    box-shadow: 0 0 16px var(--blue-dim);
}

@keyframes pulse-academic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184,134,11,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(184,134,11,0); }
}

@keyframes pulse-hacker {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,0,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(0,255,0,0); }
}

.map-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    max-width: 200px;
    font-family: 'Courier New', monospace;
    color: var(--text-body);
}

.map-tooltip.show {
    opacity: 1;
}

.legend {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

/* ============================================================
   Pixel Game (index.html)
   ============================================================ */
.pixel-game {
    margin: 3rem 0;
    padding: 1.75rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 180px;
    margin: 1.5rem auto;
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    overflow: hidden;
}


.ground {
    position: absolute;
    bottom: 40px;
    width: 1100px;
    height: 3px;
    background: var(--border-strong);
}

.year-marker {
    position: absolute;
    bottom: 43px;
    width: 2px;
    height: 18px;
    background: var(--blue-dim);
}

.year-label {
    position: absolute;
    bottom: 66px;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    transform: translateX(-50%);
}

.pixel-character {
    position: absolute;
    bottom: 43px;
    left: 50px;
    width: 12px;
    height: 20px;
}

.pixel-character::before {
    content: "";
    position: absolute;
    top: 0;
    left: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent);
}

.pixel-character::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 5px;
    width: 2px;
    height: 12px;
    background: var(--accent);
}

.game-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-family: 'Courier New', monospace;
}

.info-popup {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    color: var(--accent);
    display: none;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
}

.mobile-controls {
    display: none;
    margin-top: 1rem;
    gap: 1rem;
}

.mobile-controls button {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 0.5rem 1.25rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: border-color 0.2s;
}

.mobile-controls button:hover {
    border-color: var(--accent);
}


/* ============================================================
   Footer
   ============================================================ */
footer {
    background: var(--header-bg);
    color: var(--text-muted);
    padding: 2.5rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.quote {
    font-style: italic;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    color: var(--blue);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.social-links a {
    color: var(--blue);
    text-decoration: none;
    margin-left: 1.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    border-bottom: none;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--accent);
    border-bottom: none;
}

.social-links a::before { content: "[ "; }
.social-links a::after  { content: " ]"; }

.footer-attribution {
    max-width: 1400px;
    margin: 1rem auto 0;
    padding: 1rem 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

.footer-attribution a {
    color: var(--blue-dim);
    border-bottom: none;
}

.footer-attribution a:hover {
    color: var(--blue);
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--blue-dim); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem 0.75rem;
    }

    .container {
        padding: 0 1rem;
    }

    .content-box {
        padding: 1.5rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .social-links {
        flex-wrap: wrap;
    }

    .social-links a {
        margin: 0 0.75rem 0 0;
    }

    .paper-table { font-size: 0.75rem; }
    .paper-table th,
    .paper-table td { padding: 0.5rem; }

    .mobile-controls { display: flex; justify-content: center; }
}

/* ============================================================
   Dark Mode
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:            #1a1812;
        --bg-subtle:     #221f18;
        --bg-card:       #1f1c16;
        --bg-inset:      #252118;
        --text:          #e8dcc8;
        --text-body:     #d4c8b0;
        --text-muted:    #9a8870;
        --text-dim:      #6b5840;
        --accent:        #c8960a;
        --accent-soft:   rgba(200,150,10,0.12);
        --blue:          #8a9fc8;
        --blue-light:    #a0b0d8;
        --blue-dim:      #6a7aab;
        --border:        #3a3428;
        --border-strong: #4a4030;
        --header-bg:     #1f1c16;
        --prefix:        #5a5040;
        --prefix-nav:    #4a4030;
    }
}
