:root {
  --wood-dark: #2a170c;
  --wood: #4a2a14;
  --wood-light: #6e4220;
  --parchment: #efdfb8;
  --parchment-dark: #d6bd86;
  --ink: #2b1a0e;
  --blood: #8b1a1a;
  --gold: #d4a017;
  --gold-light: #ffe38a;
  --stone: #3b3633;
  --text-light: #f3e6c4;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  color: var(--text-light);
  font-family: "IM Fell English", Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.6;
  overflow-x: clip;
  background-color: var(--wood-dark);
  /* wooden wall: "Wood planks" by Starry Skydancer (CC0) + warm torchlight + vignette */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,150,40,.16), transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.5)),
    linear-gradient(rgba(20,10,4,.25), rgba(20,10,4,.25)),
    url("img/wood-planks.jpg");
  background-size: auto, auto, auto, 384px 384px;
  background-attachment: fixed;
}

h1, h2, h3 { font-family: "Cinzel", serif; line-height: 1.2; }

a { color: var(--gold-light); }

/* ============ Icon colouring (game-icons.net, recoloured) ============ */
.goblin, .goblin svg { fill: url(#goblinSkin); filter: drop-shadow(0 4px 4px rgba(0,0,0,.55)); }
/* animated CraftPix goblin (sprite sheet, 9 frames of 177x180) */
.goblin-idle {
  --w: 96px;
  width: var(--w); height: calc(var(--w) * 180 / 177);
  background: url("img/goblin-idle.png") 0 0 / calc(var(--w) * 9) 100% no-repeat;
  animation: idle-steps 1.6s steps(9) infinite;
}
@keyframes idle-steps { to { background-position: calc(var(--w) * -9) 0; } }
.steel { fill: url(#steel); }

/* ============ Beam & hanging goblin ============ */
.beam {
  position: relative;
  height: 34px;
  background:
    linear-gradient(rgba(255,200,120,.12), rgba(0,0,0,.35)),
    url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
  border-bottom: 4px solid #1a0d05;
  box-shadow: 0 6px 14px rgba(0,0,0,.6);
  z-index: 5;
}
.hanger {
  position: absolute;
  top: 30px;
  right: 12%;
  width: 84px;
  transform-origin: 50% 0;
  animation: swing 4s ease-in-out infinite;
}
.hanger::before {
  content: "";
  display: block;
  width: 4px; height: 26px; margin: 0 auto;
  background: repeating-linear-gradient(45deg, #b08a4a 0 4px, #6b4a1f 4px 8px);
}
.goblin-hanging { display: block; width: 84px; height: 85px; margin-top: -8px; }
@keyframes swing { 0%,100% { transform: rotate(7deg); } 50% { transform: rotate(-7deg); } }

/* ============ Hero ============ */
.hero {
  position: relative;
  text-align: center;
  padding: 3rem 1rem 4rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,170,60,.22), transparent 65%),
    linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.45)),
    repeating-linear-gradient(0deg, #4a4440 0 38px, #2a2522 38px 41px),
    #3b3633;
  box-shadow: inset 0 -20px 40px rgba(0,0,0,.6);
  overflow: hidden;
}
/* staggered stone bricks */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 88px, rgba(0,0,0,.45) 88px 91px);
  -webkit-mask: repeating-linear-gradient(0deg, #000 0 41px, transparent 41px 82px);
          mask: repeating-linear-gradient(0deg, #000 0 41px, transparent 41px 82px);
  pointer-events: none;
}
.hero > * { position: relative; }
/* carved wooden ledge under the stone wall */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 16px;
  background: linear-gradient(rgba(255,210,140,.15), rgba(0,0,0,.45)), url("img/wood-planks-h.jpg") 0 -20px / 256px 256px;
  border-top: 2px solid #1a0d05;
  box-shadow: 0 6px 12px rgba(0,0,0,.6);
}

.torch {
  position: absolute; top: 2rem; width: 96px; height: 96px;
  filter: drop-shadow(0 0 14px #ff9a2a);
  animation: flicker .3s ease-in-out infinite alternate;
}
.torch-l { left: 4%; }
.torch-r { right: 4%; transform: scaleX(-1); }
@keyframes flicker { from { filter: drop-shadow(0 0 10px #ff9a2a); } to { filter: drop-shadow(0 0 22px #ffb84a); } }

.crest { position: relative; width: 190px; height: 170px; margin: 0 auto .5rem; }
.crest-sword { position: absolute; left: 50%; top: 0; width: 150px; height: 150px; margin-left: -75px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.crest-sword-l { transform: rotate(-38deg); }
.crest-sword-r { transform: rotate(38deg); }
.crest-shield {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -36px 0 0 -46px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.7));
}

.eyebrow { font-family: "Cinzel", serif; letter-spacing: .15em; text-transform: uppercase; font-size: .8rem; color: var(--parchment-dark); margin: 0; }
.hero h1 {
  font-family: "Cinzel Decorative", serif;
  font-weight: 900;
  font-size: clamp(3rem, 12vw, 6.5rem);
  margin: .2rem 0 0;
  color: var(--gold-light);
  background: linear-gradient(#fff3b8, #e0b030 50%, #9a6a0a);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #3a1a05) drop-shadow(0 0 24px rgba(255,170,40,.35));
}
.subtitle { font-family: "Cinzel", serif; font-size: clamp(1.1rem, 3.5vw, 1.6rem); margin: 0; color: var(--parchment); }
.tagline { font-style: italic; color: var(--parchment-dark); margin: .4rem 0 1.6rem; }

.main-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.main-nav a {
  font-family: "Cinzel", serif;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(var(--parchment), var(--parchment-dark));
  padding: .45rem 1rem;
  border: 2px solid #6b4a1f;
  border-radius: 3px;
  box-shadow: 0 3px 0 #3a200e, 0 6px 10px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.main-nav a:hover, .main-nav a:focus-visible { transform: translateY(-2px); box-shadow: 0 5px 0 #3a200e, 0 10px 14px rgba(0,0,0,.4); }

.goblin-peek-hero {
  position: absolute;
  left: 10px; bottom: 0;
  --w: 110px;
  animation: peek 7s ease-in-out infinite, idle-steps 1.6s steps(9) infinite;
}
@keyframes peek {
  0%, 60%, 100% { transform: translateY(120px) rotate(6deg); }
  70%, 90% { transform: translateY(30px) rotate(6deg); }
}

/* ============ Sections ============ */
main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.section { padding: 3.5rem 0 1rem; position: relative; }
.section-title { text-align: center; font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 .5rem; color: var(--gold-light); }
.section-title span { display: inline-block; padding: 0 1rem; position: relative; }
.section-title span::before, .section-title span::after {
  content: "◆"; color: var(--gold); font-size: .5em; position: absolute; top: .55em;
}
.section-title span::before { left: -.8em; }
.section-title span::after { right: -.8em; }
.section-lede { text-align: center; font-style: italic; color: var(--parchment-dark); margin-top: 0; }

/* ============ Decree scroll ============ */
.scroll {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 5vw, 3.5rem) 3rem;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(120,70,20,.18), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(120,70,20,.22), transparent 50%),
    var(--parchment);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #b89a5a, 0 14px 30px rgba(0,0,0,.6), inset 0 0 50px rgba(110,66,32,.35);
}
.scroll::before, .scroll::after {
  content: ""; position: absolute; left: -14px; right: -14px; height: 26px;
  background: linear-gradient(#c9ab6e, #8a6a32);
  border-radius: 13px;
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
}
.scroll::before { top: -13px; }
.scroll::after { bottom: -13px; }
.scroll h2 { text-align: center; color: var(--blood); margin-top: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.dropcap::first-letter {
  float: left; font-family: "Cinzel Decorative", serif; font-size: 3.6rem; line-height: .9;
  padding: .3rem .5rem 0 0; color: var(--blood);
}
.signature { text-align: right; font-style: italic; margin-bottom: 0; }
.seal {
  position: absolute; bottom: 14px; left: 22px;
  width: 78px; height: 78px;
  fill: #a11a1a;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.5));
  transform: rotate(-12deg);
}

.stuck-arrow {
  position: absolute; width: 110px; height: 110px;
  filter: drop-shadow(3px 5px 3px rgba(0,0,0,.5));
  pointer-events: none;
}
.stuck-arrow-1 { top: -30px; right: -40px; transform: rotate(180deg); }
.stuck-arrow-2 { top: -44px; left: -44px; transform: rotate(90deg); }

/* ============ Quest board ============ */
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
  padding: 2.2rem 1.6rem;
  margin-top: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,190,110,.18), transparent 70%),
    url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
  border: 16px solid transparent;
  border-image: url("img/wood-planks-h.jpg") 60 round;
  box-shadow: 0 16px 30px rgba(0,0,0,.6), inset 0 0 40px rgba(0,0,0,.5);
}
.board-axe { position: absolute; width: 110px; height: 110px; top: -70px; right: 10px; transform: rotate(20deg); filter: drop-shadow(3px 6px 4px rgba(0,0,0,.6)); }
.board-dagger { position: absolute; width: 80px; height: 80px; bottom: -44px; left: 42%; transform: rotate(160deg); filter: drop-shadow(2px 4px 3px rgba(0,0,0,.6)); }

.notice {
  position: relative;
  color: var(--ink);
  background: linear-gradient(160deg, #f6e9c6, #dcc58e);
  padding: 1.6rem 1.2rem 1.2rem;
  box-shadow: 0 10px 18px rgba(0,0,0,.45);
  clip-path: polygon(0 2%, 4% 0, 30% 1%, 60% 0, 96% 1%, 100% 4%, 99% 40%, 100% 70%, 98% 100%, 70% 99%, 40% 100%, 3% 99%, 0 96%, 1% 60%);
  transition: transform .2s;
}
.notice:hover { transform: rotate(0) scale(1.03); }
.tilt-l { transform: rotate(-2deg); }
.tilt-r { transform: rotate(2.2deg); }
.tilt-s { transform: rotate(-.8deg); }
.notice h3 { margin: .2rem 0 .5rem; font-size: 1.15rem; color: var(--blood); }
.notice p { margin: .4rem 0; font-size: 1rem; }
.pin {
  position: absolute; top: 8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ddd, #555);
  box-shadow: 0 2px 3px rgba(0,0,0,.6);
}
.rank { font-family: "Cinzel", serif; font-weight: 700; font-size: .8rem; letter-spacing: .1em; display: inline-block; padding: .05rem .55rem; border-radius: 2px; color: #fff; }
.rank-s { background: #8b1a1a; }
.rank-b { background: #2f5d7a; }
.rank-c { background: #4f7a24; }
.rank-w { background: #1a1a1a; }
.reward { display: flex; align-items: center; gap: .4rem; font-weight: bold; border-top: 1px dashed #8a6a32; padding-top: .5rem; }
.reward img { width: 28px; height: 28px; flex: none; }
.wanted-portrait { display: block; width: 110px; height: 112px; margin: .3rem auto; }
.wanted .wanted-portrait { filter: sepia(.45) contrast(1.05); }

/* ============ Offices ============ */
.weapon-divider { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 0 auto 1.5rem; max-width: 480px; }
.weapon-divider img { width: 60px; height: 60px; flex: none; }
.weapon-divider .rule { flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.office {
  background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.45)), #3b3633;
  border: 3px solid #1a1410;
  outline: 2px solid var(--gold);
  outline-offset: -9px;
  padding: 1.6rem 1.3rem 1.3rem;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0,0,0,.5);
  transition: transform .2s, box-shadow .2s;
}
.office:hover { transform: translateY(-4px); box-shadow: 0 16px 26px rgba(0,0,0,.6), 0 0 20px rgba(212,160,23,.25); }
.office-icon { height: 90px; display: flex; justify-content: center; align-items: center; margin-bottom: .5rem; }
.office-icon img { height: 90px; width: 90px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.office h3 { color: var(--gold-light); margin: .3rem 0 .5rem; font-size: 1.15rem; }
.office p { margin: 0; font-size: 1rem; color: #e6d7b2; }

/* ============ Ledger ============ */
.ledger {
  position: relative;
  max-width: 820px;
  margin: 1.5rem auto 0;
  padding: 1.5rem;
  background: var(--parchment);
  color: var(--ink);
  border-left: 18px solid var(--blood);
  box-shadow: 0 14px 30px rgba(0,0,0,.6), inset 0 0 40px rgba(110,66,32,.3);
  border-radius: 2px 6px 6px 2px;
}
.goblin-ledger { position: absolute; --w: 100px; top: -96px; right: 30px; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ledger caption { caption-side: top; font-style: italic; padding-bottom: .6rem; color: #6b4a1f; }
.ledger th { font-family: "Cinzel", serif; text-align: left; border-bottom: 2px solid var(--ink); padding: .4rem .5rem; }
.ledger td { padding: .45rem .5rem; border-bottom: 1px dotted #a08050; }
.ledger td:nth-child(2) { color: var(--blood); font-weight: bold; }
.ledger tbody tr:last-child td { border-bottom: none; }

/* ============ Steps & form ============ */
.steps { list-style: none; padding: 0; margin: 1.5rem auto 2.5rem; max-width: 760px; display: grid; gap: 1rem; }
.steps li { display: flex; gap: 1rem; align-items: flex-start; background: rgba(0,0,0,.3); border: 1px solid rgba(212,160,23,.4); padding: 1rem; border-radius: 4px; }
.step-num {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Cinzel", serif; font-weight: 700; color: var(--ink);
  background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--gold) 60%, #8a6208);
  box-shadow: 0 3px 6px rgba(0,0,0,.5);
}
.steps h3 { margin: 0; color: var(--gold-light); font-size: 1.1rem; }
.steps p { margin: .2rem 0 0; font-size: 1rem; }

.claim-form {
  position: relative;
  max-width: 560px; margin: 0 auto;
  padding: 2rem 1.6rem;
  background: var(--parchment); color: var(--ink);
  box-shadow: 0 14px 30px rgba(0,0,0,.6), inset 0 0 40px rgba(110,66,32,.3);
  display: grid; gap: 1rem;
}
.claim-form h3 { margin: 0; text-align: center; color: var(--blood); }
.claim-form label { display: grid; gap: .3rem; font-family: "Cinzel", serif; font-size: .9rem; font-weight: 700; }
.claim-form input[type=text], .claim-form input[type=number], .claim-form select {
  font: inherit; font-family: "IM Fell English", serif; font-weight: normal; font-size: 1rem;
  padding: .55rem .7rem; background: #fbf3dc; border: 2px solid #8a6a32; border-radius: 3px; color: var(--ink); width: 100%;
}
.claim-form .check { display: flex; align-items: center; gap: .5rem; font-family: "IM Fell English", serif; font-weight: normal; font-size: 1rem; }
.claim-form button {
  font-family: "Cinzel", serif; font-weight: 700; font-size: 1.05rem;
  padding: .75rem; cursor: pointer; color: #fff3d6;
  background: linear-gradient(#a62424, #6a0a0a);
  border: 2px solid #3a0505; border-radius: 3px;
  box-shadow: 0 4px 0 #3a0505;
}
.claim-form button:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a0505; }

/* ============ Footer ============ */
.footer {
  position: relative;
  margin-top: 4rem;
  padding: 3rem 16px 2rem;
  text-align: center;
  background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.75)), url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
  border-top: 14px solid transparent;
  border-image: url("img/wood-planks-h.jpg") 60 0 0 0 / 14px 0 0 0 round;
  color: var(--parchment-dark);
}
.footer p { margin: .3rem 0; }
.footer-title { font-family: "Cinzel Decorative", serif; font-size: 1.5rem; color: var(--gold-light); }
.footer .small { font-size: .85rem; font-style: italic; opacity: .8; }
.footer .credits { font-size: .8rem; opacity: .75; max-width: 640px; margin: .8rem auto 0; }
.footer-weapons { display: flex; justify-content: center; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.fw-sword { width: 64px; height: 64px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.fw-sword-l { transform: rotate(-30deg); }
.fw-sword-r { transform: rotate(30deg); }
.fw-chest { width: 90px; height: 90px; filter: drop-shadow(0 0 12px rgba(255,200,60,.35)); }

/* Goblin with a loot sack */
.goblin-thief { position: absolute; --w: 92px; top: -92px; left: 8%; }

/* ============ Running goblin ============ */
.goblin-runner {
  position: fixed;
  bottom: 4px; left: 0;
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.55));
  animation: run 22s linear infinite;
}
.runner-sprite {
  width: 70px; height: 71px;
  background: url("img/goblin-run.png") 0 0 / 840px 71px no-repeat;
  animation: run-steps .6s steps(12) infinite;
}
@keyframes run-steps { to { background-position: -840px 0; } }
@keyframes bob { to { transform: translateY(-4px); } }
@keyframes run {
  0%   { transform: translateX(-120px) scaleX(1); }
  45%  { transform: translateX(calc(100vw + 20px)) scaleX(1); }
  50%  { transform: translateX(calc(100vw + 20px)) scaleX(-1); }
  95%  { transform: translateX(-120px) scaleX(-1); }
  100% { transform: translateX(-120px) scaleX(1); }
}

.goblin { cursor: pointer; }
.goblin.startled { animation: startle .4s ease; }
@keyframes startle { 30% { transform: translateY(-14px) rotate(-8deg); } }

.squeak {
  position: fixed; z-index: 50; pointer-events: none;
  transform: translate(-50%, -140%);
  font-family: "Cinzel", serif; font-weight: 700; font-size: .95rem;
  color: var(--ink); background: var(--parchment);
  padding: .2rem .6rem; border-radius: 12px; border: 2px solid #4f7a24;
  animation: squeak 1.2s ease-out forwards;
}
@keyframes squeak { to { opacity: 0; transform: translate(-50%, -260%); } }

/* ============ Small screens ============ */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .torch { width: 56px; height: 56px; top: 1rem; }
  .torch-l { left: 1%; } .torch-r { right: 1%; }
  .crest { width: 140px; height: 125px; }
  .crest-sword { width: 112px; height: 112px; margin-left: -56px; }
  .crest-shield { width: 68px; height: 68px; margin: -26px 0 0 -34px; }
  .stuck-arrow { width: 76px; height: 76px; }
  .stuck-arrow-1 { right: -10px; top: -20px; }
  .stuck-arrow-2 { left: -14px; top: -30px; }
  .board { padding: 1.6rem 1rem; border-width: 10px; }
  .board-axe { width: 76px; height: 76px; top: -50px; }
  .hanger { width: 60px; }
  .goblin-hanging { width: 60px; height: 61px; }
  .goblin-peek-hero { --w: 80px; }
  .goblin-ledger { --w: 70px; top: -66px; right: 12px; }
  .seal { width: 56px; height: 56px; left: 12px; bottom: 12px; }
  .ledger { padding: 1rem .7rem; border-left-width: 10px; }
  .ledger td, .ledger th { padding: .35rem .3rem; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .goblin-runner { display: none; }
}

/* ============ Claim reply ============ */
.claim-reply {
  border-top: 2px dashed #8a6a32;
  padding-top: 1rem;
  animation: unfurl .4s ease;
}
@keyframes unfurl { from { opacity: 0; transform: translateY(-6px); } }
.claim-reply h4 { font-family: "Cinzel", serif; margin: 0 0 .4rem; color: var(--blood); text-align: center; }
.claim-reply p { margin: .35rem 0; }
.reply-claimno { font-family: "Cinzel", serif; font-weight: 700; font-size: .9rem; }
.reply-clerk { font-style: italic; }
.reply-verdict { font-weight: bold; color: var(--blood); }
.reply-lord { background: linear-gradient(rgba(212,160,23,.25), transparent); }
.receipt { background: #fbf3dc; border: 1px solid #b89a5a; padding: .6rem .8rem; margin: .6rem 0; font-size: .98rem; }
.receipt-row { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border-bottom: 1px dotted #c8ad78; }
.receipt-row span:last-child { white-space: nowrap; font-weight: bold; }
.receipt-extra { color: #6b4a1f; font-style: italic; }
.receipt-total { border-bottom: none; border-top: 2px solid var(--ink); margin-top: .2rem; padding-top: .35rem; font-size: 1.05rem; }
.receipt-owe span:last-child { color: var(--blood); }

/* ============ Gaming tables ============ */
.btn {
  font-family: "Cinzel", serif; font-weight: 700; font-size: 1rem;
  padding: .6rem 1.3rem; cursor: pointer; color: #fff3d6;
  background: linear-gradient(#a62424, #6a0a0a);
  border: 2px solid #3a0505; border-radius: 3px;
  box-shadow: 0 4px 0 #3a0505;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a0505; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: #8a6a32; box-shadow: 0 4px 0 #8a6a32; }

.games { max-width: 900px; margin: 1.5rem auto 0; }
.game-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.game-tabs button {
  flex: 1 1 140px;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  font-family: "Cinzel", serif; font-weight: 700; font-size: .95rem;
  padding: .6rem .7rem; cursor: pointer;
  color: var(--parchment); background: rgba(0,0,0,.45);
  border: 2px solid #6b4a1f; border-bottom: none; border-radius: 6px 6px 0 0;
}
.game-tabs button img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.game-tabs button[aria-selected="true"] { color: var(--ink); background: var(--parchment); border-color: #b89a5a; }

.game-panel {
  background: var(--parchment); color: var(--ink);
  padding: 1.3rem clamp(.8rem, 3vw, 1.6rem) 1.5rem;
  box-shadow: 0 14px 30px rgba(0,0,0,.6), inset 0 0 40px rgba(110,66,32,.3);
  border-radius: 0 0 6px 6px;
}
.game-intro { margin: 0 0 .8rem; text-align: center; }
.game-hud {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem;
  font-family: "Cinzel", serif; font-size: .9rem; margin-bottom: 1rem;
}
.game-hud b { color: var(--blood); }
.game-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .8rem; margin-top: 1rem; }
.game-msg { text-align: center; font-style: italic; min-height: 1.6em; margin: .8rem 0 0; }

/* Whack */
.whack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.4rem, 2vw, 1rem);
  max-width: 460px; margin: 0 auto;
  padding: 1rem; border-radius: 8px;
  background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.45)), url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
}
.whack-hole {
  position: relative; aspect-ratio: 1; padding: 0; border: none; background: none; cursor: pointer;
  overflow: hidden; touch-action: manipulation;
}
.whack-pit { position: absolute; left: 5%; right: 5%; bottom: 0; width: 90%; height: 60%; fill: #120a05; }
.whack-gob {
  position: absolute; left: 10%; width: 80%; height: 80%; bottom: 6%;
  object-fit: contain; pointer-events: none; user-select: none;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.6));
  transform: translateY(110%); transition: transform .12s ease-out;
}
.whack-hole.up .whack-gob { transform: translateY(0); }
.whack-hole.hit .whack-gob { transform: translateY(0) scale(.85) rotate(-15deg); filter: sepia(1) saturate(4) hue-rotate(-40deg); }

/* Catcher */
.catch-canvas {
  display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto;
  border: 6px solid #2a170c; border-radius: 4px; touch-action: none; cursor: none;
  background: #1f140c;
}

/* Appraiser */
.appraise-card {
  display: flex; gap: 1.2rem; align-items: center;
  max-width: 620px; margin: 0 auto 1rem; padding: 1rem;
  background: #fbf3dc; border: 1px solid #b89a5a;
}
.appraise-icon { width: 110px; height: 110px; flex: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); }
.appraise-card h3 { margin: 0 0 .3rem; color: var(--blood); }
.appraise-card p { margin: .2rem 0; }
.appraise-hint { font-size: .9rem; color: #6b4a1f; font-style: italic; }
.appraise-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: .8rem; }
.appraise-form label, .dice-actions label { display: grid; gap: .25rem; font-family: "Cinzel", serif; font-size: .85rem; font-weight: 700; }
.appraise-form input, .dice-actions input {
  font: inherit; font-family: "IM Fell English", serif; font-weight: normal; font-size: 1rem;
  padding: .5rem .7rem; width: 10rem; background: #fbf3dc; border: 2px solid #8a6a32; border-radius: 3px; color: var(--ink);
}
.dice-actions input { width: 6rem; }

/* Dice */
.dice-table { display: flex; justify-content: center; align-items: center; gap: clamp(.8rem, 4vw, 2.5rem); flex-wrap: wrap; }
.dice-side { text-align: center; }
.dice-side h3 { margin: 0 0 .5rem; display: flex; align-items: center; justify-content: center; gap: .3rem; }
.dice-goblin { width: 40px; height: 41px; }
.dice-pair { display: flex; gap: .6rem; justify-content: center; }
.dice-vs { font-family: "Cinzel Decorative", serif; font-size: 1.6rem; color: var(--blood); }
.dice-total { margin: .4rem 0 0; font-family: "Cinzel", serif; font-weight: 700; }
.die {
  width: 62px; height: 62px; padding: 8px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  background: linear-gradient(145deg, #fffaf0, #e2d2ac); border: 2px solid #6b4a1f; border-radius: 10px;
  box-shadow: 0 4px 0 #8a6a32, 0 6px 10px rgba(0,0,0,.3);
}
.die span { display: block; }
.die .pip { width: 11px; height: 11px; margin: auto; border-radius: 50%; background: var(--blood); }
.dice-pair.rolling .die { animation: wobble .14s linear infinite; }
@keyframes wobble { 50% { transform: rotate(12deg); } }

@media (max-width: 640px) {
  .appraise-card { flex-direction: column; text-align: center; }
  .die { width: 50px; height: 50px; padding: 6px; }
  .die .pip { width: 9px; height: 9px; }
  .game-tabs button { font-size: .8rem; flex-basis: 45%; }
}

/* ============ Debtors' Court ============ */
.court-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; align-items: start; }
.court-case {
  background: #fbf3dc; border: 1px solid #b89a5a; padding: 1rem 1.2rem; min-height: 250px;
  transition: box-shadow .3s, border-color .3s;
}
.court-case.court-right { border-color: #4f7a24; box-shadow: 0 0 0 3px rgba(79,122,36,.35); }
.court-case.court-wrong { border-color: var(--blood); box-shadow: 0 0 0 3px rgba(139,26,26,.4); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.court-docket { font-family: "Cinzel", serif; font-size: .75rem; letter-spacing: .1em; color: #6b4a1f; margin: 0; }
.court-case h3 { margin: .2rem 0 .4rem; color: var(--blood); }
.court-case p { margin: .3rem 0; }
.court-facts { margin: .4rem 0 .8rem; padding-left: 1.2rem; font-style: italic; }
.court-verdicts { display: flex; flex-wrap: wrap; gap: .6rem; }
.court-verdicts .verdict { flex: 1 1 110px; line-height: 1.15; padding: .55rem .6rem; }
.court-verdicts .verdict small { font-family: "IM Fell English", serif; font-weight: normal; font-size: .8rem; opacity: .85; }
.court-verdicts [data-verdict="acquit"] { background: linear-gradient(#5f8a2e, #3a5a18); border-color: #1f3308; box-shadow: 0 4px 0 #1f3308; }
.court-verdicts [data-verdict="fine"] { background: linear-gradient(#c58a1a, #8a5a08); border-color: #4a3005; box-shadow: 0 4px 0 #4a3005; }
.court-code { background: rgba(110,66,32,.12); border: 1px dashed #8a6a32; padding: .8rem 1rem; font-size: .95rem; }
.court-code h4 { font-family: "Cinzel", serif; margin: 0 0 .4rem; color: var(--blood); }
.court-code ol { margin: 0; padding-left: 1.2rem; }
.court-code li { margin: .25rem 0; }
.court-code-note { font-size: .85rem; font-style: italic; margin: .5rem 0 0; }
.court-lives { color: var(--blood); letter-spacing: .1em; }

.court-sentence { text-align: center; }
.court-transform { position: relative; width: 180px; height: 180px; margin: 0 auto 1rem; }
.court-transform img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.court-goblin-img { opacity: 0; }
.court-transform.play .court-judge-img { animation: poof-out 1.4s forwards; }
.court-transform.play .court-goblin-img { animation: poof-in 1.4s .9s forwards; }
@keyframes poof-out { 60% { transform: scale(1.2) rotate(20deg); filter: hue-rotate(90deg) brightness(1.6); opacity: 1; } 100% { transform: scale(0) rotate(360deg); opacity: 0; } }
@keyframes poof-in { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.invoice { max-width: 520px; margin: 0 auto; text-align: left; background: #fbf3dc; border: 1px solid #b89a5a; padding: 1rem 1.2rem; }
.invoice h4 { font-family: "Cinzel", serif; margin: 0 0 .4rem; color: var(--blood); text-align: center; }
.invoice-terms { font-size: .9rem; font-style: italic; }

.court-field {
  position: relative; height: 320px; max-width: 720px; margin: 0 auto; overflow: hidden;
  border: 6px solid #2a170c; border-radius: 4px;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55)), url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
  touch-action: manipulation;
}
.court-me { position: absolute; --w: 72px; left: 45%; top: 55%; transform: translate(-50%, -50%); transition: left .25s ease-out, top .25s ease-out; pointer-events: none; z-index: 1; }
.court-coin {
  position: absolute; width: 46px; height: 46px; padding: 0; border: none; background: none; cursor: pointer; z-index: 2;
  animation: coin-pop .25s ease-out, coin-fade 2.6s linear forwards;
}
.court-coin.big { width: 58px; height: 58px; }
.court-coin img { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); pointer-events: none; }
@keyframes coin-pop { from { transform: scale(0); } }
@keyframes coin-fade { 80% { opacity: 1; } 100% { opacity: 0; } }
.court-pop {
  position: absolute; z-index: 3; pointer-events: none; font-family: "Cinzel", serif; font-weight: 700; color: #ffe38a;
  text-shadow: 0 2px 3px #000; animation: squeak .9s ease-out forwards;
}
.court-statements { max-width: 720px; margin: .8rem auto 0; padding-left: 1.2rem; font-size: .9rem; }
.court-statements li:first-child { font-weight: bold; color: var(--blood); }
.court-reset { text-align: center; margin: .6rem 0 0; }
.court-reset button { background: none; border: none; color: #6b4a1f; text-decoration: underline; font: inherit; font-size: .8rem; cursor: pointer; }

@media (max-width: 760px) {
  .court-layout { grid-template-columns: 1fr; }
  .court-field { height: 260px; }
}

/* ============ Goblin Clash (card duel) ============ */
.clash {
  max-width: 820px; margin: 0 auto; padding: .8rem; border-radius: 6px;
  background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.6)), url("img/wood-planks-h.jpg") 0 0 / 256px 256px;
  border: 6px solid #2a170c; color: var(--text-light);
}
.clash-hero { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.clash-lord { justify-content: center; padding: .3rem .6rem; border-radius: 8px; border: 2px solid transparent; transition: box-shadow .2s, border-color .2s; }
.clash-lord.targetable { cursor: crosshair; border-color: #ff6b4a; box-shadow: 0 0 18px rgba(255,90,60,.7); }
.clash-lord-img { width: 96px; height: 96px; filter: drop-shadow(0 0 8px rgba(255,214,150,.45)) drop-shadow(0 4px 6px rgba(0,0,0,.7)); }
.clash-you-img { width: 56px; height: 56px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.clash-hero-info { display: flex; flex-direction: column; font-family: "Cinzel", serif; line-height: 1.25; }
.clash-hero-info b { color: var(--gold-light); font-size: 1.05rem; }
.clash-hp { color: #ff8a7a; font-weight: 700; font-size: 1.15rem; }
.clash-small { font-family: "IM Fell English", serif; font-size: .85rem; opacity: .85; }
.clash-you { justify-content: space-between; margin-top: .5rem; }
.clash-gold { display: flex; align-items: center; gap: .3rem; font-family: "Cinzel", serif; font-weight: 700; font-size: 1.2rem; color: var(--gold-light); }
.clash-gold img { width: 32px; height: 32px; }
.clash-board { display: flex; justify-content: center; gap: .5rem; min-height: 172px; padding: .5rem 0; flex-wrap: nowrap; }
.clash-board-lord { border-bottom: 1px dashed rgba(212,160,23,.35); }
.clash-divider { text-align: center; margin: .3rem 0; }
.clash-divider span { font-family: "Cinzel", serif; font-size: .85rem; background: rgba(0,0,0,.5); padding: .15rem .8rem; border-radius: 10px; color: var(--gold-light); }
.clash-empty { align-self: center; font-style: italic; opacity: .6; margin: 0; }
.clash-hand {
  display: flex; gap: .5rem; overflow-x: auto; padding: .7rem .2rem .3rem; margin-top: .5rem;
  border-top: 1px dashed rgba(212,160,23,.35); scroll-snap-type: x proximity;
}

.clash-card {
  position: relative; flex: 0 0 auto; width: 118px; height: 168px; border-radius: 8px; padding: 4px;
  background: linear-gradient(#f6e9c6, #d9c18a); color: var(--ink);
  border: 3px solid var(--cc, #6b4a1f); box-shadow: 0 4px 8px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  scroll-snap-align: start; user-select: none; transition: transform .15s, box-shadow .15s;
}
.clash-card.cls-peasant { --cc: #8a6a3a; } .clash-card.cls-rogue { --cc: #3a3a4a; } .clash-card.cls-archer { --cc: #2f6a2f; }
.clash-card.cls-knight { --cc: #6b7a8a; } .clash-card.cls-shaman { --cc: #2f6aa0; } .clash-card.cls-alchemist { --cc: #7a3a9a; }
.clash-card.cls-berserker { --cc: #a02a1a; }
.cc-cost {
  position: absolute; top: -8px; left: -8px; width: 28px; height: 28px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center; font-family: "Cinzel", serif; font-weight: 700; color: #3a2405;
  background: radial-gradient(circle at 35% 35%, #fff0a8, #e0b030 60%, #8a5f08); box-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.cc-art { width: 84px; height: 85px; object-fit: contain; margin-top: 2px; }
.cc-badge { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.cc-name { font-family: "Cinzel", serif; font-weight: 700; font-size: .66rem; line-height: 1.1; color: var(--blood); }
.cc-text { font-size: .62rem; line-height: 1.1; margin-top: 1px; flex: 1; }
.cc-stats { display: flex; justify-content: space-between; width: 100%; font-family: "Cinzel", serif; font-weight: 700; font-size: .85rem; }
.cc-atk { color: #5a3a10; } .cc-hp { color: var(--blood); }
.cc-hp.hurt b { color: #e01010; } .cc-atk.buffed b { color: #2f8a2f; }
.clash-card.minion .cc-text { display: none; }
.clash-card.minion .cc-art { width: 96px; height: 97px; }
.clash-card.taunt { box-shadow: 0 0 0 3px #c9d1d7, 0 4px 8px rgba(0,0,0,.5); border-radius: 18px 18px 8px 8px; }
.clash-card.playable { cursor: pointer; box-shadow: 0 0 0 2px #7ee07e, 0 0 14px rgba(126,224,126,.6); }
.clash-card.playable:hover, .clash-card.ready:hover { transform: translateY(-6px); }
.clash-card.unaffordable { filter: grayscale(.6) brightness(.8); }
.clash-card.ready { cursor: pointer; box-shadow: 0 0 0 2px #7ee07e, 0 0 12px rgba(126,224,126,.55); }
.clash-card.selected { transform: translateY(-10px); box-shadow: 0 0 0 3px #ffe38a, 0 0 18px rgba(255,227,138,.8); }
.clash-card.sleeping .cc-art { filter: grayscale(.5) brightness(.85); }
.clash-card.targetable { cursor: crosshair; box-shadow: 0 0 0 3px #ff6b4a, 0 0 16px rgba(255,90,60,.7); }
.clash-card.hit, .clash-lord.hit { animation: shake .35s; }

@media (max-width: 640px) {
  .clash { padding: .5rem; border-width: 4px; }
  .clash-board { gap: .25rem; min-height: 118px; }
  .clash-board .clash-card { width: 64px; height: 112px; padding: 2px; border-width: 2px; }
  .clash-board .clash-card.minion .cc-art { width: 52px; height: 53px; margin-top: 4px; }
  .clash-board .cc-badge { width: 18px; height: 18px; top: 2px; right: 2px; }
  .clash-board .cc-name { font-size: .5rem; }
  .clash-board .cc-stats { font-size: .7rem; }
  .clash-board .cc-cost { display: none; }
  .clash-lord-img { width: 70px; height: 70px; }
  .clash-hand .clash-card { width: 104px; height: 156px; }
}

/* ============ Lord Redmourne's Treasury banner ============ */
.treasury-banner {
  max-width: 900px; margin: 1.2rem auto 0; display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1rem; border-radius: 6px; color: var(--text-light);
  background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(60,30,10,.7), rgba(0,0,0,.55));
  border: 2px solid #8a6208; box-shadow: 0 6px 14px rgba(0,0,0,.5);
}
.treasury-lord { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 0 6px rgba(255,214,150,.45)); }
.treasury-label { display: block; font-family: "Cinzel", serif; font-weight: 700; color: var(--gold-light); }
.treasury-sub { display: block; font-size: .85rem; opacity: .8; }
.treasury-total { margin-left: auto; font-family: "Cinzel Decorative", serif; font-size: 1.6rem; color: var(--gold-light); white-space: nowrap; }
.treasury-total::after { content: " crowns"; font-family: "Cinzel", serif; font-size: .8rem; }
.treasury-total.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.25); color: #fff; } }

/* ============ Dungeon Delve ============ */
.delve-room { display: flex; align-items: center; gap: 1rem; max-width: 620px; margin: 0 auto; padding: 1rem; background: #fbf3dc; border: 2px solid #b89a5a; border-radius: 4px; transition: background .3s; }
.delve-room img { width: 96px; height: 96px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.delve-room h3 { margin: 0 0 .3rem; color: var(--blood); }
.delve-room p { margin: 0; }
.delve-room.good { background: #f3f7d8; border-color: #7a9a3a; }
.delve-room.bad { background: #f8dcd4; border-color: var(--blood); animation: shake .35s; }
.delve-path { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 620px; margin: .7rem auto 0; min-height: 34px; }
.delve-path img { width: 30px; height: 30px; object-fit: contain; padding: 2px; border-radius: 4px; background: rgba(0,0,0,.08); }
.delve-path img.good { background: rgba(122,154,58,.25); } .delve-path img.bad { background: rgba(139,26,26,.3); }
.danger-0 { color: #3a7a2a !important; } .danger-1 { color: #a07a10 !important; } .danger-2 { color: #c0501a !important; } .danger-3 { color: #b01010 !important; }

/* ============ Tax Collector ============ */
.tax-unrest { display: flex; align-items: center; gap: .6rem; max-width: 620px; margin: 0 auto .8rem; font-family: "Cinzel", serif; font-size: .85rem; }
.tax-bar { flex: 1; height: 14px; background: rgba(0,0,0,.15); border: 1px solid #8a6a32; border-radius: 7px; overflow: hidden; }
.tax-fill { height: 100%; width: 0; background: linear-gradient(90deg, #7a9a3a, #c9a020); transition: width .4s; }
.tax-fill.warm { background: linear-gradient(90deg, #c9a020, #d06a1a); }
.tax-fill.hot { background: linear-gradient(90deg, #d06a1a, #b01010); }
.tax-door { display: flex; align-items: center; gap: 1rem; max-width: 620px; margin: 0 auto; padding: 1rem; background: #fbf3dc; border: 2px solid #b89a5a; border-radius: 4px; }
.tax-door img { width: 90px; height: 90px; object-fit: contain; flex: none; }
.tax-door h3 { margin: 0 0 .3rem; color: var(--blood); }
.tax-door p { margin: 0; font-style: italic; }
.tax-door.paid { opacity: .7; }
.tax-door.riot { background: #f8dcd4; border-color: var(--blood); animation: shake .35s; }
.tax-actions .btn { line-height: 1.15; min-width: 100px; }
.tax-actions small { font-family: "IM Fell English", serif; font-weight: normal; }

/* ============ Coin Inspector ============ */
.coins-table { max-width: 520px; margin: 0 auto; padding: 1rem; text-align: center; border-radius: 6px; border: 4px solid #2a170c;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.5)), url("img/wood-planks-h.jpg") 0 0 / 256px 256px; }
.coins-track { height: 8px; background: rgba(0,0,0,.4); border-radius: 4px; overflow: hidden; margin-bottom: .8rem; }
.coins-timer { height: 100%; width: 100%; background: linear-gradient(90deg, #c9a020, #ffe38a); }
.coins-coin { width: 150px; height: 150px; padding: 0; border: none; background: none; cursor: default; }
.coins-coin img { width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(0,0,0,.6)); }
.coins-coin.rolling { animation: roll-in .3s ease-out; }
@keyframes roll-in { from { transform: translateX(-120px) rotate(-200deg); opacity: 0; } }
.coins-coin.wrong { animation: shake .35s; }
.c-lead, .coins-coin.c-lead img { filter: grayscale(1) brightness(.85) contrast(1.1) drop-shadow(0 6px 6px rgba(0,0,0,.6)) !important; }
.c-pale, .coins-coin.c-pale img { filter: saturate(.35) brightness(1.2) drop-shadow(0 6px 6px rgba(0,0,0,.6)) !important; }
.c-bitten, .coins-coin.c-bitten img { clip-path: polygon(0 0, 62% 0, 66% 8%, 74% 6%, 78% 16%, 88% 16%, 90% 26%, 100% 30%, 100% 100%, 0 100%); }
.c-cursed, .coins-coin.c-cursed img { filter: hue-rotate(230deg) saturate(1.6) drop-shadow(0 0 10px #b04ad9) !important; }
.coins-legend { color: var(--text-light); font-size: .85rem; margin: .6rem 0 0; }
.coins-legend .cl { width: 26px; height: 26px; vertical-align: middle; }
.coins-accept { background: linear-gradient(#5f8a2e, #3a5a18); border-color: #1f3308; box-shadow: 0 4px 0 #1f3308; min-width: 130px; }
.coins-reject { min-width: 130px; }

/* ============ Treasury Empire ============ */
.empire-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
.empire-left { text-align: center; }
.empire-chest { position: relative; width: 170px; height: 170px; padding: 0; border: none; background: none; cursor: pointer; touch-action: manipulation; }
.empire-chest img { width: 100%; height: 100%; filter: drop-shadow(0 0 16px rgba(255,200,60,.5)) drop-shadow(0 6px 6px rgba(0,0,0,.5)); }
.empire-chest.pop img { animation: chest-pop .18s; }
@keyframes chest-pop { 50% { transform: scale(.92); } }
.empire-float { position: absolute; pointer-events: none; font-family: "Cinzel", serif; font-weight: 700; color: #8a5f08; animation: squeak .8s ease-out forwards; }
.empire-note { font-size: .85rem; font-style: italic; margin: .5rem 0 0; }
.empire-shop { display: grid; gap: .4rem; }
.empire-h { font-family: "Cinzel", serif; margin: .5rem 0 0; color: var(--blood); }
.empire-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .4rem .6rem; cursor: pointer;
  background: #fbf3dc; border: 2px solid #b89a5a; border-radius: 4px; font: inherit; color: var(--ink); }
.empire-item:not(:disabled):hover { border-color: #8a5f08; background: #fff6dc; }
.empire-item:disabled { opacity: .55; cursor: default; }
.empire-item img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.ei-main { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.ei-name { font-family: "Cinzel", serif; font-size: .9rem; }
.ei-text { font-size: .8rem; opacity: .85; }
.ei-side { display: flex; flex-direction: column; align-items: flex-end; font-family: "Cinzel", serif; font-weight: 700; }
.ei-cost { color: #8a5f08; }
.ei-cost::before { content: "● "; color: #e0b030; }
.ei-own { font-size: .8rem; opacity: .7; }
.empire-item.upgrade { border-style: dashed; }

@media (max-width: 640px) {
  .treasury-banner { flex-wrap: wrap; }
  .treasury-sub { display: none; }
  .treasury-total { font-size: 1.25rem; }
  .delve-room, .tax-door { flex-direction: column; text-align: center; }
  .empire-layout { grid-template-columns: 1fr; }
  .coins-coin { width: 120px; height: 120px; }
}
