@font-face { font-family: Versa; src: url(../fonts/Versa.woff) format('woff'); font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #2b2b2b; }
body { font: 13px/1.4 Tahoma, Verdana, "Segoe UI", sans-serif; color: #111; }
button { font: inherit; color: inherit; }

.window { display: flex; flex-direction: column; height: 100vh; min-width: 900px; background: #c3c3c3; border: 2px solid #000; }
.titlebar { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 10px; background: #14286e; color: #fff; }
.titlebar .title { font: 20px Versa, Tahoma, sans-serif; letter-spacing: .5px; }
.title-info { font-size: 12px; color: #c9d3f5; }

.menubar { flex: 0 0 auto; display: flex; gap: 2px; padding: 2px 6px; border-bottom: 1px solid #6b6b6b; position: relative; z-index: 20; }
.menu { position: relative; }
.menu > button { background: none; border: 0; padding: 4px 10px; cursor: pointer; }
.menu > button:hover, .menu.open > button { background: #14286e; color: #fff; }
.dropdown { display: none; position: absolute; left: 0; top: 100%; min-width: 230px; background: #c3c3c3; border: 2px solid; border-color: #fff #555 #555 #fff; padding: 2px; }
.menu.open .dropdown { display: block; }
.dropdown button { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; padding: 5px 10px; cursor: pointer; }
.dropdown button:hover { background: #14286e; color: #fff; }
kbd { font: inherit; color: #555; }
.dropdown button:hover kbd { color: #c9d3f5; }

.body { flex: 1 1 auto; display: flex; gap: 6px; padding: 6px; min-height: 0; }
.bevel-in { border: 2px solid; border-color: #6b6b6b #fff #fff #6b6b6b; }
.map-pane { flex: 1 1 auto; position: relative; overflow: hidden; background: #0b0b0b; min-width: 0; }
#map { display: block; width: 100%; height: 100%; cursor: grab; image-rendering: pixelated; }
#map.dragging { cursor: grabbing; }
.zoom-ctl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 4px; }

.side { flex: 0 0 300px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.panel { border: 2px solid; border-color: #fff #6b6b6b #6b6b6b #fff; background: #c3c3c3; }
.panel.grow { flex: 1 1 auto; min-height: 120px; overflow: auto; }
.wtitle { font: 15px Versa, Tahoma, sans-serif; color: #fff; background: #14286e; padding: 3px 8px; }
#minimap { display: block; margin: 6px; width: calc(100% - 12px); background: #0b0b0b; cursor: pointer; image-rendering: pixelated; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 8px 12px; }
.stats span { display: block; color: #444; font-size: 12px; }
.stats b { font-size: 15px; }
.tile-info { padding: 8px 12px; line-height: 1.5; }
.tile-info h3 { margin: 0 0 4px; font: 16px Versa, Tahoma, sans-serif; }
.tile-info .muted { color: #444; }

.btn { border: 2px solid; border-color: #fff #555 #555 #fff; background: #c3c3c3; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.btn:active { border-color: #555 #fff #fff #555; }
.btn.icon { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
.end-turn { padding: 12px; font-size: 15px; background: #d6d6d6; }
.statusbar { flex: 0 0 auto; padding: 3px 10px; border-top: 1px solid #6b6b6b; color: #333; font-size: 12px; }

#dialog-layer { position: fixed; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; z-index: 50; }
.dialog { pointer-events: auto; width: min(460px, 92vw); background: #c3c3c3; border: 2px solid; border-color: #fff #555 #555 #fff; box-shadow: 4px 4px 0 rgba(0,0,0,.45); }
.dialog .wtitle { font-size: 16px; }
.dialog .dbody { padding: 12px 14px; line-height: 1.5; }
.dialog .dbody p { margin: 0 0 10px; }
.dialog .dbtns { display: flex; justify-content: flex-end; gap: 8px; padding: 0 14px 12px; }
.dialog table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dialog td, .dialog th { text-align: left; padding: 3px 6px; border-bottom: 1px dotted #888; vertical-align: top; }

.small { font-size: 12px; }
.muted { color: #444; }
.unit-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.unit-row canvas { width: 40px; height: 40px; image-rendering: pixelated; border: 1px solid #555; flex: none; }
.orders { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.orders .btn { padding: 5px 8px; font-size: 12px; }
.btn[disabled] { color: #777; cursor: default; }
.bar { height: 10px; border: 1px solid #555; background: #fff; margin: 3px 0 8px; }
.bar i { display: block; height: 100%; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.yields { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; margin: 4px 0; }
select { width: 100%; font: inherit; padding: 3px; border: 2px solid; border-color: #555 #fff #fff #555; background: #fff; }
.tile-info ul { margin: 0; padding-left: 18px; }
.dialog ul { margin: 0; padding-left: 18px; }
#tile-info { font-size: 12px; }

.pad { padding: 6px 12px 10px; }
.research { padding-top: 0; }
.btn.tiny { padding: 1px 6px; font-size: 11px; }
.btn.small { padding: 2px 8px; font-size: 12px; }
.dialog.wide { width: min(680px, 94vw); }
.dialog .dbody { max-height: 70vh; overflow: auto; }
.tech-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 8px 0; }
.tech { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px; background: #d6d6d6; border: 2px solid; border-color: #fff #555 #555 #fff; cursor: pointer; }
.tech:hover { background: #e4e4e4; }
.tech.on { outline: 2px solid #14286e; }
.slider-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; margin: 8px 0; }
.slider-row input { width: 100%; }
#campus-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#campus-layer .cs { pointer-events: auto; position: absolute; inset: 0; display: flex; flex-direction: column; background: #c3c3c3; border: 2px solid #000; }
.cs .titlebar { gap: 16px; }
.cs-nav { display: flex; gap: 6px; }
.cs-grid { flex: 1; min-height: 0; display: grid; gap: 6px; padding: 6px; grid-template-columns: 300px minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr) 230px; overflow: auto; }
.cs-area canvas { display: block; margin: 6px auto 0; background: #0b0b0b; }
.cs-view { display: flex; flex-direction: column; background: #4f6b3a; min-height: 0; }
.cs-view canvas { flex: 1; min-height: 0; width: 100%; object-fit: contain; display: block; }
.cs-students { background: #d6d6d6; padding: 6px 10px; font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid #6b6b6b; }
.sw { display: inline-block; width: 10px; height: 10px; }
.kv { display: flex; justify-content: space-between; border-bottom: 1px dotted #888; padding: 3px 0; font-size: 12px; }
.list .row { display: flex; gap: 8px; justify-content: space-between; align-items: center; border-bottom: 1px dotted #888; padding: 3px 0; font-size: 12px; }
.list .row span:first-child { flex: 1; }
.build-name { font-weight: 600; font-size: 14px; }
.cs select { margin: 2px 0 4px; }
@media (max-width: 1100px) { .cs-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; } .cs-view { grid-column: 1 / -1; order: -1; min-height: 360px; } }

.warn { color: #9b1c1c; font-weight: 700; margin: 4px 0; }
.dialog tr.me td { background: #e8e1c8; font-weight: 600; }
.dialog .dbtns { flex-wrap: wrap; }

.gov-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding-top: 0; }
label.radio { display: block; padding: 6px 4px; border-bottom: 1px dotted #888; cursor: pointer; }
.dialog h4 { margin: 12px 0 4px; font: 15px Versa, Tahoma, sans-serif; }
button.link { background: none; border: 0; padding: 0; color: #14286e; text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }

.statusbar.flash-good { animation: flashGood 1.6s ease-out; font-weight: bold; }
.statusbar.flash-bad { animation: flashBad 1.6s ease-out; font-weight: bold; }
@keyframes flashGood { 0% { background: #b7e4b0; } 100% { background: transparent; } }
@keyframes flashBad { 0% { background: #f3b0a8; } 100% { background: transparent; } }
.level-list { display: grid; gap: 4px; margin: 6px 0; }
label.level-row { display: block; padding: 5px 8px; border: 1px solid #b9b9b9; background: #f4f4f0; cursor: pointer; }
label.level-row:has(input:checked) { background: #fff6d6; border-color: #8a6d1d; }

.newgame { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.newgame h4 { margin: 4px 0; font-family: Versa, sans-serif; letter-spacing: .03em; }
label.civ-row { border-left: 0; padding-left: 18px; position: relative; }
label.civ-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: var(--tex, var(--civ)); }
.dialog.wide:has(.newgame) { width: min(900px, 94vw); max-height: 92vh; overflow: auto; }
label.level-row.compact { padding: 3px 8px; }
canvas.goto { cursor: crosshair; }
.btn.on { background: #ffe9a8; }
button.link-row { display: block; width: 100%; text-align: left; }
table.battle { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
table.battle th { text-align: left; width: 80px; color: #444; }
table.battle td, table.battle th { padding: 3px 6px; border-bottom: 1px solid #ccc; }

.menubar { display: flex; }
.sound-btns { margin-left: auto; display: flex; gap: 2px; padding-right: 6px; align-items: center; }
.sound-btn { font-size: 14px; min-width: 30px; padding: 1px 6px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.sound-btn:hover { border-color: #888; }
.sound-btn.off { opacity: .35; text-decoration: line-through; }

/* ---------- title screen (Civ II style) ---------- */
.window { position: relative; }
#dialog-layer { z-index: 60; }
#title-screen { position: absolute; left: 0; right: 0; bottom: 0; top: 0; z-index: 40; overflow: hidden;
  background: radial-gradient(ellipse at 55% 50%, #cdbd95 0%, #bfae86 55%, #a99872 100%); }
.ts-seal { position: absolute; left: 57%; top: 47%; transform: translate(-50%, -50%); filter: drop-shadow(3px 5px 6px rgba(60,40,10,.35)); }
.ts-mapframe { position: absolute; left: 3.5%; top: 6%; padding: 6px; background: #e9e4da; border: 3px solid; border-color: #fff #6d6a63 #6d6a63 #fff; box-shadow: 4px 6px 10px rgba(0,0,0,.3); }
.ts-mapframe canvas { display: block; width: 460px; height: 290px; image-rendering: auto; border: 2px solid; border-color: #6d6a63 #fff #fff #6d6a63; }
.ts-year { position: absolute; right: 14px; bottom: 12px; font: 13px Versa, sans-serif; color: #fff; background: rgba(0,0,0,.55); padding: 2px 8px; letter-spacing: .04em; }
.ts-menu { position: absolute; right: 3.5%; bottom: 7%; width: 390px; background: linear-gradient(#cfcfcf, #b9b9b9); border: 3px solid; border-color: #fff #555 #555 #fff; box-shadow: 4px 6px 12px rgba(0,0,0,.35); padding: 8px; }
.ts-menu-title { font: 24px Versa, Georgia, serif; text-align: center; color: #333; padding: 6px 4px 8px; border-bottom: 2px groove #eee; margin-bottom: 6px; }
.ts-list { background: linear-gradient(#bdbdbd, #a9a9a9); border: 2px solid; border-color: #666 #eee #eee #666; padding: 6px 10px; }
.ts-item { display: flex; align-items: center; gap: 12px; font: 22px Georgia, 'Times New Roman', serif; color: #3a3a3a; padding: 4px 2px; cursor: pointer; text-shadow: 0 1px 0 #ddd; }
.ts-item input { position: absolute; opacity: 0; pointer-events: none; }
.ts-dot { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #9a9a9a); border: 1px solid #555; flex: none; }
.ts-item input:checked + .ts-dot { background: radial-gradient(circle, #222 0 35%, #eee 40%, #9a9a9a 100%); }
.ts-item:hover { color: #000; }
.ts-btns { display: flex; justify-content: center; padding-top: 8px; }
.ts-btns .btn { min-width: 140px; font-size: 16px; padding: 6px 12px; }
.ts-foot { position: absolute; left: 3.5%; bottom: 10px; font: 12px Tahoma, sans-serif; color: #4b3d22; }
.ts-foot .link { color: #4b3d22; }

/* ---------- diploma ---------- */
.diploma { position: relative; margin: 2px auto 8px; padding: 26px 34px 18px; max-width: 720px; text-align: center; color: #3b2a12;
  background: radial-gradient(ellipse at 50% 40%, #fbf6e6 0%, #f1e6c8 70%, #e6d6ae 100%); border: 6px double #8a6d1d; outline: 2px solid #c8ad6a; outline-offset: -14px; font-family: Georgia, 'Times New Roman', serif; }
.diploma.notice { background: radial-gradient(ellipse at 50% 40%, #f3f1ec 0%, #e4e0d6 100%); border-color: #7a2a2a; outline-color: #b58a8a; color: #2b2323; }
.dip-head { font: 34px Versa, Georgia, serif; letter-spacing: .06em; margin-bottom: 6px; }
.notice .dip-head { color: #7a2a2a; }
.dip-small { margin: 2px 0; font-style: italic; font-size: 14px; }
.dip-name { font: italic bold 32px Georgia, serif; margin: 8px 0 2px; }
.dip-body { font-size: 16px; line-height: 1.45; margin: 10px auto; max-width: 560px; }
.dip-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0 6px; border-top: 1px solid #c8ad6a; border-bottom: 1px solid #c8ad6a; padding: 8px 0; }
.dip-stats b { display: block; font-size: 18px; }
.dip-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #6b5638; }
.dip-sign { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; }
.dip-sign > div { flex: 1; display: flex; flex-direction: column; align-items: center; }
.dip-sign .sig { font: 20px 'Brush Script MT', 'Segoe Script', 'Lucida Handwriting', cursive; border-bottom: 1px solid #3b2a12; padding: 0 10px 2px; min-width: 170px; white-space: nowrap; }
.dip-sign i { font-size: 11px; margin-top: 3px; }
.dip-seal { flex: none; }
.dip-note { margin: 4px 0; }
.dip-details summary { cursor: pointer; font-weight: bold; margin: 6px 0; }

/* ---------- Hall of Fame ---------- */
.hof h3 { font: 16px Versa, sans-serif; letter-spacing: .05em; margin: 12px 0 6px; border-bottom: 1px solid #999; }
.hof-medals { display: flex; justify-content: center; gap: 18px; }
.hof-medal { display: flex; flex-direction: column; align-items: center; width: 92px; text-align: center; }
.hof-disc { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: bold 22px Georgia, serif; color: #777;
  background: radial-gradient(circle at 35% 30%, #f2f2f2, #9d9d9d); border: 3px solid #8a8a8a; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.hof-medal.won .hof-disc { color: #5a3d00; background: radial-gradient(circle at 35% 30%, #fff3b8, #d4a017 70%, #9a7310); border-color: #7a5a10; }
.hof-ribbon { width: 26px; height: 30px; margin-top: -6px; background: #9a9a9a; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.hof-medal.won .hof-ribbon { background: linear-gradient(90deg, #1f3d7a 0 33%, #c9a227 33% 66%, #1f3d7a 66%); }
.hof-medal b { margin-top: 4px; font-size: 13px; }
.hof-medal span { font-size: 11px; color: #555; }
.hof-systems { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 4px; }
.hof-sys { display: flex; flex-direction: column; align-items: center; width: 86px; font-size: 11px; text-align: center; }
.hof-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.hof-stats div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #aaa; padding: 2px 0; }
.hof-stats i { font-size: 11px; color: #555; }
.hof-hist { width: 100%; font-size: 12px; border-collapse: collapse; }
.hof-hist th, .hof-hist td { text-align: left; padding: 2px 4px; border-bottom: 1px solid #ccc; }

/* College Towns branding, as on the other College Towns apps */
.titlebar .powered { margin-left: 12px; font: 10px Tahoma, sans-serif; line-height: 1; letter-spacing: .06em; text-transform: uppercase; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.55); border-radius: 20px; padding: 4px 9px; white-space: nowrap; }
.titlebar .powered:hover { background: rgba(255,255,255,.15); }
.ts-foot a { color: #4b3d22; }
.ts-reading { position: absolute; left: 3.5%; top: calc(6% + 330px); width: 474px; background: #e9e4da; border: 3px solid; border-color: #fff #6d6a63 #6d6a63 #fff; box-shadow: 4px 6px 10px rgba(0,0,0,.25); padding: 8px 12px; font: 13px Georgia, serif; color: #3a3226; }
.ts-reading h4 { margin: 0 0 6px; font: 13px Versa, sans-serif; letter-spacing: .06em; color: #4b3d22; }
.ts-reading a { display: block; color: #1f3d7a; text-decoration: none; margin: 4px 0; }
.ts-reading a:hover { text-decoration: underline; }
.ts-reading span { display: block; font-size: 11px; color: #6b5f4a; font-style: italic; }
.reading-list a { display: block; margin: 6px 0; }
.reading-list span { display: block; font-size: 11px; color: #555; font-style: italic; }

.debt { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.debt-bar { display: inline-block; width: 64px; height: 8px; border: 1px solid #777; background: #e8e8e8; position: relative; }
.debt-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #d9a400, #c8102e); }
.debt-bar.crisis > i { background: #c8102e; }

/* keep the side panel inside the window on short screens: End turn always visible, the middle panels shrink and scroll */
.side { overflow: hidden; }
.side > .panel { flex: 0 0 auto; }
.side > .panel.grow { flex: 1 1 auto; min-height: 70px; overflow: auto; }
.side > .end-turn { flex: none; margin-top: auto; }
/* one-line status bar; the full message is in its tooltip */
.statusbar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 22px; line-height: 16px; }
@media (max-height: 800px) {
  #minimap { margin: 4px; }
  .stats { padding: 5px 10px; gap: 3px 10px; }
  .tile-info { padding: 6px 10px; line-height: 1.4; }
  .end-turn { padding: 8px; }
}

/* tile info floats over the bottom-left of the map while you point at a hex */
.tile-float { position: absolute; left: 10px; bottom: 10px; max-width: 290px; padding: 6px 10px; font-size: 12px; line-height: 1.4;
  background: rgba(225,225,225,.94); border: 2px solid; border-color: #fff #6b6b6b #6b6b6b #fff; box-shadow: 2px 3px 6px rgba(0,0,0,.35); pointer-events: none; z-index: 5; }
.tile-float .yields { margin: 2px 0; gap: 8px; }
.tile-float .muted { color: #444; }
.tile-float .small { font-size: 11px; }
/* a tighter unit panel */
#sel-body { padding: 6px 10px; line-height: 1.35; font-size: 13px; }
#sel-body .unit-row { gap: 8px; margin-bottom: 4px; align-items: flex-start; }
#sel-body .unit-row canvas { width: 34px; height: 34px; }
#sel-body .unit-row .muted { font-size: 12px; }
#sel-body .orders { gap: 4px; margin: 6px 0; }
#sel-body .orders .btn { padding: 3px 7px; font-size: 11.5px; }
#sel-body .small, #sel-body .muted.small { font-size: 11.5px; }
/* status lines: level and governance on one line, the debt bar on its own */
.gov-line { flex-wrap: wrap; gap: 2px 10px; }
.gov-line .debt { flex-basis: 100%; justify-content: flex-start; }
.gov-line .debt-bar { flex: 1; max-width: 140px; }

@media (max-height: 820px) {
  #minimap { height: 112px; width: auto; max-width: calc(100% - 8px); margin: 4px auto; }
  #sel-body .tip { display: none; }
  .wtitle { padding: 2px 8px; }
}

/* phones: a polite note instead of a cramped game */
#small-screen { position: fixed; inset: 0; z-index: 200; background: radial-gradient(ellipse at 50% 30%, #d6c7a2, #b3a17a); display: flex; align-items: center; justify-content: center; padding: 18px; overflow: auto; }
#small-screen .ss-box { max-width: 420px; text-align: center; font: 16px Georgia, serif; color: #3a3226; }
#small-screen h2 { font: 24px Versa, sans-serif; letter-spacing: .04em; margin: 8px 0; }
#small-screen .reading-list { text-align: left; background: #efe8d6; border: 1px solid #a89870; padding: 8px 12px; margin: 12px 0; }
#small-screen .reading-list a { color: #1f3d7a; }
#small-screen .small { font-size: 12px; }
#small-screen .small a { color: #3a3226; }
html.small-note #app { display: none; }
html.small-note, html.small-note body { overflow: auto; }
#small-screen { position: fixed; }

/* campus screen: units on campus and the production picker */
.cs-unit { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dotted #aaa; }
.cs-ico { width: 28px; height: 28px; image-rendering: pixelated; border: 1px solid #888; flex: none; }
.cs-utext { flex: 1; min-width: 0; }
.cs { position: relative; }
.cs-pick { position: absolute; inset: 40px 10% 20px; background: #c9c9c9; border: 2px solid; border-color: #fff #555 #555 #fff; box-shadow: 4px 4px 0 rgba(0,0,0,.35); display: flex; flex-direction: column; z-index: 5; }
.cs-pick-body { overflow: auto; padding: 6px 12px; flex: 1; }
.cs-pick h4 { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.cs-opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: #f4f1e6; border: 1px solid #999; padding: 6px 8px; margin: 3px 0; cursor: pointer; font: inherit; }
.cs-opt:hover { background: #fff8d6; }
.cs-opt.on { background: #fff3b8; border-color: #14286e; }
.cs-otext { display: flex; flex-direction: column; gap: 2px; }
.cs-glyph { width: 28px; height: 28px; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; background: #5b6b7a; border: 1px solid #333; }
.cs-glyph.wonder { background: #a27b14; }
.cs-pick .dbtns { padding: 8px 12px; text-align: right; }
.cs-oncampus { display: flex; flex-direction: column; min-height: 0; }
.cs-oncampus .list { overflow: auto; min-height: 0; flex: 1; }

/* Consultant Advice */
.advice { position: absolute; right: 60px; bottom: 12px; width: 330px; box-sizing: border-box; z-index: 6; background: #fffbe8; border: 2px solid #14286e; box-shadow: 3px 3px 0 rgba(0,0,0,.35); padding: 8px 10px; font-size: 13px; }
.adv-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: #14286e; }
.adv-head canvas { image-rendering: pixelated; border: 1px solid #14286e; background: #ece7d6; }
.adv-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.adv-btns button { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.adv-btns [data-adv="go"] { flex: 1 1 100%; }
.advice[hidden] { display: none; }

/* diplomacy */
.dip-talk { display: flex; gap: 12px; align-items: flex-start; }
.dip-seal { width: 56px; height: 56px; flex: none; }
.dip-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dotted #999; }
.dip-info { flex: 1; }
.dip-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.dip-status { font-weight: 700; padding: 0 4px; border: 1px solid #555; }
.dip-status.competition { background: #f3c7c7; } .dip-status.peace { background: #cfe9c8; } .dip-status.ceasefire { background: #f6e6b5; } .dip-status.neutral { background: #e4e4e4; }
.warnbtn { color: #8b1e1e; }
#dip-msg .ok { color: #1d6b2a; font-weight: 600; } #dip-msg .warn { font-weight: 600; }

.cs-tabs { display: flex; gap: 2px; padding: 0 !important; }
.cs-tab { font: inherit; color: #cfd6ea; background: transparent; border: 0; padding: 4px 10px; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.cs-tab.on { color: #fff; background: rgba(255,255,255,.18); }
.cs-opt[disabled] { opacity: .55; cursor: not-allowed; }
.cs-glyph.campaign { background: #2f7d32; }

.cs-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-height: 0; }
.cs-mid .panel { min-height: 0; overflow: auto; }
.cs-scroll { display: flex; flex-direction: column; min-height: 0; }
.cs-scroll .list { overflow: auto; min-height: 0; flex: 1; }

/* now-playing note */
#now-playing { position: fixed; left: 14px; bottom: 32px; z-index: 50; pointer-events: none; max-width: 340px; background: rgba(20, 30, 60, .82); color: #f3f0e4; font-size: 12px; padding: 5px 10px 6px; border-left: 3px solid #f2c230; opacity: 0; transition: opacity .8s; }
#now-playing.np-show { opacity: 1; }
#now-playing .np-note { color: #f2c230; }
#now-playing .np-credit { font-size: 11px; opacity: .75; }

.dlg-ico { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: middle; margin-right: 4px; background: #ece7d6; border: 1px solid #999; }
/* Wonder bulletin */
.wonder-bulletin { text-align: center; }
.wonder-bulletin .wonder-art { width: 480px; max-width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; border: 3px solid #2b2b2b; box-shadow: 0 0 0 2px #c9a227; display: block; margin: 0 auto 8px; }
.wonder-bulletin h3 { margin: 6px 0; font-family: Versa, Tahoma, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.note-list { list-style: none; padding: 0; margin: 0; }
.note-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dotted rgba(0,0,0,.15); }
.note-list li .dlg-ico { flex: none; }
/* small pictures: Advancements, Wonders, tiles */
.tech-art { width: 48px; height: 48px; image-rendering: pixelated; float: left; margin: 0 8px 4px 0; border: 1px solid #2b2b2b; }
.tech-art.small { width: 32px; height: 32px; float: none; vertical-align: middle; margin: 0 6px 0 0; }
.tech-art.big { width: 96px; height: 96px; float: none; margin: 0; }
.breakthrough { display: flex; gap: 14px; align-items: flex-start; }
.wonder-thumb { width: 112px; height: 63px; image-rendering: pixelated; border: 2px solid #2b2b2b; box-shadow: 0 0 0 1px #c9a227; display: block; margin-bottom: 4px; }
.wonder-table th { width: 124px; }
.tile-ico { width: 40px; height: 40px; image-rendering: pixelated; vertical-align: middle; }
.tech { display: grid; grid-template-columns: 48px 1fr; column-gap: 8px; align-content: start; }
.tech > .tech-art { grid-row: 1 / span 4; float: none; margin: 0; }
.tech > :not(.tech-art) { grid-column: 2; }
.adv-tip { display: flex; gap: 8px; align-items: center; background: #fffbe8; border: 1px solid #14286e; padding: 6px 8px; margin: 0 0 10px; font-size: 13px; }
.adv-tip .dlg-ico { flex: none; image-rendering: pixelated; border: 1px solid #14286e; background: #ece7d6; }
.cs-bart { width: 32px; height: 32px; image-rendering: pixelated; flex: none; border: 1px solid #2b2b2b; }
.cs-wart { width: 48px; height: 27px; image-rendering: pixelated; flex: none; border: 1px solid #2b2b2b; align-self: center; }
.cs-bart.small { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; }
.cs-wart.small { width: 32px; height: 18px; vertical-align: middle; margin-right: 6px; }
/* beta */
.beta-chip { display: inline-block; margin-left: 8px; padding: 1px 6px; font: bold 10px/1.4 Tahoma, sans-serif; letter-spacing: .08em; color: #14286e; background: #f2c230; border: 1px solid #8a6508; vertical-align: middle; cursor: pointer; }
.ts-beta { margin: 6px 0 10px; padding: 6px 8px; font-size: 12px; background: #fffbe8; border: 1px solid #c9a227; color: #3a3530; }
.fb-form { display: grid; gap: 8px; margin: 8px 0; }
.fb-form label { display: grid; gap: 3px; font-weight: bold; font-size: 13px; }
.fb-form input, .fb-form select, .fb-form textarea { font: 13px Tahoma, sans-serif; padding: 4px 6px; border: 2px inset #ddd; background: #fff; font-weight: normal; }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-form .btn { justify-self: start; }
#fb-ok .btn { margin: 8px 6px 0 0; display: inline-block; text-decoration: none; }
/* Scrollbars stay visible (Civ II / Windows 95 style) so every list that scrolls says so, even on Macs that hide them.
   Chrome, Edge and Safari use these; Firefox gets its own rule below. */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: #dcdcdc; background-image: repeating-conic-gradient(#c8c8c8 0 25%, #e6e6e6 0 50%); background-size: 2px 2px; border-left: 1px solid #a0a0a0; }
::-webkit-scrollbar-thumb { background: #c0c0c0; border: 2px solid; border-color: #fff #555 #555 #fff; min-height: 28px; }
::-webkit-scrollbar-thumb:hover { background: #cfcfcf; }
::-webkit-scrollbar-thumb:active { background: #b0b0b0; }
::-webkit-scrollbar-button:single-button { display: block; height: 16px; width: 16px; background: #c0c0c0 no-repeat center / 8px 8px; border: 2px solid; border-color: #fff #555 #555 #fff; }
::-webkit-scrollbar-button:single-button:vertical:increment { background-image: linear-gradient(to top right, transparent 50%, #222 50%), linear-gradient(to top left, transparent 50%, #222 50%); background-size: 4px 4px, 4px 4px; background-position: 4px 5px, 8px 5px; }
::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: linear-gradient(to bottom right, transparent 50%, #222 50%), linear-gradient(to bottom left, transparent 50%, #222 50%); background-size: 4px 4px, 4px 4px; background-position: 4px 6px, 8px 6px; }
::-webkit-scrollbar-button:single-button:horizontal { display: none; }
::-webkit-scrollbar-corner { background: #c0c0c0; }
@supports (-moz-appearance: none) { * { scrollbar-width: auto; scrollbar-color: #a8a8a8 #e0e0e0; } }
/* lists that can scroll always reserve their bar, so the cue never flickers in and out */
.dialog .dbody, .cs-pick-body, .cs-oncampus .list, .cs-scroll .list, .cs-mid .panel, .panel.grow, .side > .panel.grow { scrollbar-gutter: stable; }
