/* ==========================================================
   Vox Deorum Replay stylesheet
   ==========================================================
   A responsive, plain-CSS frame around the map. The layout has
   three rows (header, content, timeline) and two content panels
   (map and events). Wide screens show the panels side by side;
   narrow screens turn them into tabs driven by body[data-view].

   Table of contents:
   1. Palette and shared variables
   2. Reset and base styles
   3. Typography and links
   4. Buttons and form controls
   5. Header
   6. Destination tabs (narrow screens)
   7. Content layout: map and events panels
   8. Map toolbar, layers panel, map buttons, and tile tooltip
   9. Events panel: header, filter, and log
   10. Timeline: transport, range input, chips, popover
   11. Empty state
   12. Loading overlay and error banner
   13. Drag-and-drop overlay
   14. Leaflet overrides
   15. Narrow-screen adjustments
   ========================================================== */

/* ==========================================================
   1. Palette and shared variables
   ========================================================== */
:root {
	/* Civilization-flavored palette: parchment text, gold trim,
	   deep teal panels on a near-black background */
	--parchment: #f2e9c4;
	--parchment-dim: #b9b299;
	--text-inactive: #5f604c;
	--gold: #a58b4c;
	--gold-bright: #e3c37d;
	--teal: #0e5d54;
	--teal-soft: rgba(14, 93, 84, 0.35);
	--bg: #0b100e;
	--panel: #101a17;
	--panel-raised: #16241f;
	--border-gold: rgba(165, 139, 76, 0.5);
	--border-faint: rgba(165, 139, 76, 0.22);
	--message-border: #07201f;
	--danger-bg: #3a1f16;
	--danger-border: #a05c3a;
	--danger-text: #f4d7c4;
	--font-heading: 'EB Garamond', serif;
	--font-body: Lato, Verdana, sans-serif;
	--events-panel-width: 360px;
	--header-height: 56px;
	--timeline-height: 62px;
}

/* ==========================================================
   2. Reset and base styles
   ========================================================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Keep the hidden attribute winning over any display rule */
[hidden] {
	display: none !important;
}

/* Offscreen tile textures that the canvas renderer draws from */
.textures {
	display: none;
}

html,
body {
	height: 100%;
}

body {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	background:
		radial-gradient(1200px 600px at 50% -10%, #142822, transparent),
		var(--bg);
	color: var(--parchment);
	font-family: var(--font-body);
	font-size: 16px;
}

/* Visible keyboard focus everywhere */
:focus-visible {
	outline: 2px solid var(--gold-bright);
	outline-offset: 2px;
}

/* ==========================================================
   3. Typography and links
   ========================================================== */
h1,
h2,
h3 {
	font-family: var(--font-heading);
	font-weight: 600;
	color: var(--parchment);
}

a {
	color: var(--gold-bright);
	text-decoration: underline;
}

a:hover {
	color: #f0dfae;
}

/* ==========================================================
   4. Buttons and form controls
   ========================================================== */
/* Shared look for every button-like control */
.action-button,
.chip,
.map-button,
.transport-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(180deg, var(--panel-raised), var(--panel));
	color: var(--parchment);
	border: 1px solid var(--border-gold);
	border-radius: 6px;
	cursor: pointer;
	font-family: var(--font-body);
	line-height: 1.2;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.action-button:hover,
.chip:hover,
.map-button:hover,
.transport-button:hover {
	border-color: var(--gold-bright);
	color: #fffdf2;
	background: linear-gradient(180deg, #1d2f29, #14221d);
}

.action-button:active,
.chip:active,
.map-button:active,
.transport-button:active {
	background: linear-gradient(180deg, var(--teal), #0a423c);
}

/* Header-sized action, e.g. Open */
.action-button {
	padding: 9px 14px;
	font-size: 0.95rem;
}

/* Small labeled buttons in the timeline and popover */
.chip {
	padding: 6px 10px;
	font-size: 0.85rem;
}

/* Buttons that sit on top of the map */
.map-button {
	padding: 8px 10px;
	font-size: 0.85rem;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Square transport buttons for playback */
.transport-button {
	width: 40px;
	height: 40px;
	font-size: 0.95rem;
	flex-shrink: 0;
}

.transport-button.play {
	border-color: var(--gold-bright);
	color: var(--gold-bright);
}

.transport-button.play:hover {
	background: linear-gradient(180deg, #1d2f29, #14221d);
	color: #f0dfae;
}

/* The play button glows gently while playing */
body.playing .transport-button.play {
	background: linear-gradient(180deg, var(--teal), #0a423c);
	color: #fffdf2;
}

/* Checkboxes and radios keep their native shape with a gold accent */
input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--gold);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
}

/* Number and text inputs */
input[type="number"] {
	background: var(--bg);
	color: var(--parchment);
	border: 1px solid var(--border-gold);
	border-radius: 6px;
	padding: 7px 9px;
	font-family: var(--font-body);
	font-size: 0.9rem;
	width: 90px;
}

/* Details summaries behave like buttons, without the default marker */
summary {
	list-style: none;
}

summary::-webkit-details-marker {
	display: none;
}

/* ==========================================================
   5. Header
   ========================================================== */
.app-header {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: var(--header-height);
	padding: 0 14px;
	border-bottom: 1px solid var(--border-faint);
	background: linear-gradient(180deg, #16241f, #0e1916);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.brand i {
	color: var(--gold-bright);
	font-size: 1.15rem;
}

.brand h1 {
	font-size: 1.25rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

/* Loaded-game summary and annotation line */
.game-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1px;
	min-width: 0;
	overflow: hidden;
}

/* Loaded-game summary: name, then game speed and map size, each with an icon */
.game-summary {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85rem;
	color: var(--parchment-dim);
	white-space: nowrap;
	overflow: hidden;
}

.summary-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
}

.summary-item i {
	color: var(--gold);
	font-size: 0.78rem;
}

.annotation-line {
	font-size: 0.85rem;
	color: var(--gold-bright);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#openButton {
	margin-left: auto;
}

/* ==========================================================
   6. Destination tabs (narrow screens)
   ========================================================== */
.view-tabs {
	display: none;
	border-bottom: 1px solid var(--border-faint);
	background: var(--panel);
}

.view-tab {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 8px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--parchment-dim);
	font-family: var(--font-body);
	font-size: 0.95rem;
	cursor: pointer;
}

.view-tab:hover {
	color: var(--parchment);
}

.view-tab.active {
	color: var(--gold-bright);
	border-bottom-color: var(--gold);
	background: rgba(165, 139, 76, 0.08);
}

/* ==========================================================
   7. Content layout: map and events panels
   ========================================================== */
.app-main {
	flex: 1;
	display: flex;
	min-height: 0;
	position: relative;
}

.map-panel {
	flex: 1;
	position: relative;
	min-width: 0;
}

.map {
	position: absolute;
	inset: 0;
}

.events-panel {
	width: var(--events-panel-width);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-left: 1px solid var(--border-faint);
	background: var(--panel);
}

/* ==========================================================
   8. Map toolbar, layers panel, map buttons, and tile tooltip
   ========================================================== */
.map-toolbar {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1000;
}

.layers-control {
	position: relative;
	display: inline-block;
}

.layers-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 220px;
	background: var(--panel-raised);
	border: 1px solid var(--border-gold);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	padding: 8px 10px;
	z-index: 1001;
}

.layer-option,
.filter-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 6px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	user-select: none;
}

.layer-option:hover,
.filter-option:hover {
	background: rgba(165, 139, 76, 0.12);
}

.layer-option i,
.filter-option i {
	color: var(--gold-bright);
	width: 16px;
	text-align: center;
}

.map-buttons {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.map-buttons .map-button {
	width: 42px;
	height: 42px;
	padding: 0;
}

/* Hover card describing the map plot under the cursor */
.tile-tooltip {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 500;
	pointer-events: none;
	background: rgba(22, 36, 31, 0.95);
	border: 1px solid var(--border-gold);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	padding: 7px 10px;
	font-size: 0.85rem;
	line-height: 1.45;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tile-tooltip .tt-coords {
	color: var(--parchment-dim);
}

/* Fallback tint for owners whose civilization color is unknown */
.tile-tooltip .tt-owner span:first-child {
	color: var(--gold-bright);
}

.tile-tooltip .tt-city,
.tile-tooltip .tt-terrain {
	color: var(--parchment);
}

/* Model or player identity line, quieter than the civ name above it */
.tile-tooltip .tt-model {
	color: var(--parchment-dim);
	font-size: 0.78rem;
}

/* ==========================================================
   9. Events panel: header, filter, and log
   ========================================================== */
.events-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 12px;
	border-bottom: 1px solid var(--border-faint);
	background: linear-gradient(180deg, var(--panel-raised), var(--panel));
	flex-shrink: 0;
}

.events-header h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1.1rem;
	white-space: nowrap;
}

.events-header h2 i {
	color: var(--gold-bright);
	font-size: 0.95rem;
}

.events-filter {
	position: relative;
}

.filter-panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 240px;
	background: var(--panel-raised);
	border: 1px solid var(--border-gold);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	padding: 8px 10px;
	z-index: 30;
}

.log-messages {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Event entries */
.message {
	padding: 5px 10px;
	background-color: var(--bg);
	border-bottom: 2px solid var(--message-border);
	/* Long unbreakable tokens (slash-joined identifiers, URLs) wrap
	   instead of pushing a horizontal scrollbar into the list */
	overflow-wrap: break-word;
}

.message:not(.active) {
	color: var(--text-inactive);
}

.message.active:hover {
	background: linear-gradient(to bottom, var(--teal) 0%, #35746c 100%);
}

/* Entries that point at map plots invite the click */
.message.locatable {
	cursor: pointer;
}

.message.hidden {
	display: none;
}

/* Civilization line above an event */
.civ-header {
	display: flex;
	align-items: center;
	margin-bottom: 3px;
}

.civ-circle {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 6px;
	flex-shrink: 0;
}

.civ-rectangle {
	display: inline-block;
	width: 10px;
	height: 10px;
	background-color: #888;
	margin-right: 6px;
	flex-shrink: 0;
}

.civ-name {
	font-weight: bold;
	font-size: 0.9em;
}

/* Annotation shown next to the civilization name, e.g. "· GLM" */
.civ-annotation {
	color: var(--gold-bright);
	font-style: italic;
	font-weight: normal;
	margin-left: 5px;
	font-size: 0.9em;
}

.message:not(.active) .civ-annotation {
	opacity: 0.7;
}

.event-text {
	line-height: 1.4;
}

/* Formatted game text with icons and colors */
.formatted-text {
	line-height: 1.6;
	display: inline;
}

.formatted-text .game-icon {
	margin: 0 3px;
	font-size: 1.1em;
	vertical-align: middle;
	display: inline-block;
}

.formatted-text .game-icon.fa-circle {
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.formatted-text .colored-text {
	font-weight: 500;
}

.message:not(.active) .formatted-text .colored-text {
	opacity: 0.7;
}

/* Strategy change entries */
.strategy-change {
	margin-top: 4px;
}

.strategy-change-item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.strategy-key {
	font-weight: bold;
	min-width: fit-content;
}

.strategy-header {
	margin-bottom: 4px;
}

.strategy-from,
.strategy-to {
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 0.9em;
	border-width: 1px;
	border-style: solid;
}

.strategy-to {
	font-weight: 500;
}

.strategy-arrow {
	font-weight: bold;
	font-size: 1.1em;
}

.strategy-rationale {
	margin-top: 6px;
	padding: 6px 8px;
	border-radius: 0 3px 3px 0;
	line-height: 1.4;
	border-left-width: 3px;
	border-left-style: solid;
}

.rationale-label {
	font-weight: bold;
	font-style: normal;
}

/* Active strategy colors */
.message.active .strategy-key {
	color: var(--parchment);
}

.message.active .strategy-from {
	background-color: rgba(165, 139, 76, 0.2);
	color: #d4c5a3;
	border-color: rgba(165, 139, 76, 0.4);
}

.message.active .strategy-to {
	background-color: var(--teal-soft);
	color: var(--parchment);
	border-color: rgba(14, 93, 84, 0.8);
}

.message.active .strategy-arrow {
	color: var(--gold-bright);
}

.message.active .strategy-rationale {
	background-color: rgba(13, 54, 48, 0.3);
	border-left-color: var(--gold);
}

.message.active .rationale-label {
	color: var(--gold-bright);
}

/* Inactive strategy colors */
.message:not(.active) .strategy-key {
	color: var(--text-inactive);
}

.message:not(.active) .strategy-from {
	background-color: rgba(61, 61, 48, 0.2);
	color: #5a5a4a;
	border-color: rgba(61, 61, 48, 0.4);
}

.message:not(.active) .strategy-to {
	background-color: rgba(61, 61, 48, 0.3);
	color: #6a6a5a;
	border-color: rgba(61, 61, 48, 0.5);
}

.message:not(.active) .strategy-arrow {
	color: #5a5a4a;
}

.message:not(.active) .strategy-rationale {
	background-color: rgba(26, 26, 20, 0.3);
	border-left-color: #4a4a3a;
	color: var(--text-inactive);
}

.message:not(.active) .rationale-label {
	color: #5a5a4a;
}

/* Turn separators between event groups */
.turn-separator {
	padding: 5px 10px;
	background: linear-gradient(to right, var(--teal), #35746c);
	color: var(--parchment);
	font-weight: bold;
	font-family: var(--font-heading);
	font-size: 14px;
	text-align: center;
	border-top: 2px solid var(--gold);
	border-bottom: 2px solid var(--gold);
	margin: 5px 0;
}

.turn-separator:not(.active) {
	background: linear-gradient(to right, #1a1a14, #2a2a1f);
	color: var(--text-inactive);
	border-color: var(--message-border);
}

/* ==========================================================
   10. Timeline: transport, range input, chips, popover
   ========================================================== */
.timeline {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: var(--timeline-height);
	padding: 10px 14px;
	border-top: 1px solid var(--border-faint);
	background: linear-gradient(180deg, #101c18, #0c1512);
}

.transport {
	display: flex;
	gap: 6px;
}

/* Native range input styled like an old scroll track */
#turnRange {
	flex: 1;
	min-width: 60px;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	height: 32px;
	cursor: pointer;
}

#turnRange::-webkit-slider-runnable-track {
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(180deg, #1c2a26, #14201c);
	border: 1px solid var(--border-faint);
}

#turnRange::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 22px;
	height: 22px;
	margin-top: -8px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #f0dfae, var(--gold) 60%);
	border: 1px solid #6e5a2c;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#turnRange::-moz-range-track {
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(180deg, #1c2a26, #14201c);
	border: 1px solid var(--border-faint);
}

#turnRange::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #f0dfae, var(--gold) 60%);
	border: 1px solid #6e5a2c;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.timeline-meta {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* Short turn label is only used on narrow screens */
.turn-short {
	display: none;
}

/* Popover with the go-to field and the speed choice */
.turn-popover {
	position: absolute;
	right: 14px;
	bottom: calc(100% + 8px);
	width: min(280px, calc(100vw - 28px));
	background: var(--panel-raised);
	border: 1px solid var(--border-gold);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
	padding: 14px;
	z-index: 100;
}

.goto-form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.goto-form label {
	font-size: 0.85rem;
	color: var(--parchment-dim);
	flex-shrink: 0;
}

.goto-form input {
	flex: 1;
	width: auto;
	min-width: 0;
}

.speed-section {
	margin-top: 14px;
	border-top: 1px solid var(--border-faint);
	padding-top: 10px;
}

.speed-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-heading);
	color: var(--gold-bright);
	margin-bottom: 4px;
}

.speed-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 6px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	user-select: none;
}

.speed-option:hover {
	background: rgba(165, 139, 76, 0.12);
}

.speed-option i {
	color: var(--gold-bright);
	width: 16px;
	text-align: center;
}

/* ==========================================================
   11. Empty state
   ========================================================== */
.empty-state {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	background:
		radial-gradient(900px 480px at 50% -5%, #173029, transparent),
		var(--bg);
}

.empty-state .action-button {
	margin: 16px 0;
}

.empty-card {
	max-width: 600px;
	width: calc(100% - 32px);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 13px;
	padding: 36px 16px;
}

.empty-title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 2rem;
	letter-spacing: 0.04em;
}

.empty-title i {
	color: var(--gold-bright);
	font-size: 1.7rem;
}

.empty-subtitle {
	color: var(--parchment-dim);
	font-size: 0.95rem;
}

.empty-open {
	font-size: 1.05rem;
	padding: 12px 20px;
	border-color: var(--gold-bright);
}

.drop-hint {
	color: var(--parchment-dim);
	font-size: 0.9rem;
}

.drop-hint i {
	margin-right: 4px;
}

.examples-label {
	margin-top: 14px;
	font-family: var(--font-heading);
	font-size: 1.05rem;
	color: var(--gold-bright);
}

.examples {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.example-button {
	flex-direction: column;
	gap: 2px;
	padding: 10px 16px;
	min-width: 96px;
}

.example-button .example-kind {
	font-size: 0.72rem;
	color: var(--parchment-dim);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.example-button:hover .example-kind {
	color: var(--parchment);
}

.disclaimer {
	font-size: 0.72rem;
	color: #6f7a6c;
	margin-top: 16px;
	line-height: 1.55;
	max-width: 520px;
}

/* ==========================================================
   12. Loading overlay and error banner
   ========================================================== */
.loading-overlay {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(8, 12, 10, 0.78);
	font-size: 1.05rem;
}

.loading-overlay i {
	color: var(--gold-bright);
	font-size: 1.4rem;
}

.error-banner {
	position: fixed;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 300;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(560px, calc(100vw - 24px));
	background: var(--danger-bg);
	border: 1px solid var(--danger-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	padding: 8px 8px 8px 14px;
	color: var(--danger-text);
	font-size: 0.9rem;
}

.error-banner i {
	flex-shrink: 0;
}

.error-banner span {
	flex: 1;
}

.error-banner .transport-button {
	width: 32px;
	height: 32px;
	background: transparent;
	border-color: var(--danger-border);
	color: var(--danger-text);
}

/* ==========================================================
   13. Drag-and-drop overlay
   ========================================================== */
body.drag-over::after {
	content: "Drop your .Civ5Replay or .Civ5Save file to load it";
	position: fixed;
	top: 8px;
	left: 8px;
	right: 8px;
	bottom: 8px;
	background: rgba(13, 54, 48, 0.9);
	border: 3px dashed var(--gold-bright);
	border-radius: 12px;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 20px;
	font-size: 1.4rem;
	font-family: var(--font-heading);
	color: var(--parchment);
	pointer-events: none;
}

/* ==========================================================
   14. Leaflet overrides
   ========================================================== */
.leaflet-container {
	background: var(--bg);
	font-family: var(--font-body);
}

/* ==========================================================
   15. Narrow-screen adjustments
   ========================================================== */
/* Below the tab breakpoint the events panel overlays the map */
@media (max-width: 900px) {
	.view-tabs {
		display: flex;
	}

	.events-panel {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		border-left: none;
		z-index: 10;
		display: none;
	}

	body[data-view="events"] .events-panel {
		display: flex;
	}

	/* While the Events tab is active the map steps aside completely, its
	   floating controls included. Visibility keeps the element's size, so
	   Leaflet's container stays valid for the switch back. */
	body[data-view="events"] .map-panel {
		visibility: hidden;
	}
}

/* Phone-sized tweaks: compact header, tighter timeline */
@media (max-width: 640px) {
	.app-header {
		gap: 10px;
		padding: 0 8px;
	}

	.brand h1 {
		font-size: 1.05rem;
	}

	.game-summary {
		display: none;
	}

	.annotation-line {
		font-size: 0.78rem;
	}

	/* First and last turn buttons move out of the row */
	#firstButton,
	#lastButton {
		display: none;
	}

	.timeline {
		gap: 10px;
		padding: 8px 10px;
	}

	/* Swap the long turn label for the bare number */
	.turn-long {
		display: none;
	}

	.turn-short {
		display: inline;
	}

	.chip {
		padding: 8px 10px;
	}
}
