/* Epochs game — paper/ink aesthetic, reusing the site's CSS variables. */

.game {
    max-width: 820px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
    text-align: center;
}

.game-head {
    margin-bottom: 1rem;
}

.game-eyebrow {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faded);
    font-weight: normal;
    margin: 0;
}

.game-title {
    font-size: 2rem;
    font-style: italic;
    margin: 0.2rem 0 0;
}

.game-sub {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--ink-faded);
}

.game-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    cursor: crosshair;
}

.game-canvas {
    display: block;
    width: min(72vw, 480px);
    height: min(72vw, 480px);
    touch-action: none; /* let drags rotate the rock instead of scrolling the page */
}

.game-status {
    position: absolute;
    top: 0;
    right: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
}

.game-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--terracotta);
    margin-right: 6px;
    animation: game-pulse 2s ease-in-out infinite;
}

@keyframes game-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.game-hint {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faded);
    opacity: 0.7;
    pointer-events: none;
    margin: 0;
}

.game-fallback,
.game-fallback-text {
    max-width: 420px;
    color: var(--ink-faded);
    font-style: italic;
}

.game-stats {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.2rem;
    align-items: center;
    max-width: 640px;
    margin: 1.5rem auto 0;
    border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
    padding-top: 1rem;
}

.game-stat-label {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faded);
    margin-bottom: 0.25rem;
}

.game-stat-value {
    font-size: 1.2rem;
    font-style: italic;
}

.game-progress-track {
    height: 3px;
    background: color-mix(in srgb, var(--ink) 12%, transparent);
    overflow: hidden;
}

.game-progress-fill {
    height: 100%;
    width: 0;
    background: var(--terracotta);
    transition: width 0.3s ease-out;
}

.game-progress-percent {
    font-size: 1.1rem;
    font-style: italic;
    margin-top: 0.35rem;
}

.game-about {
    margin-top: 1.5rem;
    color: var(--ink-faded);
    font-size: 0.95rem;
}

/* Tap ripple, appended to <body> at the pointer position. */
/* --- Tap = a water drop: it falls in, lands, and bursts into a parabolic
       spray of ink droplets. No flat rings (they read as discs on the angled
       3D scene). --- */
.game-splash {
    position: fixed;
    pointer-events: none;
    z-index: 10;
}

/* The incoming drop, accelerating down onto the impact point (JS sets its
   duration); it squashes flat as it lands. */
.game-splash-faller {
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    background: var(--ink-soft);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0;
    animation: game-splash-fall 0.24s ease-in forwards;
}

@keyframes game-splash-fall {
    0% { transform: translateY(-90px) scaleY(1.5); opacity: 0; }
    20% { opacity: 0.9; }
    85% { transform: translateY(0) scaleY(1.3); opacity: 0.9; }
    100% { transform: translate(0, 0) scale(1.6, 0.4); opacity: 0; }
}

/* Outer element throws the droplet horizontally (decelerating); the inner bead
   arcs up to --peak then accelerates down to --fall — together a parabola. */
.game-splash-drop {
    position: absolute;
    left: 0;
    top: 0;
    animation: game-splash-x 0.6s ease-out both;
    animation-delay: var(--fall-delay, 0ms);
}

.game-splash-drop > i {
    display: block;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    background: var(--ink-soft);
    border-radius: 50%;
    animation: game-splash-y 0.6s both;
    animation-delay: var(--fall-delay, 0ms);
}

@keyframes game-splash-x {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--dx)); }
}

@keyframes game-splash-y {
    0% { transform: translateY(0) scale(1); opacity: 0; animation-timing-function: ease-out; }
    12% { opacity: 0.85; }
    30% { transform: translateY(var(--peak)) scale(1); opacity: 0.85; animation-timing-function: ease-in; }
    100% { transform: translateY(var(--fall)) scale(0.45); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .game-splash-drop,
    .game-splash-faller { display: none; }
}

/* --- Homepage teaser (below Rock Cam) --- */
.epoch-teaser {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    background: color-mix(in srgb, var(--terracotta) 5%, transparent);
}

.epoch-teaser-label {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faded);
    margin-bottom: 0.3rem;
}

.epoch-teaser-title {
    font-size: 1rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.epoch-teaser-facts {
    list-style: none;
    margin: 0 0 0.6rem;
    padding: 0;
}

.epoch-teaser-facts li {
    position: relative;
    padding-left: 0.9rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--ink-faded);
}

.epoch-teaser-facts li::before {
    content: '·';
    position: absolute;
    left: 0.1rem;
    color: var(--terracotta);
}

.epoch-teaser-line {
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
}

.epoch-teaser-cta {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terracotta);
}

/* --- Epochs archive --- */
.epochs {
    max-width: 760px;
    margin: 0 auto;
}

.epochs-intro {
    color: var(--ink-faded);
}

.epoch-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

.epoch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.epoch-row--ongoing {
    background: color-mix(in srgb, var(--terracotta) 5%, transparent);
}

.epoch-row-main {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
}

.epoch-row-num {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--ink-faded);
    min-width: 2ch;
    text-align: right;
}

.epoch-row-name {
    font-size: 1.15rem;
    font-style: italic;
}

.epoch-row-meta {
    font-size: 0.78rem;
    color: var(--ink-faded);
}

.epoch-row-stats {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.epoch-row-status {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-faded);
}

.epoch-row-bar {
    width: 90px;
    height: 3px;
    background: color-mix(in srgb, var(--ink) 12%, transparent);
}

.epoch-row-bar span {
    display: block;
    height: 100%;
    background: var(--terracotta);
}

.epoch-row-pct {
    font-style: italic;
    min-width: 3ch;
}

/* --- Epoch detail --- */
.epoch-detail {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.epoch-detail-status {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--terracotta);
}

.epoch-views {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.epoch-view figcaption {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faded);
    margin-top: 0.4rem;
}

.epoch-view-canvas {
    width: min(70vw, 320px);
    height: min(70vw, 320px);
    display: block;
}

.epoch-detail-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.4rem;
    margin: 1rem 0;
}

.epoch-detail-stats dt {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faded);
}

.epoch-detail-stats dd {
    font-size: 1.1rem;
    font-style: italic;
    margin: 0.1rem 0 0;
}

.epoch-timeline {
    margin: 1.5rem auto 0;
    max-width: 320px;
}

.epoch-spark {
    width: 100%;
    height: 48px;
}

.epoch-detail-back {
    margin-top: 1.5rem;
}
