/* Town of Goats · townofgoats.com. Cream and brown, rounded and friendly; the game's own styles are at the end. */
:root { --bg: #fdf6ea; --ink: #3b2a1a; --muted: #7a6650; --line: #e2cba6; --card: #fffaf2; --accent: #e9a83a; --accent-ink: #3b230c; --green: #3aa35b; --red: #b3402c;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--round); }
a { color: #8a4b12; }
h1, h2, h3 { line-height: 1.2; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 20px; background: linear-gradient(#fffaf1, #f6ead6); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-left: auto; }
.nav a, .linkish { color: var(--ink); text-decoration: none; font-weight: 600; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.nav a:hover, .linkish:hover { text-decoration: underline; }
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
main.wide { max-width: 1600px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
.announce { margin: 0; text-align: center; background: #fff3c4; padding: 6px 12px; border-bottom: 1px solid #e7c27a; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 14px 0; box-shadow: 0 2px 8px rgba(90,55,25,.06); }
.card.narrow { max-width: 460px; margin: 30px auto; }
.hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 20px 0; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); margin: 0; }
.lead { font-size: 18px; max-width: 640px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn, .btn-small { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; color: var(--accent-ink); background: linear-gradient(#f6c260, #d98a2b); border: 1px solid #b8741f;
  border-radius: 999px; padding: 9px 18px; cursor: pointer; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 6px rgba(90,55,25,.18); transition: transform .15s; }
.btn:hover, .btn-small:hover { transform: scale(1.03); }
.btn:active, .btn-small:active { transform: scale(.97); }
.btn-big { font-size: 20px; padding: 12px 26px; }
.btn-small { font-size: 14px; padding: 6px 12px; }
.btn-ghost { background: linear-gradient(#fffdf8, #f3e6d2); border-color: #d8c1a0; color: var(--ink); }
.btn-danger { background: linear-gradient(#f08a78, #c0442f); border-color: #9a2f1e; color: #fff; }
.btn-dg { background: linear-gradient(#fff4d6, #f2c94c); border-color: #c99a2a; }
.btn-dg img { border-radius: 50%; }
.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 8px 0; }
.form { display: grid; gap: 10px; }
.form label, .row label { display: grid; gap: 3px; font-weight: 600; font-size: 14px; }
.form label.check { display: flex; gap: 8px; font-weight: 400; align-items: flex-start; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input:not([type]), select { font: inherit; padding: 8px 10px; border: 1px solid #d8c1a0; border-radius: 10px; background: #fff; color: var(--ink); min-width: 0; }
.flash { padding: 10px 14px; border-radius: 12px; margin: 10px 0; }
.flash-ok { background: #e3f5e4; border: 1px solid #a9d8ad; }
.flash-error { background: #fde3df; border: 1px solid #f0a99c; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
code.secret { user-select: all; word-break: break-all; background: #fff; padding: 2px 6px; border-radius: 6px; }
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid #efe2cf; }
.board li span { grid-row: 1 / 3; font-weight: 800; color: #a0763a; align-self: center; font-size: 18px; }
.board li small { grid-column: 2; color: var(--muted); }
.board li b { grid-row: 1 / 3; grid-column: 3; align-self: center; font-variant-numeric: tabular-nums; font-size: 18px; }
.board li.is-me { background: #fff3c4; border-color: #e7b04b; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 600; }
.tabs a.active { background: #f2c25a; border-color: #c98f2a; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat span { display: block; font-size: 26px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #f1e5d3; text-align: left; vertical-align: top; }
.table tr.is-off { opacity: .55; }
.thumb { width: 48px; height: 48px; border-radius: 8px; image-rendering: pixelated; }
@keyframes fl-panel-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
html.has-fullscreen, html.has-fullscreen body { overflow: hidden; }
.is-fullscreen { position: fixed; inset: 0; z-index: 40; margin: 0; width: 100%; height: 100%; background: var(--bg); overflow: auto; }

/* The game (views/play.php, public/assets/town/town.js) */
.city { --city-round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, sans-serif; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; font-family: var(--city-round); font-size: 14px; }
.city-guest { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: #fff3d6; border: 1px solid #e7c27a; }
.city-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: linear-gradient(#fffaf1, #f3e3cc); border: 1px solid #e2cba6; box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(90,55,25,.12); }
.city-name { font-weight: 800; font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.city-name:hover, .city-name:focus-visible { background: rgba(255,255,255,.7); }
.city-rename { border: 0; background: none; cursor: pointer; font-size: 15px; padding: 2px 4px; margin-left: -4px; border-radius: 8px; color: inherit; opacity: .6; }
.city-rename:hover, .city-rename:focus-visible { opacity: 1; background: rgba(255,255,255,.7); }
.city-stat { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.city-stat small.is-pos { color: #2f8a4c; } .city-stat small.is-neg { color: #b3402c; }
.city-clover { width: 16px; height: 16px; display: inline-block; background: radial-gradient(circle at 30% 30%, #8fe08a 0 25%, transparent 26%), radial-gradient(circle at 70% 30%, #6fcf6a 0 25%, transparent 26%), radial-gradient(circle at 30% 70%, #6fcf6a 0 25%, transparent 26%), radial-gradient(circle at 70% 70%, #4fb34a 0 25%, transparent 26%); border-radius: 50%; }
.city-btn, .city-tool, .city-opt { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d8c1a0; border-radius: 10px; padding: 5px 9px; font: inherit; font-size: 14px; color: #3b2a1a; cursor: pointer;
  background: linear-gradient(#fffdf8, #f3e6d2); box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(90,55,25,.14); transition: transform .15s, box-shadow .15s; min-height: 34px; }
.city-btn:hover:not(:disabled), .city-tool:hover, .city-opt:hover:not(:disabled) { transform: scale(1.04); }
.city-btn:active:not(:disabled), .city-tool:active, .city-opt:active:not(:disabled) { transform: scale(.96); }
.city-btn:disabled, .city-opt:disabled { opacity: .5; cursor: default; }
.city-btn[aria-pressed="true"], .city-tool[aria-pressed="true"], .city-opt.is-on { background: linear-gradient(#ffe9a8, #f2c25a); border-color: #c98f2a; }
.city-speed { display: inline-flex; gap: 3px; }
.city-rci { display: inline-flex; gap: 4px; align-items: flex-end; height: 34px; padding: 2px 6px; border-radius: 8px; background: rgba(255,255,255,.6); }
.city-rci span { display: inline-flex; flex-direction: column; align-items: center; width: 14px; font-size: 10px; font-weight: 800; }
.city-rci i { display: block; width: 10px; height: 20px; transform-origin: bottom; background: #4caf50; border-radius: 2px 2px 0 0; transition: transform .4s; }
.city-rci span[data-k="C"] i { background: #3f7fd9; } .city-rci span[data-k="I"] i { background: #e0aa2a; } .city-rci span[data-k="F"] i { background: #a8803f; }
.city-rci i.is-neg { background: repeating-linear-gradient(45deg, #c0392b 0 3px, #e8786a 3px 6px); }
.city-happy { font-size: 20px; }
.city-spacer { flex: 1; }
.city-save { position: relative; }
.city-dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #e0533a; }
.city-dot[hidden] { display: none; }
.city-savebar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.15); overflow: hidden; }   /* 1.00.50 */
.city-savebar[hidden] { display: none; }
.city-savebar b { display: block; height: 100%; width: 0; background: #4caf50; transition: width .2s; }
.city-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; min-height: 0; height: max(480px, calc(100vh - 240px)); }
.city-tools { display: grid; grid-template-columns: repeat(2, 68px); grid-auto-rows: min-content; align-content: start; gap: 4px; overflow-y: auto; padding-right: 2px; }   /* 1.00.58: two buttons a row, so no scroll bar */
.city-tools .city-tool-head { position: relative; }
.city-tree-arrow { position: absolute; top: 3px; left: 5px; font-size: 10px; line-height: 1; transition: transform .15s; }
.city-tool-head[aria-expanded="true"] .city-tree-arrow { transform: rotate(90deg); }
.city-tool-group { grid-column: 1 / -1; display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-left: 6px; padding-left: 6px; border-left: 2px solid #d8c1a0; }
.city-tool-group.is-open { display: grid; }
.city-tool-group .city-tool { width: auto; }
.city-tool { flex-direction: column; gap: 1px; width: 68px; padding: 5px 3px; font-size: 11px; line-height: 1.1; text-align: center; }
.city-tool svg { width: 20px; height: 20px; }
.city-view { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid #c9b08a; box-shadow: 0 10px 26px rgba(60,40,20,.2); background: #5d8a4a; touch-action: none; }
.city-canvas { display: block; outline: none; }
.city-canvas:focus-visible { box-shadow: inset 0 0 0 3px #ffd34a; }
.city-options { position: absolute; left: 8px; top: 8px; right: 140px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; pointer-events: none; }
.city-options > * { pointer-events: auto; }
.city-opt { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.city-opt small { opacity: .75; font-size: 11px; }
.city-opt-label, .city-opt-note { background: rgba(255,250,240,.85); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.city-tip { position: absolute; left: 0; top: 0; pointer-events: none; background: rgba(30,40,30,.82); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.city-tip.is-bad { background: rgba(160,40,30,.9); }
.city-tip[hidden] { display: none; }
/* 1.00.80: the underground view's label */
.city-under { position: absolute; left: 10px; bottom: 10px; pointer-events: none; background: rgba(59,44,31,.92); color: #ffd08a; border: 1px solid #ffa64d; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.city-under[hidden] { display: none; }
.city-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0; transition: .3s; max-width: min(90%, 560px); background: rgba(255,250,240,.95); border: 1px solid #d8c1a0; border-radius: 12px; padding: 8px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); pointer-events: none; }
.city-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.city-touch { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); display: flex; gap: 8px; }
.city-touch[hidden] { display: none; }
.city-mini { position: absolute; right: 8px; top: 8px; width: 120px; height: 120px; border-radius: 10px; border: 2px solid rgba(255,250,240,.9); box-shadow: 0 4px 12px rgba(0,0,0,.25); image-rendering: pixelated; cursor: pointer; background: #5d8a4a; }
.city-mini-cam { position: absolute; left: 0; top: 0; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; box-sizing: border-box; }
.city-panel { width: 300px; overflow-y: auto; padding: 12px; border-radius: 14px; background: #fffaf2; border: 1px solid #e2cba6; position: relative; }
.city-panel[hidden] { display: none; }
.city-panel h3 { margin: 0 0 8px; font-size: 17px; }
.city-close { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: inherit; }
.city-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-variant-numeric: tabular-nums; }
.city-table th { text-align: left; font-weight: 600; padding: 3px 4px; color: #6b5640; }
.city-table td { padding: 3px 4px; text-align: right; }
.city-table td[colspan] { text-align: left; }
.city-tax { display: grid; grid-template-columns: 90px 1fr 40px; gap: 6px; align-items: center; margin: 4px 0; }
.city-chart { width: 100%; height: 90px; background: #fff; border-radius: 8px; border: 1px solid #eadbc4; }
a.city-btn { text-decoration: none; }   /* 1.00.62: the Ideas link looks like the other buttons */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* 1.00.62: the suggestion form's robot trap */
.sugg-mine li { margin: 0 0 8px; }
.city-layers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }   /* 1.00.59: two columns, so the list fits without a scroll bar */
.city-layers label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-legend summary { cursor: pointer; }
.city-board { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.city-board li { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; column-gap: 6px; padding: 5px 8px; border-radius: 8px; background: #fff; border: 1px solid #efe2cf; }
.city-board li span { grid-row: 1 / 3; font-weight: 800; color: #a0763a; align-self: center; }
.city-board li small { grid-column: 2; color: #7a6650; }
.city-board li b { grid-row: 1 / 3; grid-column: 3; align-self: center; font-variant-numeric: tabular-nums; }
.city-board li.is-me { background: #fff3c4; border-color: #e7b04b; }
.city-slots { display: grid; gap: 8px; margin: 10px 0; }
.city-slot { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; padding: 8px; border-radius: 10px; background: #fff; border: 1px solid #efe2cf; }
.city-slot.is-current { border-color: #e7b04b; }
.city-slot img, .city-slot-empty { width: 56px; height: 56px; border-radius: 8px; background: #e8efe0; object-fit: cover; image-rendering: pixelated; }
.city-slot-btns { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.city-import { cursor: pointer; }
.city-steps { padding-left: 18px; display: grid; gap: 6px; }
.city-start { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(80,110,60,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 3; overflow: auto; padding: 10px; }
.city-start[hidden] { display: none; }
.city-start-card { width: min(440px, 100%); background: rgba(255,250,242,.96); border-radius: 16px; padding: 18px; box-shadow: 0 16px 40px rgba(40,30,10,.3); display: grid; gap: 8px; animation: fl-panel-in .3s cubic-bezier(.34,1.56,.64,1); }
.city-start-card h2 { margin: 0; }
.city-start-card label { display: grid; gap: 3px; font-weight: 600; }
.city-start-card .city-check { display: flex; gap: 6px; font-weight: 400; font-size: 13px; }
.city-start-card input[type="text"], .city-start-card input[type="number"], .city-start-card select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid #d8c1a0; }
.city-seed { display: flex; gap: 6px; }
.city-seed input { flex: 1; min-width: 0; }
.is-fullscreen.city { padding: 8px; }
.is-fullscreen.city .city-main { height: auto; }
@media (max-width: 800px) {
  .city-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(360px, 1fr) auto; height: auto; }
  .city-tools { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .city-tool-head { display: none; }
  .city-tool-group, .city-tool-group.is-open { display: contents; }
  .city-tool { width: 60px; min-height: 48px; flex: none; }
  .city-view { height: 62vh; }
  .city-panel { width: auto; }
  .city-main.is-files { grid-template-rows: auto auto auto; }   /* 1.00.81: Towns opens above the map */
  .city-panel.is-top { order: -1; }
  .city-mini { width: 84px; height: 84px; }
  .city-options { right: 98px; }
}
@media (prefers-reduced-motion: reduce) { .city-tree-arrow, .city-toast, .city-btn, .city-tool, .city-opt, .city-start-card { transition: none; animation: none; } }

/* Admin tools (Patches, Backups, Prompt kit, Email) */
.admin-ver { margin-left: auto; align-self: center; color: var(--muted); font-size: 13px; }
.backup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 14px; }
.kit { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.kit-files { display: grid; gap: 2px; font-size: 14px; }
.kit-files a { padding: 4px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.kit-files a.active { background: #f2c25a; }
.kit-body textarea { width: 100%; min-height: 60vh; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.smtp-log, .patch-notes { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 360px; overflow: auto; }
fieldset.card { margin: 4px 0; }
@media (max-width: 760px) { .kit { grid-template-columns: 1fr; } }
.form > button, .form > .btn-small { justify-self: start; }
/* 1.00.02 Admin → Email: filter and pages for Sent mail */
.mail-filter a, .mail-filter strong { margin-right: 6px; }
.pager { align-items: center; gap: 14px; }
/* 1.00.03 Admin → Patches: the Apply column */
.patch-act { white-space: nowrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); }
.pill-ok { background: #e8f4e2; color: #2f6b22; border-color: #b9dcaa; }
.pill-off { background: #f3eee6; color: #7a6a58; }
/* 1.00.04 editable footer */
.foot a { color: inherit; }
.foot-preview { display: inline-block; padding: 4px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.form textarea { font: inherit; padding: 8px 10px; border: 1px solid #d8c1a0; border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; }
/* 1.00.05 Admin → Building looks */
.looks-ctl { flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.looks-ctl [aria-pressed="true"] { background: var(--brown, #6b4a2b); color: #fff; }
.looks-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.look-card { margin: 0; text-align: center; max-width: 220px; }
.look-pic { display: inline-block; padding: 8px; border-radius: 10px; background: #9ccc78; line-height: 0; }
.look-pic.is-night { background: #2d3b2a; }
.look-card figcaption { font-size: 13px; margin-top: 4px; line-height: 1.35; }
.look-card code { word-break: break-all; }
/* 1.00.09 game Settings panel */
.city-set { display: grid; gap: 8px; border: 1px solid var(--line, #e2cfae); border-radius: 10px; padding: 8px 10px 10px; margin: 0 0 12px; }
.city-set legend { padding: 0 4px; }
.city-set label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.35; }
.city-set input { margin-top: 3px; flex: none; }
/* 1.00.11 the Almanac */
.city-alm { border-top: 1px solid var(--line, #e2cfae); padding: 6px 0; }
.city-alm summary { cursor: pointer; padding: 4px 0; }
.city-alm-lv { margin: 10px 0 4px; }
.city-alm-card { display: inline-flex; flex-direction: column; align-items: center; width: 31%; margin: 0 1% 8px; vertical-align: top; text-align: center; font-size: 12px; line-height: 1.25; }
.city-alm-pic { min-height: 52px; display: flex; align-items: flex-end; justify-content: center; padding: 4px; border-radius: 8px; background: #9ccc78; width: 100%; box-sizing: border-box; }
.city-alm-card.is-missing .city-alm-pic { background: #e8dcc6; }
.city-alm-card canvas { max-width: 100%; height: auto; }
.city-alm-bar { display: inline-block; vertical-align: middle; width: 120px; height: 8px; border-radius: 4px; background: #eadfcb; overflow: hidden; margin-left: 6px; }
.city-alm-bar i { display: block; height: 100%; background: #e0a93a; }
.sale-tag { color: #b4451f; font-weight: 700; }
.mail-text { white-space: pre-wrap; word-break: break-word; font: 14px/1.5 system-ui, sans-serif; background: #fffdf8; border: 1px solid #eadfca; border-radius: 10px; padding: 14px; max-height: 70vh; overflow: auto; }
.badges { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; border: 1px solid #eadfca; background: #fffdf8; opacity: .6; }
.badge.is-got { opacity: 1; background: #fff6dc; border-color: #e8c46a; }
.badge-icon { font-size: 26px; line-height: 1; }
/* 1.00.30: Admin → Permissions */
.perm-grid td:nth-child(3), .perm-grid td:nth-child(4), .perm-grid th:nth-child(3), .perm-grid th:nth-child(4) { text-align: center; width: 70px; }
.perm-grid input[type=checkbox] { width: 20px; height: 20px; }
.perm-risk { color: #a3361f; }
.perm-grid .pill { white-space: nowrap; }
/* 1.00.31: Admin → Game settings */
.game-set input { width: 9em; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.game-set tr.is-changed td { background: #fff6dc; }
.game-set input.game-text { width: 100%; min-width: 16em; }   /* 1.00.43: advisor names and tips */
/* 1.00.36: the Budget statement and loans */
.city-h4 { margin: 14px 0 4px; font-size: 15px; }
.city-verdict { padding: 8px 10px; border-radius: 10px; margin: 6px 0 4px; border: 1px solid; font-size: 14px; }
.city-verdict.is-good { background: #e9f6ec; border-color: #9fd3ab; color: #1f5f33; }
.city-verdict.is-bad { background: #fbeae6; border-color: #e6a99c; color: #7a2717; }
.city-bud { font-size: 13px; }
.city-bud td { width: 74px; }
.city-bud-head td { font-size: 11px; color: var(--muted); font-weight: 600; }
.city-bud-sec th { padding-top: 8px; color: var(--ink); border-bottom: 1px solid #eadbc4; }
.city-bud th { font-weight: 500; }
.city-bud-total th, .city-bud-total td { font-weight: 700; border-top: 1px solid #eadbc4; }
.city-bud-net th, .city-bud-net td { font-weight: 800; border-top: 2px solid #d9c3a0; padding-top: 5px; }
.city-bud-net.is-good td { color: #1f7a3c; }
.city-bud-net.is-bad td { color: #a3321f; }
.city-credit { margin: 4px 0 6px; line-height: 1.5; }
.city-rating { display: inline-block; min-width: 38px; text-align: center; font-weight: 800; padding: 1px 6px; border-radius: 6px; color: #fff; background: #3aa35b; margin-right: 4px; }
.city-rating.is-A, .city-rating.is-BBB { background: #7aa33a; }
.city-rating.is-BB, .city-rating.is-B { background: #d9902a; }
.city-rating.is-CCC, .city-rating.is-CC, .city-rating.is-C { background: #b3402c; }
.city-loans { font-size: 12px; }
.city-loans th { font-size: 11px; color: var(--muted); }
.city-borrow { display: grid; gap: 4px; margin: 6px 0; }
.city-borrow label { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.city-borrow input, .city-borrow select { width: 150px; }
/* 1.00.37: Town statistics */
.city-stuck { list-style: none; padding: 0; margin: 6px 0; }
.city-stuck li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: #fbeee2; border-left: 4px solid #d9902a; font-size: 13px; }
.city-stuck li.is-calm { background: #f4efe6; border-left-color: #c9bba3; }
.city-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 10px; background: #3b2a1a; color: #fff; font-size: 11px; text-align: center; }
.city-tipline { background: #fff4d6; border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.city-meter { display: block; width: 100%; height: 8px; border-radius: 4px; background: #eadfcb; overflow: hidden; }
.city-meter i { display: block; height: 100%; background: #3aa35b; }
.city-meter.is-low i { background: #d9902a; }
.city-cover td:nth-child(2) { width: 50%; }
.city-cover td:last-child { width: 42px; }
.city-table .is-bad { color: #a3321f; }
.city-table .is-good { color: #1f7a3c; }
.city-chart + .city-chart { margin-top: 6px; }
/* 1.00.39: planning: map buttons, power grids and water networks */
.city-maps { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.city-maps .btn-small { padding: 4px 10px; }
.city-grids th, .city-grids td { vertical-align: top; }
.city-grids td:nth-child(2), .city-grids td:nth-child(3) { text-align: right; white-space: nowrap; }
.city-grids td .small { display: inline-block; margin-top: 2px; }
p.is-bad { color: #a3321f; }
.city-table td.is-bad, .city-table span.is-bad { color: #a3321f; }
.city-grids td:first-child, .city-grids th:first-child { text-align: left; }

/* 1.00.44: difficulty on the leaderboard: tabs and a badge on each town (the level's name, so it isn't colour alone) */
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.board-tabs a { padding: 4px 12px; border-radius: 999px; border: 1px solid #e3d2b8; background: #fff; color: inherit; text-decoration: none; font-size: 14px; }
.board-tabs a[aria-current="page"] { background: #6b4a2b; border-color: #6b4a2b; color: #fff; font-weight: 700; }
.diff-badge { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 999px; vertical-align: 1px; border: 1px solid transparent; white-space: nowrap; }
.diff-tooEasy { background: #e6f6e6; color: #2f6b2f; border-color: #bfe3bf; }
.diff-veryEasy { background: #eaf6dc; color: #3d6a1f; border-color: #cbe5ad; }
.diff-easy { background: #f3f6d6; color: #5a6418; border-color: #dfe5a5; }
.diff-medium { background: #f4eee4; color: #6b5a44; border-color: #e2d6c3; }
.diff-hard { background: #fdecd8; color: #8a4b12; border-color: #f2c99a; }
.diff-veryHard { background: #fbe0d6; color: #8f2f12; border-color: #efb19a; }
.diff-goat { background: #2b1d12; color: #ffd76a; border-color: #2b1d12; }
.city-board-tab { margin: 0 0 8px; }

/* 1.00.45: chart ranges (1 / 5 / 20 years) */
.city-range { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 6px; }
.city-range .btn-small { padding: 2px 8px; }
.city-range [data-c-range-note] { margin-left: 4px; }

/* 1.00.48: the building card (what a building does, before you build it) */
.city-bcard { position: absolute; left: 10px; bottom: 10px; z-index: 4; width: min(330px, calc(100% - 20px)); max-height: 60%; overflow: auto; background: rgba(255,250,240,.97); border: 1px solid #d8c1a0; border-radius: 12px; padding: 8px 12px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 13px; }
.city-bcard h4 { margin: 0 24px 4px 0; font-size: 15px; }
.city-bcard .city-table th { white-space: nowrap; padding-right: 8px; vertical-align: top; font-weight: 600; color: #6b5a44; }
.city-bcard .city-table td { line-height: 1.35; }
.city-bcard .city-close { position: absolute; right: 6px; top: 4px; }
.city-bcard .is-good { color: #2f7d3f; }
.city-bcard .is-bad { color: #b3402c; }
.city-bcard .city-table td { text-align: left; }
.city-opt.is-locked { opacity: .6; }
.city-opt.is-locked.is-on { opacity: 1; outline: 2px dashed #b3402c; }

/* 1.00.49: Admin → Server */
.server-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; }
.server-split ul { margin: 4px 0 0; padding-left: 18px; }
.server-day { white-space: nowrap; margin-right: 8px; }
meter { width: 80px; vertical-align: middle; }

/* 1.00.50: Admin → Server, server time per save (an SVG: the site's CSP allows no inline styles) */
.server-trend { display: block; width: 100%; max-width: 640px; height: auto; margin: 8px 0 12px; }
.server-trend-axis { stroke: #d9cdb8; stroke-width: 1; }
.server-trend-bar { fill: #4caf50; }
.server-trend-p95 { fill: #c0392b; }
.server-trend-day { font-size: 10px; fill: #7a6a55; }

/* 1.00.50: progress bars (Admin → Patches) */
.progress { position: relative; margin: 10px 0; padding-top: 12px; }
.progress[hidden] { display: none; }
.progress b { position: absolute; top: 0; left: 0; height: 8px; width: 0; border-radius: 4px; background: #4caf50; transition: width .25s; }
.progress::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; border-radius: 4px; background: rgba(0,0,0,.1); }
.progress.is-busy b { width: 30% !important; animation: progress-busy 1.1s ease-in-out infinite alternate; }
.progress.is-stopped b { background: #e0aa2a; }
@keyframes progress-busy { from { left: 0; } to { left: 70%; } }
@media (prefers-reduced-motion: reduce) { .progress.is-busy b { animation: none; width: 100% !important; opacity: .5; } }

/* 1.00.65: town ranks: the chip on the top bar, the plaque (and the small one between ranks), the ladder, confetti */
.city-rank { display: inline-flex; flex-direction: column; gap: 2px; border: 1px solid #d8c1a0; background: #fffaf2; border-radius: 10px; padding: 3px 8px; font: inherit; font-size: 13px; font-weight: 600; color: inherit; cursor: pointer; white-space: nowrap; }
.city-rank:hover { background: #fff3dc; }
.city-rank b { display: block; height: 4px; border-radius: 2px; background: #eadbc2; overflow: hidden; }
.city-rank b i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c9952c, #f2c25a); }
.city-plaque { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(60,40,20,.28); z-index: 30; padding: 16px; }
.city-plaque[hidden] { display: none; }
.city-plaque-card { position: relative; width: min(420px, 100%); max-height: 100%; overflow-y: auto; text-align: center; background: linear-gradient(#fffaf0, #f6e8cf); border: 3px double #a87b3c; outline: 2px solid #e8cf98; outline-offset: -9px; border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 14px 40px rgba(0,0,0,.35); animation: city-plaque-in .35s ease-out; }
@keyframes city-plaque-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.city-plaque-ribbon { display: inline-block; margin-bottom: 6px; padding: 3px 14px; border-radius: 999px; background: #8b5a2b; color: #fff6e3; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.city-plaque-icon { font-size: 54px; line-height: 1.1; }
.city-plaque h2 { margin: 2px 0 0; font-size: 28px; color: #5a3a17; }
.city-plaque-sub { margin: 2px 0 10px; color: #7a5a35; }
.city-plaque h4 { margin: 10px 0 4px; font-size: 14px; color: #5a3a17; }
.city-plaque-list { list-style: none; margin: 0 auto; padding: 0; text-align: left; display: grid; gap: 4px; max-width: 340px; }
.city-plaque-list li { background: rgba(255,255,255,.7); border: 1px solid #e6d2ae; border-radius: 8px; padding: 4px 8px; }
.city-plaque-list small { color: #8a6a45; }
.city-plaque-next { margin: 12px 0 4px; font-size: 14px; color: #5a3a17; }
.city-plaque-btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.city-plaque.is-small { inset: 12px auto auto 50%; transform: translateX(-50%); background: none; padding: 0; display: block; width: min(380px, 92%); }
.city-plaque.is-small .city-plaque-card { padding: 12px 14px 10px; text-align: left; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.city-plaque-small-h { margin: 0 24px 6px 0; font-weight: 700; color: #5a3a17; }
.city-plaque.is-small .city-plaque-list { max-width: none; }
.city-ladder { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; display: grid; gap: 4px; max-height: 46vh; overflow-y: auto; }
.city-ladder li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; border-radius: 8px; border: 1px solid #eadbc2; background: rgba(255,255,255,.55); color: #6d5a43; }
.city-ladder li.is-done { background: #f3ead4; }
.city-ladder li.is-now { background: #fbe3a0; border-color: #c9952c; color: #3f2a10; }
.city-ladder-ico { font-size: 20px; width: 26px; text-align: center; }
.city-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 31; }
@media (prefers-reduced-motion: reduce) { .city-plaque-card { animation: none; } }

/* 1.00.70: the Golden GOAT Monument's face picker (options bar and Inspect) */
.city-faces { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.city-face { border: 1px solid #d8c1a0; background: #fffaf2; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; color: inherit; }
.city-face.is-on { background: #f2c25a; border-color: #b8862a; font-weight: 700; }
.city-opt-faces { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 1.00.73: the forecast on the top bar (with a Weather Station) */
.city-wx { display: inline-flex; gap: 2px; align-items: center; padding: 2px 6px; border: 1px solid #d8c1a0; border-radius: 10px; background: #fffaf2; font-size: 13px; line-height: 1; }
.city-wx[hidden] { display: none; }
.city-wx span { opacity: .75; }
.city-wx span.is-now { opacity: 1; font-size: 16px; margin-right: 2px; }

/* 1.00.77: mystery badges (Admin → Rewards) */
.badge.is-mystery { opacity: .8; }
.city-alm-pic.is-mystery { display: flex; align-items: center; justify-content: center; font-size: 24px; }
/* 1.00.81: weekly challenges */
.challenge-strip { margin: 0 0 10px; }
.challenge-strip a { display: inline-block; padding: 6px 12px; border-radius: 10px; background: #fff4d6; border: 1px solid #f2c25a; color: inherit; text-decoration: none; }
ul.plain { list-style: none; padding: 0; margin: 4px 0 12px; }
ul.plain li { margin: 2px 0; }
.city-challenge { background: #fff4d6; border: 1px solid #f2c25a; border-radius: 10px; padding: 6px 8px; margin: 0 0 8px; font-size: 13px; }
.city-challenge ol { margin: 4px 0 0; padding-left: 18px; }
/* 1.00.85: achievements with progress bars */
progress.ach-bar { width: 120px; height: 10px; vertical-align: middle; accent-color: #3aa35b; }
.ach-row { display: block; margin-top: 4px; }
.city-ach { list-style: none; padding: 0; margin: 6px 0; }
.city-ach li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #efe2cc; }
.city-ach li.is-done strong { color: #2f7a3f; }
.city-ach-icon { font-size: 20px; width: 26px; text-align: center; }
/* 1.00.88: the Replay panel (the timelapse) */
.city-replay { background: #1c2026; border-radius: 6px; padding: 4px; margin: 8px 0 4px; }
.city-replay canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 3px; }
.city-rp-cap { margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.city-rp-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.city-rp-ctl input[type="range"] { flex: 1 1 140px; min-width: 120px; }
.city-rp-dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* 1.00.94: player loans */
.city-lendpop { z-index: 6; }
.city-lendcard { width: min(460px, 100%); max-height: calc(100% - 20px); overflow: auto; }
.city-lendcard h3 { margin: 0; }
.city-lend-grade { font-size: 1.05em; margin: 0; }
.city-lend-why { margin: 0; padding-left: 18px; }
.city-p2p-box { background: rgba(255,255,255,.55); border-radius: 10px; padding: 8px; margin: 6px 0; }
.city-p2p-box details label { display: block; margin: 4px 0; }
.city-p2p-box input[type=number] { width: 90px; }
.acct-lend td, .acct-lend th { padding: 2px 8px 2px 0; text-align: left; }
.city-board li:has(.city-board-lend) { grid-template-columns: 26px 1fr auto auto; }
.city-board-lend { grid-row: 1 / 3; grid-column: 4; align-self: center; border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 2px; }

/* 1.00.99: ⓘ bubbles in the Loans panel (one open at a time; town.js keeps it open when a section repaints) */
.city-info { display: inline; font-weight: 400; font-style: normal; }
.city-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; padding: 0; margin: 0 1px; vertical-align: -3px; border: 0; border-radius: 50%; background: #e9dcc4; color: #6b4a2b; font: italic 700 12px/1 Georgia, serif; cursor: pointer; }
.city-info-btn:hover, .city-info.is-open .city-info-btn { background: #d98a2b; color: #fff; }
.city-info-btn:focus-visible { outline: 2px solid #d98a2b; outline-offset: 2px; }
.city-info-pop { display: none; position: absolute; left: 10px; right: 10px; z-index: 5; margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: #3b2a1a; color: #fff8ec; font-size: 13px; line-height: 1.45; font-weight: 400; text-align: left; box-shadow: 0 6px 18px rgba(40,25,10,.28); }
.city-info.is-open .city-info-pop { display: block; }
.city-info-pop strong { color: #ffd98a; }

/* 1.01.00: the Loan market, a big window over the map (Minimize goes back to the Loans column) */
.city-market { position: absolute; inset: 0; z-index: 5; display: grid; place-items: stretch center; padding: 10px; background: rgba(60,45,25,.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.city-market[hidden] { display: none; }
.city-mk-card { width: min(1040px, 100%); max-height: 100%; overflow: auto; background: #fffaf2; border-radius: 16px; padding: 14px 18px 18px; box-shadow: 0 16px 40px rgba(40,30,10,.3); position: relative; animation: fl-panel-in .25s ease-out; }
.city-mk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.city-mk-head h2 { margin: 0; font-size: 22px; }
.city-mk-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 8px; border-bottom: 2px solid #ead8bb; }
.city-mk-tabs button { font: inherit; font-weight: 600; padding: 7px 12px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: #6b5640; cursor: pointer; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.city-mk-tabs button[aria-selected="true"] { color: #3b2a1a; background: #f6e7cc; border-bottom-color: #d98a2b; }
.city-mk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.city-mk-tools:empty { display: none; }
.city-mk-tools select, .city-mk-tools input { font: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid #d8c1a0; background: #fff; }
.city-mk-search input { width: min(260px, 60vw); }
.city-mk-table th { position: sticky; top: 0; background: #fffaf2; }
.city-mk-table td { text-align: left; vertical-align: middle; border-top: 1px solid #f0e3cc; padding: 6px 6px; }
.city-mk-table tr.is-picked td { background: #fdf0d8; }
.city-mk-note { background: #fdf0d8; border-radius: 8px; padding: 6px 10px; }
.city-mk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9bba5; margin-right: 6px; vertical-align: 1px; }
.city-mk-dot.is-on { background: #3aa35b; box-shadow: 0 0 0 3px rgba(58,163,91,.2); }
.city-mk-ask { border: 2px solid #e9c98f; }
.city-mk-ask .city-borrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.city-mk-ask input[type=number] { width: 110px; }
.city-mk-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: start; }
.city-mk-how .city-steps li { margin: 6px 0; line-height: 1.5; }
.city-mk-open { margin-right: 4px; }
@media (max-width: 800px) { .city-mk-cols { grid-template-columns: 1fr; } .city-mk-card { padding: 12px; } .city-market { padding: 4px; } }
.btn:disabled, .btn-small:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); box-shadow: none; }   /* 1.01.00: a button you can't use right now looks it */

/* 1.01.02: Gold Clovers (the menu link, /gold, Admin → Pay features) */
.nav-gold { font-weight: 700; color: #a8791a; }
.nav-gold-n { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 2px; border-radius: 9px; background: #f4d47c; color: #5a3e08; font-size: 12px; text-align: center; }
.gold-top { background: linear-gradient(135deg, #fff6d8, #fdebb5); }
.gold-bal { font-size: 22px; margin: 0 0 6px; }
.gold-bal strong { font-size: 30px; color: #8a5f0a; }
.gold-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0; }
.gold-pack { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 16px 12px; border-radius: 14px; background: #fffaf0; border: 2px solid #f0d58f; }
.gold-pack-icon { font-size: 30px; }
.gold-pack-name { font-size: 18px; }
.gold-pack-gc { font-size: 26px; font-weight: 800; color: #8a5f0a; }
.gold-pack-gc small { font-size: 13px; font-weight: 600; }
.gold-price { font-weight: 700; color: #8a5f0a; white-space: nowrap; }
.in-num { width: 90px; } .in-num-s { width: 70px; }
.city-slot-gold { border-style: dashed; }
/* 1.01.03: the Gold Clover icon (gold, never green like the Clover towns earn) */
.gc-ic { width: 1.15em; height: 1.15em; vertical-align: -0.22em; display: inline-block; }
.gc-ic-lg { width: 1.3em; height: 1.3em; }
.city-slot-plus { display: grid; place-items: center; } .city-slot-plus .gc-ic { width: 30px; height: 30px; }
.city-bname { font-size: 1.12em; font-weight: 700; color: #5a3a17; }   /* 1.00.89: a building's name in Inspect */
.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.names-list textarea { width: 100%; }
