/* ==================================================
   LOAF & LEDGER — FINAL 1995 MANAGEMENT UI
   Matches the redesigned index.html with:
   .app-titlebar, .screen-navigation, .status-strip,
   .game-shell, .workspace, .side-column, .window
================================================== */
@font-face {
    font-family: "Canterbury";
    src: url("./fonts/Canterbury.ttf") format("truetype");
}

:root {
  --frame-size: 32px;
  --frame-slice: 32;
  --desktop: #5f7479;
  --panel: #c0c0c0;
  --panel-soft: #dfdfdf;
  --panel-light: #ffffff;
  --panel-mid: #a0a0a0;
  --panel-dark: #808080;
  --panel-shadow: #404040;
  --panel-black: #000000;

  --title: #000080;
  --title-text: #ffffff;

  --text: #111111;
  --muted: #505050;
  --highlight: #ffffcc;
  --success: #006000;
  --danger: #8b0000;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  min-height: 100%;
  background: url("./graphics/oakbg.png") repeat;
  color: var(--text);
  font-family: Tahoma, "MS Sans Serif", Verdana, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.25;
}

body {
  min-height: 100vh;
  margin: 0;
  background: url("./graphics/oakbg.png") repeat;
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

#game {
  width: min(1440px, calc(100% - 16px));
  margin: 8px auto;
  background: var(--panel);
  border-top: 2px solid var(--panel-light);
  border-left: 2px solid var(--panel-light);
  border-right: 2px solid var(--panel-black);
  border-bottom: 2px solid var(--panel-black);
}

/* ==================================================
   APPLICATION TITLE BAR
================================================== */

.app-titlebar,
.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  padding: 3px 5px;
  color: var(--title-text);
  background: var(--title);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.app-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 18px;
  color: #000;
  background: #f3cf60;
  border: 1px solid #fff;
  font-size: 9px;
  font-weight: 700;
}

.app-controls {
  display: flex;
  gap: 2px;
}

.app-controls span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 17px;
  color: #000;
  background: var(--panel);
  border-top: 1px solid var(--panel-light);
  border-left: 1px solid var(--panel-light);
  border-right: 1px solid var(--panel-black);
  border-bottom: 1px solid var(--panel-black);
  font-size: 10px;
}

/* ==================================================
   NAVIGATION
================================================== */

.screen-navigation {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-dark);
}

.nav-button,
button {
  min-height: 26px;
  padding: 4px 12px;

  color: #21170f;
  background: #d8bd79;

  border-top: 3px solid #f5e6b4;
  border-left: 3px solid #f5e6b4;
  border-right: 3px solid #5a391d;
  border-bottom: 3px solid #5a391d;

  box-shadow:
    inset 1px 1px 0 #fff1c5,
    inset -1px -1px 0 #8a6030;

  font-weight: 700;
  cursor: pointer;
}

.nav-button {
    min-width: 130px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    text-transform: none;
    letter-spacing: 0;
}

.nav-button img {
    width: 24px;
    height: 24px;

    image-rendering: pixelated;
    image-rendering: crisp-edges;

    flex-shrink: 0;
}

.nav-button span {
    line-height: 1;
}

.nav-button:hover:not(.active),
button:hover:not(:disabled) {
  background: #e3ca8c;
}

.nav-button.active,
button:active:not(:disabled) {
  color: #f1dfae;
  background: #5a3219;

  border-top: 3px solid #2a160b;
  border-left: 3px solid #2a160b;
  border-right: 3px solid #9a6735;
  border-bottom: 3px solid #9a6735;

  box-shadow:
    inset 2px 2px 2px rgba(0, 0, 0, 0.65);

  transform: translate(1px, 1px);
}

button:disabled {
  color: #777;
  cursor: not-allowed;
  text-shadow: 1px 1px var(--panel-light);
}

.primary-button {
  font-weight: 700;
  outline: 1px solid var(--panel-black);
  outline-offset: 1px;
}

.large-button {
  min-width: 150px;
}

/* ==================================================
   STATUS STRIP
================================================== */

.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  background: var(--panel);
}

.status-strip > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 4px 6px;
  background: var(--panel-soft);
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

.status-strip span {
  color: var(--muted);
}

.status-strip strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ==================================================
   MESSAGES
================================================== */

.message {
  margin: 0;
}

.global-message {
  margin: 0 4px 4px;
  padding: 5px 7px;
  background: #ffffcc;
  border: 1px solid #808000;
}

.inline-message {
  min-height: 18px;
  margin-top: 5px;
  color: var(--muted);
}

/* ==================================================
   MAIN LAYOUT
================================================== */

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 5px;
  padding: 4px;
}

.workspace {
  min-width: 0;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.workspace-screen {
  min-width: 0;
}

/* ==================================================
   WINDOWS
================================================== */

.window {
  width: 100%;

  background:
    url("./graphics/parchment.png") repeat;

  border-style: solid;
  border-width: var(--frame-size);
  border-color: transparent;

  border-image-source: url("./graphics/frame.png");
  border-image-slice: var(--frame-slice);
  border-image-width: var(--frame-size);
  border-image-repeat: repeat;
}

.window-titlebar h2 {
  margin: 0;
  font-size: 12px;
}

.window-titlebar span {
  font-size: 10px;
}

.window-body {
  padding: 6px;
}

.compact-body {
  padding: 5px;
}

.window-help {
  margin: 0 0 6px;
  padding: 4px 6px;
  color: var(--muted);
  background: var(--panel-soft);
  border-top: 1px solid var(--panel-dark);
  border-left: 1px solid var(--panel-dark);
  border-right: 1px solid var(--panel-light);
  border-bottom: 1px solid var(--panel-light);
}

.inset-panel {
  padding: 5px;
  background: var(--panel);
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

.panel-heading,
.panel-actions,
.open-bakery-area,
.upgrade-top,
.data-row,
.storage-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-heading {
  margin-bottom: 5px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 12px;
}

.panel-heading span,
.panel-actions,
.office-note {
  font-size: 10px;
}

.panel-actions {
  margin-top: 5px;
}

/* ==================================================
   TABLES
================================================== */

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  font-size: 11px;
}

th,
td {
  padding: 5px 6px;
  border-right: 1px solid var(--panel-mid);
  border-bottom: 1px solid var(--panel-mid);
  text-align: left;
  vertical-align: middle;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  background: var(--panel);
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: #efefef;
}

tbody tr:hover {
  background: var(--highlight);
}

th:nth-child(1),
td:nth-child(1) {
  width: 18%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 42%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 20%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 20%;
}

/* ==================================================
   INPUTS
================================================== */

input[type="number"],
input[type="text"],
select,
textarea {
  width: 110px;
  max-width: 100%;
  min-height: 23px;
  padding: 2px 4px;
  color: var(--text);
  background: #fff;
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

input:focus-visible,
button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

/* ==================================================
   RECIPE
================================================== */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 7px;
  border: 1px solid var(--panel-dark);
}

legend {
  padding: 0 4px;
  font-weight: 700;
}

fieldset label,
.production-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--panel-mid);
}

fieldset label:last-child,
.production-grid label:last-child {
  border-bottom: 0;
}

.recipe-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 5px;
  padding: 1px;
  background: var(--panel-shadow);
}

.recipe-summary > div {
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--panel-soft);
}

.recipe-summary span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.recipe-summary strong {
  font-size: 12px;
}

/* ==================================================
   PRODUCTION
================================================== */

.production-grid {
  display: grid;
  gap: 0;
}

.capacity-display {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0;
  padding: 6px;
  background: var(--panel-soft);
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

.open-bakery-area {
  margin-top: 6px;
  padding: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-dark);
}

.open-bakery-area p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

/* ==================================================
   SIDE WINDOWS
================================================== */

.side-window {
  width: 100%;
}

.weather-name {
  display: block;
  margin-bottom: 4px;
}

.side-window p {
  margin: 4px 0 7px;
}

.data-row {
  padding-top: 5px;
  border-top: 1px solid var(--panel-mid);
}

.inventory-list {
  margin: 0;
}

.inventory-list > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px;
  border-bottom: 1px solid var(--panel-mid);
}

.inventory-list dd {
  margin: 0;
  font-weight: 700;
}

.storage-box {
  margin-top: 6px;
  padding: 5px;
  background: var(--panel-soft);
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
}

.office-note {
  margin: 0;
  color: var(--muted);
}

/* ==================================================
   UPGRADES
================================================== */

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.upgrade-item {
  display: flex;
  flex-direction: column;
  padding: 5px;
  background: var(--panel);
  border-top: 2px solid var(--panel-light);
  border-left: 2px solid var(--panel-light);
  border-right: 2px solid var(--panel-shadow);
  border-bottom: 2px solid var(--panel-shadow);
}

.upgrade-top {
  justify-content: flex-start;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--panel-mid);
}

.upgrade-top h3 {
  margin: 0;
  font-size: 11px;
}

.upgrade-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  background: var(--panel-soft);
  border-top: 2px solid var(--panel-shadow);
  border-left: 2px solid var(--panel-shadow);
  border-right: 2px solid var(--panel-light);
  border-bottom: 2px solid var(--panel-light);
  font-size: 9px;
  font-weight: 700;
}

.upgrade-item > p {
  font-size: 10px;
}

.upgrade-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 5px 0;
  border-top: 1px solid var(--panel-mid);
  border-bottom: 1px solid var(--panel-mid);
  font-size: 10px;
}

.upgrade-next {
  min-height: 28px;
  font-size: 10px;
}

.upgrade-item button {
  width: 100%;
}


/* ==================================================
   DAY RESOLUTION
================================================== */

.day-resolution-overlay {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(18, 10, 5, 0.78);
}

.day-resolution-card {
  width: min(500px, 100%);
}

.day-resolution-card .window-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  text-align: center;
}

.day-resolution-scene {
  position: relative;
  height: 100px;
  overflow: hidden;
  background:
    linear-gradient(
      to bottom,
      #c69555 0%,
      #dfbd78 58%,
      #6b4727 59%,
      #3a2415 100%
    );
  border-top: 2px solid var(--wood-darkest);
  border-left: 2px solid var(--wood-darkest);
  border-right: 2px solid #c79d5f;
  border-bottom: 2px solid #c79d5f;
}

.day-resolution-sun {
  position: absolute;
  top: 12px;
  left: 12%;
  width: 24px;
  height: 24px;
  background: #f3d57d;
  border: 2px solid #8a5c2c;
  transform: rotate(45deg);
  animation: day-sun-crossing 3.2s linear forwards;
}

.day-resolution-bakery {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 150px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--parchment-light);
  background: #4c2d18;
  border: 3px solid #24150c;
  box-shadow:
    inset 2px 2px 0 #7a4e2b,
    inset -2px -2px 0 #1d1008;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
}

.day-resolution-progress {
  height: 18px;
  padding: 2px;
  overflow: hidden;
  background: #2b190d;
  border-top: 2px solid #170c06;
  border-left: 2px solid #170c06;
  border-right: 2px solid #9b6b39;
  border-bottom: 2px solid #9b6b39;
}

#day-resolution-fill {
  width: 0%;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      #a87935 0,
      #a87935 10px,
      #d0a957 10px,
      #d0a957 20px
    );
  transition: width 0.55s steps(4, end);
}

@keyframes day-sun-crossing {
  0% {
    left: 12%;
    top: 52px;
  }

  45% {
    top: 10px;
  }

  100% {
    left: 82%;
    top: 56px;
    filter: brightness(0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .day-resolution-sun {
    animation: none;
  }

  #day-resolution-fill {
    transition: none;
  }
}


/* ==================================================
   DAILY REPORT
================================================== */

.report-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(0,0,0,0.55);
}

.report-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
}

.report-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 6px;
  padding: 1px;
  background: var(--panel-shadow);
}

.report-list > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  background: var(--panel-soft);
}

.report-list dd {
  margin: 0;
  font-weight: 700;
}

.report-highlight {
  grid-column: 1 / -1;
  font-size: 12px;
}

/* ==================================================
   FOOTER
================================================== */

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px;
  border-top: 1px solid var(--panel-dark);
}

.game-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.footer-actions {
  display: flex;
  gap: 3px;
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 980px) {
  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #game {
    width: 100%;
    margin: 0;
  }

  .screen-navigation {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-button {
    width: 100%;
  }

  .status-strip,
  .recipe-grid,
  .recipe-summary,
  .upgrade-grid,
  .report-list,
  .side-column {
    grid-template-columns: 1fr;
  }

  .panel-actions,
  .open-bakery-area,
  .game-footer {
    align-items: stretch;
    flex-direction: column;
  }

  input[type="number"],
  input[type="text"],
  select,
  textarea {
    width: 100%;
  }
}

/* ==================================================
   MEDIEVAL THEME OVERRIDES
   Add this entire section at the very bottom
================================================== */

:root {
  --wood-darkest: #24150c;
  --wood-dark: #3a2415;
  --wood-mid: #5b3a20;
  --wood-light: #8b5d31;

  --parchment-light: #ead7a2;
  --parchment: #d7bd7e;
  --parchment-dark: #b59458;
  --parchment-shadow: #80633a;

  --ink: #21170f;
  --ink-muted: #5c4932;
  --gold: #b68a3c;
  --gold-light: #d9b968;
  --danger: #7d241c;
  --success: #365b2b;
}

/* Main application shell */
#game {
  background: url("./graphics/oakbg.png") repeat;
  border: 2px solid var(--wood-darkest);
  box-shadow:
    0 0 0 2px var(--wood-light),
    0 6px 18px rgba(0, 0, 0, 0.65);
}

/* Main and window title bars */
.app-titlebar,
.window-titlebar {
  min-height: 26px;
  color: var(--parchment-light);
  background:
    linear-gradient(
      to bottom,
      #5b351d 0%,
      #3b2112 52%,
      #24140b 100%
    );
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 145, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  text-shadow: 1px 1px 0 #000;
}

.app-titlebar {
  border-left: 0;
  border-right: 0;
}

.app-icon {
  color: var(--ink);
  background: var(--gold-light);
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 #f0d88f,
    inset -1px -1px 0 #7c5426;
}

.app-controls span {
  color: var(--parchment-light);
  background: var(--wood-mid);
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 var(--wood-light),
    inset -1px -1px 0 #1d1008;
}

/* Navigation */
.screen-navigation {
  gap: 4px;
  padding: 5px;
  background: url("./graphics/oakbg.png") repeat;
  border-bottom: 2px solid var(--wood-darkest);
}

.nav-button,
button {
  min-height: 28px;
  padding: 4px 14px;

  color: var(--ink);
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.25);

  background:
    linear-gradient(
      to bottom,
      #eddcaf 0%,
      #d7bd7d 45%,
      #b78f4d 100%
    );

  border-top: 2px solid #f7ebc7;
  border-left: 2px solid #f7ebc7;
  border-right: 2px solid #5d3b1e;
  border-bottom: 2px solid #5d3b1e;

  box-shadow:
    inset 1px 1px 0 #fff6dc,
    inset -1px -1px 0 #8d6331;

  cursor: pointer;
  transition: none;
}

.nav-button:hover:not(.active),
button:hover:not(:disabled) {
  background:
    linear-gradient(
      to bottom,
      #f5e7c2 0%,
      #e3cb90 45%,
      #c69d5b 100%
    );
}

.nav-button.active,
button:active:not(:disabled) {

  color: var(--parchment-light);

  background:
    linear-gradient(
      to bottom,
      #6b4325 0%,
      #50301a 45%,
      #321b0e 100%
    );

  border-top: 2px solid #24140b;
  border-left: 2px solid #24140b;
  border-right: 2px solid #8d6331;
  border-bottom: 2px solid #8d6331;

  box-shadow:
    inset 2px 2px 3px rgba(0,0,0,.65);

  transform: translate(1px,1px);

  text-shadow: 1px 1px 0 #000;
}

button:disabled {
  color: #78694f;
  background: #bba776;

  border-top: 2px solid #ddd2b2;
  border-left: 2px solid #ddd2b2;
  border-right: 2px solid #7a6847;
  border-bottom: 2px solid #7a6847;

  box-shadow: none;
}

.primary-button {
  outline: 1px solid var(--wood-darkest);
  outline-offset: 1px;
}

/* Status strip */
.status-strip {
  gap: 4px;
  padding: 5px;
  background: url("./graphics/oakbg.png") repeat;
}

.status-strip > div {
  color: var(--ink);
  background:
    url("./graphics/parchment.png") repeat;
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 rgba(255, 245, 205, 0.7),
    inset -1px -1px 0 var(--parchment-shadow);
}

.status-strip span {
  color: var(--ink-muted);
}

/* Window interiors */
.window-body {
  color: var(--ink);
  background: transparent;
}

.window-help {
  color: var(--ink-muted);
  background: rgba(239, 220, 171, 0.72);
  border: 1px solid var(--parchment-shadow);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.45),
    inset -1px -1px 0 rgba(88,56,25,0.18);
}

.inset-panel {
  background: rgba(229, 207, 153, 0.78);
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 2px rgba(58, 36, 21, 0.38),
    inset -1px -1px 0 rgba(255, 244, 208, 0.55);
}

/* Tables */
.table-wrap {
  background: rgba(236, 220, 180, 0.92);
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 2px rgba(48, 27, 14, 0.45),
    inset -1px -1px 0 rgba(255,255,255,0.35);
}

table {
  color: var(--ink);
  background: rgba(238, 222, 184, 0.95);
}

th,
td {
  border-right: 1px solid #9c7d4d;
  border-bottom: 1px solid #9c7d4d;
}

th {
  color: #1e140c;
  background:
    linear-gradient(
      to bottom,
      #c6a869 0%,
      #ad8a4f 100%
    );
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}

tbody tr:nth-child(even) {
  background: rgba(214, 190, 135, 0.5);
}

tbody tr:hover {
  background: rgba(238, 207, 118, 0.75);
}

/* Inputs */
input[type="number"],
input[type="text"],
select,
textarea {
  color: var(--ink);
  background: #efe0b5;
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 2px rgba(58,36,21,0.5),
    inset -1px -1px 0 rgba(255,255,255,0.55);
}

input:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--gold-light);
  outline-offset: 1px;
}

/* Recipe and production panels */
fieldset {
  border: 1px solid var(--parchment-shadow);
  background: rgba(232, 211, 164, 0.4);
}

legend {
  color: var(--wood-darkest);
}

fieldset label,
.production-grid label {
  border-bottom: 1px solid rgba(128, 99, 58, 0.55);
}

.recipe-summary {
  background: var(--wood-darkest);
}

.recipe-summary > div {
  background: rgba(226, 204, 153, 0.95);
}

.recipe-summary span {
  color: var(--ink-muted);
}

.capacity-display,
.open-bakery-area,
.storage-box {
  background: rgba(226, 204, 153, 0.86);
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.4),
    inset -1px -1px 0 rgba(81,51,24,0.22);
}

.open-bakery-area p,
.office-note {
  color: var(--ink-muted);
}

/* Inventory and side panels */
.data-row {
  border-top: 1px solid rgba(128, 99, 58, 0.65);
}

.inventory-list > div {
  border-bottom: 1px solid rgba(128, 99, 58, 0.5);
}

/* Upgrades */
.upgrade-item {
  background:
    url("./graphics/parchment.png") repeat;
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.35),
    inset -1px -1px 0 rgba(72,42,18,0.35);
}

.upgrade-top {
  border-bottom: 1px solid var(--parchment-shadow);
}

.upgrade-icon {
  color: var(--parchment-light);
  background:
    linear-gradient(
      to bottom,
      #654022 0%,
      #3a2111 100%
    );
  border: 1px solid var(--wood-darkest);
  box-shadow:
    inset 1px 1px 0 #89603b,
    inset -1px -1px 0 #160b05;
}

.upgrade-status {
  border-top: 1px solid var(--parchment-shadow);
  border-bottom: 1px solid var(--parchment-shadow);
}

/* Messages */
.global-message {
  color: var(--ink);
  background: #ead99e;
  border: 1px solid #7e5e2e;
}

.inline-message {
  color: var(--ink-muted);
}

/* Daily report */
.report-list {
  background: var(--wood-darkest);
}

.report-list > div {
  background: rgba(229, 207, 153, 0.96);
}

/* Footer */
.game-footer {
  background: url("./graphics/oakbg.png") repeat;
  border-top: 2px solid var(--wood-darkest);
}

.game-footer p {
  color: #d5c29a;
  text-shadow: 1px 1px 0 #000;
}

.guild-tax-notice {
  margin-top: 12px;
  padding: 10px 12px;

  background:
    rgba(223, 198, 139, 0.88);

  border-top:
    2px solid #f0dca8;

  border-left:
    2px solid #f0dca8;

  border-right:
    2px solid #59401f;

  border-bottom:
    2px solid #59401f;

  color: #241408;
}

.guild-tax-notice__title {
  margin: -10px -12px 8px;
  padding: 5px 8px;

  background: #3a1d0e;
  color: #f2d794;

  font-weight: bold;
}

.guild-tax-notice p {
  margin: 6px 0;
}

.guild-tax-notice dl {
  margin: 8px 0 0;
}

.guild-tax-notice dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;

  padding: 3px 0;
  border-bottom:
    1px solid rgba(71, 44, 19, 0.35);
}

.guild-tax-notice dd {
  margin: 0;
  font-weight: bold;
}

.guild-tax-warning {
  margin-top: 8px !important;
  padding: 6px 8px;

  background: #6e2e18;
  color: #ffe0a0;

  border:
    1px solid #2d1208;

  font-weight: bold;
  text-align: center;
}

/* On tax days, make Net Cash Change fill the complete row */
.report-list:has(#report-taxable-revenue-row:not([hidden]))
#report-net-cash-change-row {
  grid-column: 1 / -1;
}

.guild-tax-notice dl {
  margin: 14px 0 0;
}

.guild-tax-notice dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  padding: 8px 0;
  border-top: 1px solid rgba(70, 35, 15, 0.35);
}

.guild-tax-notice dt {
  margin: 0;
}

.guild-tax-notice dd {
  margin: 0;
  font-weight: bold;
  text-align: right;
  white-space: nowrap;
}

.guild-tax-description {
  margin: 0;
  line-height: 1.45;
}

/* Final Guild Ledger layout override */
#guild-tax-panel .guild-tax-notice {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

#guild-tax-panel .guild-tax-description {
  margin: 0 0 10px;
  line-height: 1.4;
}

#guild-tax-panel .guild-tax-notice dl {
  display: block;
  margin: 0;
  padding: 0;
}

#guild-tax-panel .guild-tax-notice dl > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;

  width: 100%;
  padding: 7px 2px;

  border-top: 1px solid rgba(70, 35, 15, 0.35);
  border-bottom: 0;
}

#guild-tax-panel .guild-tax-notice dt,
#guild-tax-panel .guild-tax-notice dd {
  display: block;
  margin: 0 !important;
  padding: 0;
}

#guild-tax-panel .guild-tax-notice dt {
  text-align: left;
}

#guild-tax-panel .guild-tax-notice dd {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* ---------- Game title graphic ---------- */

.game-logo {
    margin: 0;

    font-family: "Canterbury", serif;
    font-size: 34px;
    font-weight: normal;

    color: #cfa53b;

    text-shadow:
        1px 1px 0 #fff3b0,
        2px 2px 0 #8a6424,
        3px 3px 4px rgba(0,0,0,.5);

    letter-spacing: 1px;
    white-space: nowrap;
}

/* ==================================================
   TITLE SCREEN
================================================== */

.title-screen {
  position: fixed;
  z-index: 100;
  inset: 0;

  display: grid;
  place-items: center;

  min-height: 100vh;
  padding: 24px;

  background:
    url("./graphics/oakbg.png") repeat;

  overflow-y: auto;
}

.title-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;

  width: min(700px, 100%);
  padding: 40px 30px;

  text-align: center;
}

.title-screen-logo {
    margin: 0 0 45px;

    font-family: "Canterbury", serif;
    font-size: 90px;
    font-weight: normal;

    color: #cfa53b;

    text-shadow:
        1px 1px 0 #fff3b0,
        2px 2px 0 #8a6424,
        3px 3px 6px rgba(0,0,0,.6);

    letter-spacing: 2px;
    line-height: 1;
}

.title-screen-buttons {
  display: grid;
  gap: 14px;

  width: min(280px, 100%);
}

.title-menu-button {
  width: 100%;
  min-height: 48px;

  padding: 10px 24px;

  font-size: 15px;
}

.title-menu-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.title-screen-message {
  min-height: 20px;
  margin: 18px 0 0;
  padding: 7px 12px;

  color: #f0dca8;
  background: rgba(36, 21, 12, 0.88);

  border: 1px solid #b59458;

  text-shadow: 1px 1px 0 #000;
}

/*
Prevents the hidden game or title screen
from remaining visible.
*/
#game[hidden],
.title-screen[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .title-screen-content {
    padding: 24px 12px;
  }

  .title-screen-logo {
    width: min(520px, 95vw);
    margin-bottom: 30px;
  }
}