/* The post: HUD across the top, booth window beside the inspection desk, log underneath. */
.game { max-width: 1280px; margin: 0 auto; padding: 0 16px 24px; }

.hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.hud-logo { font: 700 1.5rem var(--font-head); letter-spacing: .08em; }
.hud-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; }
.hud-stats div { display: flex; flex-direction: column; }
.hud-stats dt { color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.hud-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.hud-money { color: var(--ochre); }

.post { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; margin-top: 16px; }

/* booth */
.booth { display: flex; flex-direction: column; gap: 12px; }
.booth-window {
  position: relative; aspect-ratio: 4 / 3.4; overflow: hidden; border-radius: var(--radius);
  border: 10px solid #34352d; box-shadow: inset 0 0 0 2px #0006, 0 8px 24px #0008;
  background: linear-gradient(#6e7a80, #b7b1a0 70%);
}
.backdrop { position: absolute; inset: 0; width: 100%; height: 100%; }
.bd-mount { fill: #59646a; } .bd-hill { fill: #4a5248; } .bd-road { fill: #3a3a34; }
.bd-gate { fill: none; stroke: #c8b070; stroke-width: 5; stroke-dasharray: 14 8; }
.visitor { position: absolute; left: 50%; bottom: 0; width: 72%; transform: translateX(-50%); transition: transform .5s ease, opacity .5s ease; }
.visitor .portrait { display: block; width: 100%; height: auto; }
.visitor.arriving { animation: approach .6s ease-out; }
.visitor.leaving { transform: translateX(-50%) translateY(6%); opacity: .55; }
@keyframes approach { from { transform: translateX(-130%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.booth-empty { position: absolute; inset: auto 0 40%; text-align: center; margin: 0; color: #f2ecd9; font-weight: 600; text-shadow: 0 1px 3px #000; }

.speech { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: .7rem .9rem; position: relative; }
.speech::before { content: ''; position: absolute; top: -8px; left: 28px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--paper); }
.speech p { margin: 0; }
.speaker { font: 600 .72rem var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: #6a5f48; }
.booth-call { width: 100%; }

/* desk */
.desk {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 1fr auto auto; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: repeating-linear-gradient(92deg, #3d3226 0 18px, #382e23 18px 37px), #3a2f24;
  box-shadow: inset 0 0 60px #0009, 0 8px 24px #0008;
}
.rulebook { background: #d9ccaa; color: var(--ink); border-radius: 3px; box-shadow: 0 3px 8px #0007; align-self: start;
  display: flex; flex-direction: column; max-height: 640px; overflow: hidden; border-left: 8px solid #6b2626; }
.rulebook-head { padding: .6rem .8rem .3rem; }
.rulebook-head h2 { font-size: 1.2rem; color: #6b2626; }
.rulebook-head .doc-issuer { margin: 0; color: #5a5040; }
.rulebook-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #0003; padding: 0 .5rem; }
.rulebook-tabs button { flex: 1 1 40%; padding: .45rem .2rem; border: 0; background: none; font: 600 .72rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: #5a5040; cursor: pointer; border-bottom: 3px solid transparent; }
.rulebook-tabs button[aria-selected="true"] { color: #6b2626; border-bottom-color: #6b2626; }
.rulebook-page { overflow-y: auto; padding: .7rem .8rem .9rem; font-size: .84rem; }
.rulebook-page h3 { font-size: .95rem; color: var(--red); letter-spacing: .04em; }
.rule-list { margin: 0; padding-left: 1.3rem; }
.rule-list li + li { margin-top: .45rem; }
.rule-note { display: block; margin-top: .2rem; font-size: .76rem; color: #5a4a2a; font-style: italic; }
.bulletin-date { margin: .1rem 0 .5rem; font: .75rem var(--font-doc); color: #5a5040; }
.rulebook-page ul { margin: 0; padding-left: 1.1rem; }
.rulebook-page ul li + li { margin-top: .35rem; }
.nation { display: grid; grid-template-columns: 40px 1fr; gap: .5rem; align-items: start; padding: .45rem 0; border-bottom: 1px dashed #0002; }
.nation h3 { font-size: .9rem; color: var(--ink); }
.nation p { margin: .1rem 0 0; font-size: .74rem; }
.nation-seal { display: inline-grid; padding: 2px; border-radius: 4px; }
.nation-seal .emblem { width: 34px; height: 34px; }
.nation-format { font-family: var(--font-doc); color: #5a5040; }
.nation-cities { border-radius: 2px; padding: 1px 2px; }
.doc-stamp-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.desk-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.desk-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.small { min-height: 36px; padding: .35rem .8rem; font-size: .82rem; }
.btn[aria-pressed="true"] { background: #4a3f20; border-color: var(--ochre); color: #f3e2b0; }
.date-plate { margin-left: auto; padding: .3rem .7rem; border-radius: 3px; font: .75rem var(--font-doc); letter-spacing: .08em; text-transform: uppercase;
  color: #2a2010; background: linear-gradient(#d9b866, #b8963f); box-shadow: inset 0 1px 0 #fff6, 0 2px 4px #0008; }
.date-plate b { letter-spacing: .12em; }
.desk-hint { margin: 0; font-size: .8rem; color: #d8c9a6; min-height: 1.2em; }
.compare-result { margin: 0; min-height: 0; font-size: .88rem; }
.compare-result:not(:empty) { padding: .5rem .7rem; border-radius: 3px; background: #efe6cc; color: var(--ink); border-left: 5px solid #8a7a50; }
.compare-result[data-status="match"] { border-left-color: var(--green); }
.compare-result[data-status="mismatch"] { border-left-color: var(--red); background: #f3d9cf; }
.compare-result[data-status="info"], .compare-result[data-status="unrelated"] { border-left-color: #4a6a8a; }

.tray { position: relative; min-height: 260px; }
.tray > .doc { position: absolute; max-width: calc(100% - 16px); cursor: grab; touch-action: pan-y; transition: box-shadow .15s; }
.tray > .doc .doc-head { touch-action: none; }
.tray > .doc.dragging { cursor: grabbing; box-shadow: 0 14px 30px #000b; }
.tray > .doc.selected { outline: 3px solid var(--ochre); outline-offset: 2px; }
.tray > .doc:focus-visible { outline: 3px solid #f3d27a; }
.tray-empty { position: absolute; inset: 40% 0 auto; text-align: center; margin: 0; color: #cdbf9e99; font-style: italic; }

/* compare mode: every comparable item becomes a target */
.cmp-field { cursor: pointer; outline: 1px dashed #8a6a2a88; outline-offset: 1px; }
.cmp-field:hover, .cmp-field:focus-visible { outline: 2px solid #b8862a; background: #f6dc8a55; }
.cmp-picked { outline: 2px solid #b8862a; background: #f6dc8a99 !important; }
.cmp-match { outline: 2px solid var(--green); background: #9fd0a066 !important; }
.cmp-mismatch { outline: 2px solid var(--red); background: #f0908066 !important; }
.cmp-info { outline: 2px solid #4a6a8a; background: #a8c0d866 !important; }
.date-plate.cmp-field { outline-color: #f3d27a; }

/* magnifier */
.modal.examine { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-top-color: var(--ochre); }
.examine-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.examine-head h2 { font-size: 1.2rem; margin: 0; }
.examine-body { display: grid; place-items: center; overflow: auto; }
.examine-body .doc { zoom: 1.6; max-width: none; }

.controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid #0005; }
.stamp-btn {
  min-height: 52px; padding: .5rem 1.2rem; border-radius: 4px; cursor: pointer;
  font: 700 1rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: #f4eedd;
  border: 2px solid #0006; box-shadow: 0 4px 0 #0008; transition: transform .08s, box-shadow .08s;
}
.stamp-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0008; }
.stamp-btn:disabled { opacity: .35; cursor: not-allowed; }
.stamp-accept { background: var(--green); }
.stamp-reject { background: var(--red); }
.controls .btn { margin-left: auto; }
.status { grid-column: 1 / -1; margin: 0; color: #e8dcc0; font-size: .9rem; }

/* log */
.logbook { margin-top: 18px; }
.logbook h2 { font-size: 1rem; color: var(--muted); margin-bottom: .5rem; }
.logbook ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.logbook li { display: grid; grid-template-columns: 1fr auto 4rem; gap: 1rem; padding: .4rem .7rem; background: var(--bg-2); border-left: 3px solid var(--line); border-radius: 3px; font-variant-numeric: tabular-nums; }
.logbook li span:last-child { text-align: right; color: var(--ochre); }
.log-accept { border-left-color: var(--green) !important; }
.log-reject { border-left-color: var(--red) !important; }
.log-empty { display: block !important; color: var(--muted); }

@media (max-width: 900px) {
  .post { grid-template-columns: 1fr; }
  .booth { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; align-items: start; }
  .booth-call, .notice { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .desk { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .examine-body .doc { zoom: 1.15; }
  .date-plate { margin-left: 0; }
  .rulebook { max-height: 380px; }
  .booth { grid-template-columns: 1fr; }
  .booth-window { max-width: 300px; width: 100%; margin: 0 auto; }
  .controls { position: sticky; bottom: 0; background: #2c241c; margin: 0 -12px -12px; padding: 10px 12px; }
  .stamp-btn { flex: 1 1 40%; }
  .controls .btn { margin-left: 0; flex: 1 1 100%; }
}

/* the Ministry's verdict on the last stamp */
.notice { padding: .6rem .8rem; border-radius: 3px; background: #efe6cc; color: var(--ink); border-left: 6px solid var(--green); box-shadow: 0 3px 8px #0006; animation: notice-in .3s ease-out; }
.notice p { margin: 0; font-size: .88rem; }
.notice p + p { margin-top: .2rem; }
.notice-level { font: 700 .8rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: #24713a; }
.notice-warning { background: #f6e3b4; border-left-color: #b8862a; }
.notice-warning .notice-level { color: #7a5410; }
.notice-fine { background: #f3d4cc; border-left-color: var(--red); }
.notice-fine .notice-level { color: #9a221c; }
.notice-rules { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .8rem; color: #4a4030; }
@keyframes notice-in { from { transform: translateY(-6px); opacity: 0; } }
.hud-alert { color: #f08070; }
.log-mark { font-weight: 700; margin-left: .3rem; }
.log-correct .log-mark { color: #6fc27f; }
.log-wrong .log-mark { color: #f08070; }
.log-wrong span:last-child { color: #f08070 !important; }
.rulebook-sub { margin-top: .8rem; }

/* rulebook badges and archive */
.rule-badge { display: inline-block; margin-right: .35rem; padding: 0 .35rem; border-radius: 2px; background: #2f6b3a; color: #f4eedd; font: 700 .62rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px; }
.rule-badge.changed { background: #b8862a; }
.rule-badge.withdrawn { background: #6a6050; }
.archive-list { list-style: none; padding: 0 !important; margin: 0 0 .4rem; }
.archive-list li { padding: .35rem 0; border-bottom: 1px dashed #0002; }
.archive-days { display: block; font: 600 .66rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: #6b2626; }
.archive-empty { margin: 0 0 .5rem; font-style: italic; color: #5a5040; }

/* morning briefing */
.modal.briefing { width: min(600px, 100%); border-top-color: var(--ochre); }
.modal.briefing h2 { margin-bottom: .8rem; }
.briefing-bulletin { padding: .7rem .9rem; margin-bottom: .8rem; background: #d9ccaa; color: var(--ink); border-left: 6px solid #6b2626; border-radius: 3px; }
.briefing-bulletin p { margin: 0; }
.briefing-bulletin p + p { margin-top: .4rem; }
.briefing-sub { font-size: .95rem; margin: .8rem 0 .4rem; color: var(--ochre); }
.briefing-list { margin: 0 0 .6rem; padding-left: 1.1rem; font-size: .9rem; }
.briefing-list li + li { margin-top: .45rem; }
.briefing-list .rule-note { color: var(--muted); }

/* painted portraits fill the booth window, seen through the glass */
.visitor.has-photo { inset: 0; left: 0; width: 100%; transform: none; }
.visitor.has-photo .portrait-photo { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.visitor.has-photo.arriving { animation: approach-photo .6s ease-out; }
.visitor.has-photo.leaving { transform: translateY(4%); opacity: .55; }
@keyframes approach-photo { from { transform: translateX(-35%); opacity: 0; } }
.booth-window::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, #ffffff1c 0%, #ffffff00 38%, #ffffff00 70%, #ffffff12 100%); box-shadow: inset 0 0 30px #0006; }
