@charset "UTF-8";
/* ===============================================================
   VALORION -- THE CHRONICLES BEGIN
   style.css -- Layout v3: 3-col grid, map left, chat dominant
=============================================================== */


/* -- Reset & Base ----------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --gold:           #E8C96A;
  --gold-bright:    #E8C96A;
  --gold-deep:      #8B6B2E;
  --gold-dim:       rgba(232,201,106,0.3);
  --parchment:      #F0E6C8;
  --parchment-dim:  #E8C96A;
  --ink:            #0a0805;
  --ink-mid:        #1a1209;
  --ink-panel:      #110e06;
  --border:         rgba(232,201,106,0.2);
  --border-mid:     rgba(232,201,106,0.35);
  --border-bright:  rgba(232,201,106,0.55);
  --font-display:   'Cinzel Decorative', serif;
  --font-title:     'Cinzel', serif;
  --font-body:      'EB Garamond', serif;
  /* Column widths -- left=map/chat, mid=char/nav, right=town panels */
  --col-left:  58%;
  --col-mid:   22%;
  --col-right: 20%;
  /* Row heights */
  --row-top:    55%;
  --row-bottom: 45%;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0805;
  color: var(--parchment);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}


/* ==============================================================
   SCREEN SYSTEM
============================================================== */

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  z-index: 1;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

.global-fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 1.2s ease;
}
.global-fade.active {
  opacity: 1;
  pointer-events: all;
}


/* ==============================================================
   LANDING SCREEN
============================================================== */

.landing-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/landingpage/landingpage.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: bg-breathe 20s ease-in-out infinite alternate;
}
@keyframes bg-breathe {
  0%   { transform: scale(1.04) translateY(0px); }
  100% { transform: scale(1.08) translateY(-8px); }
}

.landing-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 20%, rgba(0,0,0,0.45) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 25%, rgba(0,0,0,0.20) 55%, rgba(0,0,0,0.82) 100%);
}

.dust-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

.landing-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: calc(7vh + var(--safe-bottom));
  animation: content-rise 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
@keyframes content-rise {
  0%   { opacity: 0; transform: translateY(30px); }
  40%  { opacity: 0; }
  100% { opacity: 1; transform: translateY(0px); }
}

.crest-ornament {
  width: min(300px, 70vw);
  margin-bottom: 1.2vh;
  opacity: 0;
  animation: fade-in-slow 2s ease forwards 1.2s;
}
.crest-ornament.bottom-crest {
  margin-top: 1.2vh;
  margin-bottom: 3.5vh;
}
@keyframes fade-in-slow { to { opacity: 1; } }

.landing-eyebrow {
  font-family: var(--font-title);
  font-size: clamp(0.7rem, 1.6vw, 1rem);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fade-in-slow 1.8s ease forwards 1.5s;
  margin-bottom: 1.2vh;
}

.landing-title { text-align: center; line-height: 1; }

.title-valorion {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow:
    0 0 60px rgba(232,201,106,0.55),
    0 0 120px rgba(232,201,106,0.25),
    0 4px 30px rgba(0,0,0,0.9),
    0 2px 4px rgba(0,0,0,1);
  opacity: 0;
  animation: title-emerge 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.6s;
}
@keyframes title-emerge {
  0%   { opacity: 0; letter-spacing: 0.25em; filter: blur(12px); }
  60%  { filter: blur(0px); }
  100% { opacity: 1; letter-spacing: 0.08em; }
}

.landing-tagline {
  font-family: var(--font-title);
  font-size: clamp(0.65rem, 1.4vw, 0.9rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  opacity: 0;
  animation: fade-in-slow 2s ease forwards 1.8s;
}

.landing-buttons {
  display: flex;
  gap: 20px;
  align-items: center;
  opacity: 0;
  animation: fade-in-slow 1.8s ease forwards 2s;
}

.btn-chronicle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: clamp(0.65rem, 1.2vw, 0.82rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(10,8,5,0.7);
  border: 1px solid rgba(232,201,106,0.4);
  padding: clamp(11px,1.6vh,18px) clamp(20px,3vw,40px);
  cursor: pointer;
  transition: all 0.35s ease;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.btn-chronicle:hover {
  background: rgba(232,201,106,0.12);
  border-color: rgba(232,201,106,0.75);
  color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(232,201,106,0.22);
}
.btn-new      { border-color: rgba(232,201,106,0.85); }
.btn-continue { border-color: rgba(232,201,106,0.25); color: rgba(232,201,106,0.85); }
.btn-icon     { font-size: 0.9em; opacity: 0.7; }

.landing-version {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
  opacity: 0;
  animation: fade-in-slow 2s ease forwards 2.4s;
  margin-top: 2.4vh;
}
.landing-copyright {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(232,201,106,0.45);
  text-transform: uppercase;
  opacity: 0;
  animation: fade-in-slow 2s ease forwards 2.6s;
  margin-top: 0.6vh;
}


/* ==============================================================
   CINEMATIC SCREEN
============================================================== */

.cinematic-video { width: 100%; height: 100%; object-fit: cover; }

.cinematic-skip {
  position: absolute;
  top: 22px; right: 22px;
  background: rgba(10,8,5,0.6);
  border: 1px solid rgba(232,201,106,0.3);
  color: rgba(232,201,106,0.85);
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
}
.cinematic-skip:hover { background: rgba(232,201,106,0.1); color: var(--gold-bright); }

.cinematic-fade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
}
.cinematic-fade.active { opacity: 1; }


/* ==============================================================
   GAME SHELL -- 3-column x 2-row CSS Grid
   +--------------+---------+------------------+  55%
   |  panel-map   | panel-  |  panel-town      |
   |              | char    |  (overview+mini) |
   +--------------+---------+------------------+  45%
   |  panel-chat  | panel-  |  panel-location  |
   |              | nav     |                  |
   +--------------+---------+------------------+
   38%             22%        40%
============================================================== */

#game-shell {
  display: grid;
  grid-template-columns: var(--col-left) var(--col-mid) var(--col-right);
  grid-template-rows: var(--row-top) var(--row-bottom);
  width: 100%;
  height: 100%;
  background: var(--ink);
  overflow: hidden;
}

/* ── Ambient day/night lighting — chips and input only ── */
.chat-suggestions {
  transition: background 4s ease;
}
.chat-input {
  transition: border-color 0.2s ease, background 4s ease;
}

/* ── Time display in input row ── */
.chat-time-display {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-family: var(--font-title);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  color: rgba(232,201,106,0.75);
  white-space: nowrap;
  padding: 0 4px;
  transition: color 4s ease;
  text-transform: uppercase;
}
#chat-time-icon {
  font-size: 1rem;
  line-height: 1;
  transition: opacity 4s ease;
}

/* -- [row1 col1] MAP -- now a modal overlay; hidden from grid */
#panel-map {
  display: none;
}

/* -- [row1 col2] CHARACTER -- */
#panel-character {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  background: var(--ink-panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 10px 6px;
  gap: 8px;
  overflow: hidden;
}

/* -- [row1 col3] TOWN PANELS (overview + minimap stacked) -- */
#panel-town {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  background: var(--ink-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel-town-overview {
  flex: 0 0 55%;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

#panel-town-minimap {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* panel-location removed -- info now in town overview */
#panel-location { display: none; }

/* -- [col1 full height] CHAT -- spans both rows now map is a modal */
#panel-chat {
  grid-column: 1 / 2;
  grid-row: 1 / -1;
  background: var(--ink);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* -- [row2 col2] NAV BUTTONS -- */
#panel-nav {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  background: var(--ink-panel);
  border-right: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  padding: 5px;
  overflow: hidden;
}

/* -- [row2 col3] LOCATION INFO -- */
#panel-location {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  background: var(--ink-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


/* ==============================================================
   MAP PANEL -- cover fit, edge to edge
============================================================== */

#map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#map-canvas:active { cursor: grabbing; }

#map-zoom-controls {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 5;
}

.zoom-btn {
  width: 34px; height: 34px;
  background: rgba(10,8,5,0.75);
  border: 1px solid var(--border-mid);
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
}
.zoom-btn:hover { background: rgba(232,201,106,0.15); color: var(--gold-bright); }

#map-zoom-label {
  position: absolute;
  bottom: 10px; left: 12px;
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
}


/* ==============================================================
   CHARACTER PANEL
============================================================== */

.char-portrait-wrap {
  position: relative;
  width: 100%;
  /* Height fills available space minus status line */
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-mid);
  overflow: hidden;
  background: #1a1208;
  box-shadow: 0 0 24px rgba(232,201,106,0.1);
}
/* ── Multi-NPC portrait grid ── */
.portrait-multi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  gap: 2px;
  background: #0a0805;
}
.portrait-quad {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #1a1208;
  transition: opacity 0.15s ease;
}
.portrait-quad:hover { opacity: 0.85; }
.portrait-quad--active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(232,201,106,0.7);
  pointer-events: none;
}
.portrait-quad--loc { cursor: default; }
.portrait-quad--loc:hover { opacity: 1; }
.portrait-quad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.portrait-quad-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
  padding: 10px 4px 4px;
  font-family: var(--font-title);
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
}
.portrait-quad-label--dim { color: rgba(232,201,106,0.4); }


/* ── Portrait loading placeholder ── */
.char-portrait-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1e1508, #0a0805);
  z-index: 2;
}
.char-portrait-placeholder.visible { display: flex; }

.placeholder-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(232,201,106,0.06) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.placeholder-silhouette {
  width: 55%;
  max-width: 140px;
  color: rgba(232,201,106,0.08);
  animation: silhouette-pulse 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes silhouette-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.03); }
}

.placeholder-label {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.3);
  margin-top: 14px;
  animation: silhouette-pulse 3s ease-in-out infinite;
}

.char-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.char-portrait-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #2a1e10, #0e0a06);
}

.char-name-plate {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.92));
  padding: 16px 8px 7px;
  font-family: var(--font-title);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
}

.char-status {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-style: italic;
  text-align: center;
  padding: 0 4px 4px;
  line-height: 1.3;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.condition-physical {
  color: rgba(240,230,200,0.55);
  font-size: 0.72rem;
}

.condition-magical {
  color: rgba(180,140,255,0.55);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}


/* ==============================================================
   NAV BUTTONS -- gold tiles, icon + label, 2-col grid
============================================================== */

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.16);
  color: rgba(232,201,106,0.85);
  cursor: pointer;
  padding: 5px 3px;
  margin: 2px;
  transition: all 0.2s ease;
  min-height: 0;
  min-width: 0;
}
.nav-btn:hover {
  background: rgba(232,201,106,0.12);
  border-color: rgba(232,201,106,0.45);
  color: var(--gold-bright);
}
.nav-btn.active {
  background: rgba(232,201,106,0.14);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: inset 0 0 10px rgba(232,201,106,0.07);
}

.nav-icon { font-size: 1.45rem; line-height: 1; }

.nav-label {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  text-align: center;
  line-height: 1.2;
}


/* ==============================================================
   TOWN PANELS -- shared header + content styles
============================================================== */

.loc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0,0,0,0.18);
}

.loc-header-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(232,201,106,0.4);
  flex-shrink: 0;
}

.loc-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,201,106,0.2) transparent;
}
.loc-content::-webkit-scrollbar { width: 3px; }
.loc-content::-webkit-scrollbar-thumb { background: rgba(232,201,106,0.2); border-radius: 2px; }

.loc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.loc-placeholder-icon { font-size: 1.4rem; opacity: 0.2; }
.loc-placeholder-text {
  font-family: var(--font-title);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
}

/* Location info panel */
.loc-info-inner {
  padding: 7px 10px;
  width: 100%;
  align-self: flex-start;
  overflow-y: auto;
  max-height: 100%;
}

.loc-info-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(232,201,106,0.06);
  align-items: baseline;
}
.loc-info-label {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
  flex-shrink: 0;
  min-width: 58px;
}
.loc-info-value {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--parchment-dim);
  font-style: italic;
}

.loc-info-section-title {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  margin: 6px 0 4px;
}

.loc-npc-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.npc-chip {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: rgba(232,201,106,0.85);
  background: rgba(232,201,106,0.06);
  border: 1px solid rgba(232,201,106,0.15);
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.npc-chip:hover { background: rgba(232,201,106,0.14); color: var(--gold-bright); }


/* ==============================================================
   CHAT PANEL
============================================================== */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 5px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}
.chat-header-left  { display: flex; align-items: center; gap: 6px; }
.chat-header-right { display: flex; align-items: center; gap: 10px; }

.chat-header-title {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
}

.chat-date {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(232,201,106,0.85);
}

.copy-history-btn {
  background: none;
  border: 1px solid rgba(232,201,106,0.2);
  color: rgba(232,201,106,0.85);
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  height: 24px;
  padding: 0 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.copy-history-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(232,201,106,0.06);
}

.sync-btn {
  background: none;
  border: 1px solid rgba(232,201,106,0.2);
  color: rgba(232,201,106,0.85);
  font-size: 0.9rem;
  width: 24px; height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}
.sync-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.sync-btn.syncing { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,201,106,0.15) transparent;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(232,201,106,0.15); border-radius: 2px; }

/* Chronicle text -- reduced 2pt from previous, more fits */
.chat-msg {
  font-family: var(--font-body);
  font-size: clamp(0.80rem, 1.3vw, 0.96rem);
  line-height: 1.72;
  color: var(--parchment);
}
.chat-msg.narrator { color: var(--parchment); }
.chat-msg.player {
  color: rgba(240,230,200,0.65);
  font-style: italic;
  padding-left: 12px;
  border-left: 2px solid rgba(232,201,106,0.25);
}
.chat-msg.system {
  font-family: var(--font-title);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: rgba(232,201,106,0.85);
  text-align: center;
  text-transform: uppercase;
  padding: 2px 0;
}
.chat-msg.thinking {
  color: rgba(232,201,106,0.85);
  font-style: italic;
  font-size: 0.84rem;
}

.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 5px; height: 5px;
  background: rgba(232,201,106,0.4);
  border-radius: 50%;
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1;   }
}

/* Suggestion chips -- 6 in 3x2 grid, gold */
.chat-suggestions {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chip-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.chip-row:last-child { border-bottom: none; }

.suggestion-chip {
  font-family: var(--font-title);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: none;
  border-right: 1px solid var(--border);
  background: rgba(232,201,106,0.05);
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}
.suggestion-chip:last-child { border-right: none; }
.suggestion-chip:hover { background: rgba(232,201,106,0.13); color: var(--gold-bright); }

/* Action row chips — slightly smaller text */
.chip-row--actions .suggestion-chip { font-size: 0.58rem; padding: 5px 4px; }

/* All three action chips share the gold travel style */
.travel-chip {
  background: rgba(232,201,106,0.1) !important;
  color: var(--gold-bright) !important;
  border-color: rgba(232,201,106,0.3) !important;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.travel-chip:hover:not(.speak-chip--disabled) {
  background: rgba(232,201,106,0.2) !important;
  border-color: var(--gold) !important;
}

/* Disabled state — same for Visit and Speak when unavailable */
.speak-chip--disabled {
  color: rgba(201,168,76,0.28) !important;
  background: rgba(232,201,106,0.03) !important;
  border-color: rgba(232,201,106,0.1) !important;
  cursor: default !important;
}

/* Save & Sign Out — soft red to stand out */
.save-chip {
  background: rgba(180,100,100,0.1) !important;
  color: rgba(232,150,150,0.75) !important;
  border-color: rgba(180,100,100,0.25) !important;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.save-chip:hover {
  background: rgba(180,100,100,0.2) !important;
  border-color: rgba(232,150,150,0.5) !important;
  color: rgba(232,150,150,1) !important;
}

.castle-locked {
  opacity: 0.35 !important;
  cursor: default !important;
  pointer-events: none;
}
.castle-locked .nav-icon { filter: grayscale(1); }

.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 6px 10px calc(6px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.18);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}
.chat-input:focus { border-color: rgba(232,201,106,0.45); }
.chat-input::placeholder { color: rgba(232,201,106,0.22); font-style: italic; }

.chat-send {
  background: rgba(232,201,106,0.08);
  border: 1px solid rgba(232,201,106,0.25);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-send:hover { background: rgba(232,201,106,0.18); color: var(--gold-bright); }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; }


/* ==============================================================
   OVERLAY -- slides over left column (MAP + CHAT)
   Width = col-left + col-mid = 52% + 22% = 74%
   Positioned left:0, full height
============================================================== */

.overlay-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: calc(var(--col-left) + var(--col-mid));  /* 74% -- covers map+chat columns */
  bottom: 0;
  background: var(--ink-mid);
  border-right: 1px solid var(--border-bright);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.32s ease;
}

.overlay-panel.hidden {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-mid);
  background: var(--ink-panel);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.overlay-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
}
.overlay-close {
  background: none;
  border: 1px solid rgba(232,201,106,0.3);
  color: rgba(232,201,106,0.85);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.overlay-close:hover { color: var(--gold-bright); border-color: var(--gold); }

.overlay-content {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  /* Allow children (like inventory grid) to fill full height */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Inventory grid gets full height of content area */
.overlay-content > div {
  flex: 1;
  min-height: 0;
}
.overlay-placeholder {
  font-family: var(--font-body);
  font-style: italic;
  color: rgba(232,201,106,0.85);
  text-align: center;
  margin-top: 40px;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}


/* ==============================================================
   MAP OVERLAY — fills overlay-content edge to edge
============================================================== */

.map-overlay-wrap {
  position: absolute;
  inset: 0;
  background: #1a3a52;
  overflow: hidden;
  z-index: 1;
}

.map-overlay-wrap #map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  display: block;
}

.map-overlay-wrap #map-zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 5;
}

.map-overlay-wrap #map-zoom-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
}

/* When map overlay is open, remove overlay-content padding */
.overlay-content.map-active {
  padding: 0;
  position: relative;
}


/* ==============================================================
   CHRONICLE — SEARCH + STAR (Task 11)
============================================================== */

.chronicle-search-input {
  width: 100%;
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.18);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.chronicle-search-input:focus {
  border-color: rgba(232,201,106,0.45);
}
.chronicle-search-input::placeholder {
  color: rgba(232,201,106,0.85);
  font-style: italic;
}

.chronicle-star-btn:hover {
  color: rgba(232,201,106,0.85) !important;
}


/* ==============================================================
   SYNC TOAST
============================================================== */

.sync-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,8,5,0.92);
  border: 1px solid var(--border-mid);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 24px;
  z-index: 100;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.sync-toast.hidden { opacity: 0; pointer-events: none; }
.sync-toast.error  { color: #e07070; border-color: rgba(224,112,112,0.4); }


/* ==============================================================
   IDLE PROMPT
============================================================== */

.idle-prompt {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.idle-prompt.hidden { opacity: 0; pointer-events: none; }

.idle-prompt-inner {
  background: var(--ink-mid);
  border: 1px solid var(--border-mid);
  padding: 28px 36px;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}
.idle-prompt-msg {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--parchment);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 18px;
}
.idle-prompt-btns { display: flex; gap: 12px; justify-content: center; }

.idle-btn {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}
.idle-btn-save    { background: rgba(232,201,106,0.12); border-color: var(--gold); color: var(--gold-bright); }
.idle-btn-save:hover { background: rgba(232,201,106,0.22); }
.idle-btn-dismiss { background: transparent; border-color: rgba(232,201,106,0.25); color: rgba(232,201,106,0.5); }
.idle-btn-dismiss:hover { border-color: rgba(232,201,106,0.5); color: rgba(232,201,106,0.8); }


/* Month ribbon — gold accounts updated notice in chat */
.chat-msg.month-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(232,201,106,0.07);
  border: 1px solid rgba(232,201,106,0.25);
  border-left: 3px solid rgba(232,201,106,0.7);
  padding: 7px 12px;
  font-family: var(--font-title);
  font-size: 0.57rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
}
.month-ribbon-icon {
  flex-shrink: 0;
  color: var(--gold-bright);
  font-size: 0.7rem;
}
.month-ribbon-text {
  flex: 1;
}



@media (max-width: 600px) {

  .landing-buttons { flex-direction: column; gap: 14px; }
  .btn-chronicle   { width: 72vw; justify-content: center; }

  #game-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  #panel-map       { display: none; }
  #panel-character { display: none; }
  #panel-town      { display: none; }
  #panel-nav       { display: none; }

  #panel-chat {
    grid-column: 1;
    grid-row: 1;
  }

  #panel-location {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid var(--border);
    max-height: 120px;
  }

  .overlay-panel {
    width: 100%;
    border-right: none;
  }
  .overlay-panel.hidden { transform: translateX(-100%); }
}


/* ==============================================================
   TOWN OVERVIEW CARD STYLES (M9)
============================================================== */

.minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

#loc-map-content {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 200px;
  min-height: 160px;
  flex-shrink: 0;
  position: relative;
}

.town-overview-inner {
  padding: 6px 8px;
  width: 100%;
  align-self: flex-start;
  overflow-y: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.town-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.town-name-main {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}
.town-size-badge {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  border: 1px solid rgba(232,201,106,0.25);
  padding: 2px 5px;
  flex-shrink: 0;
}

.town-state-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(232,201,106,0.1);
}
.town-state-swatch {
  width: 9px; height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.85;
}
.town-state-name {
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
}
.town-capital-star {
  font-size: 0.65rem;
  color: var(--gold);
  opacity: 0.8;
  margin-left: 2px;
}

.town-stat-grid { display: flex; flex-direction: column; gap: 2px; }
.town-stat      { display: flex; gap: 7px; align-items: baseline; }
.town-stat-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(232,201,106,0.85);
  text-transform: uppercase;
  flex-shrink: 0;
  min-width: 72px;
}
.town-stat-value {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--parchment-dim);
  font-style: italic;
}

.town-features { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.town-feature-tag {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  background: rgba(232,201,106,0.08);
  border: 1px solid rgba(232,201,106,0.18);
  padding: 2px 6px;
}

.town-type-row {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: rgba(232,201,106,0.85);
  font-style: italic;
  margin-top: 1px;
}

/* ── TRAVEL STAMP ─────────────────────────────────────────── */
.chat-msg.travel { padding: 0; margin: 4px 0 0; }
.travel-stamp {
  display: block;
  padding: 5px 10px 5px 12px;
  border-left: 2px solid var(--gold-deep);
  background: rgba(232,201,106,0.05);
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: rgba(240,230,200,0.5);
}
.travel-verb     { color: rgba(232,201,106,0.4); }
.travel-from     { color: rgba(232,201,106,0.6); font-weight: 600; }
.travel-to       { color: var(--gold-bright); font-weight: 700; }
.travel-duration { color: rgba(232,201,106,0.85); }
.travel-date     { color: rgba(240,230,200,0.45); }
.travel-weather  { color: rgba(240,230,200,0.45); }
.travel-sep      { color: rgba(232,201,106,0.3); }
.travel-arrow    { color: var(--gold-deep); margin: 0 2px; }

/* ── TOWN OVERVIEW EXPANDED SECTIONS ─────────────────────── */
.town-section-divider {
  height: 1px;
  background: rgba(232,201,106,0.15);
  margin: 10px 0 6px;
}
.town-section-title {
  font-family: var(--font-title);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  padding: 4px 0 3px;
  border-bottom: 1px solid rgba(232,201,106,0.1);
  margin-bottom: 5px;
}
.town-detail-text {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(240,230,200,0.45);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 8px;
  padding: 0 2px;
}
.town-detail-text.discovered {
  color: rgba(240,230,200,0.82);
  font-style: normal;
}
/* Bullet list styling inside town overview sections */
.town-detail-text ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.town-detail-text li {
  padding: 2px 0 2px 12px;
  position: relative;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(240,230,200,0.88);
  border-bottom: 1px solid rgba(232,201,106,0.05);
}
.town-detail-text li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: rgba(232,201,106,0.85);
  font-size: 0.65rem;
}
.npc-chip-empty {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(232,201,106,0.85);
  font-style: italic;
}


.npc-chip-empty {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(232,201,106,0.85);
  font-style: italic;
}

/* ── Town stat grid (Task 25 rich overview) ── */
.town-stat-grid { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.town-stat      { display: flex; gap: 7px; align-items: baseline; }
.town-stat-label {
  font-family: var(--font-title); font-size: 0.65rem;
  letter-spacing: 0.1em; color: rgba(232,201,106,0.85);
  text-transform: uppercase; flex-shrink: 0; min-width: 80px;
}
.town-stat-value {
  font-family: var(--font-body); font-size: 0.88rem;
  color: rgba(240,230,200,0.75); font-style: italic;
}

/* Town feature tags */
.town-features { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.town-feature-tag {
  font-family: var(--font-title); font-size: 0.52rem;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  background: rgba(232,201,106,0.08);
  border: 1px solid rgba(232,201,106,0.18); padding: 2px 6px;
}
.town-feature-tag.gold   { border-color: rgba(232,201,106,0.45); color: var(--gold-bright); }
.town-feature-tag.silver { border-color: rgba(170,200,220,0.35); color: #8ab4cc; }
.town-feature-tag.bronze { border-color: rgba(160,120,60,0.3);   color: #9a7848; }

/* Town section dividers */
.town-section-divider { height: 1px; background: rgba(232,201,106,0.15); margin: 4px 0 3px; }
.town-section-title {
  font-family: var(--font-title); font-size: 0.65rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(232,201,106,0.85);
  padding: 4px 0 3px;
  border-bottom: 1px solid rgba(232,201,106,0.1);
  margin-bottom: 5px;
}

/* ── Map container (Map Task B) ── */
.map-container {
  flex: 1; position: relative; overflow: hidden;
  cursor: grab; min-height: 0;
}
.map-container:active { cursor: grabbing; }
#townMapCanvas { position: absolute; top:0; left:0; width:100%; height:100%; display:block; }

/* Map controls bar */
.map-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.ctrl-group { display: flex; gap: 3px; }
.ctrl-btn {
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(232,201,106,0.2);
  color: rgba(232,201,106,0.5);
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ctrl-btn:hover { border-color: rgba(232,201,106,0.5); color: var(--gold); }
.ctrl-hint {
  font-family: var(--font-title); font-size: 0.5rem;
  letter-spacing: .1em; color: rgba(232,201,106,0.2); text-transform: uppercase;
}

/* Legend button */
#legendBtn {
  position: absolute; top: 6px; right: 6px; z-index: 40;
  width: 22px; height: 22px;
  background: rgba(10,8,5,0.75);
  border: 1px solid rgba(232,201,106,0.25);
  border-radius: 3px;
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s; line-height: 1;
}
#legendBtn:hover { border-color: rgba(232,201,106,0.55); }
#legendBtn.open  { border-color: var(--gold); background: rgba(17,14,6,0.95); }

/* Legend panel */
#mapLegend {
  position: absolute; top: 33px; right: 6px; z-index: 40;
  background: rgba(10,8,5,0.92);
  border: 1px solid rgba(232,201,106,0.25);
  padding: 7px 9px 8px;
  display: none; flex-direction: column; gap: 3px; min-width: 140px;
}
#mapLegend.open { display: flex; }
.legend-title {
  font-family: var(--font-title); font-size: 0.52rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(232,201,106,0.7);
  border-bottom: 1px solid rgba(232,201,106,0.15);
  padding-bottom: 4px; margin-bottom: 2px;
}
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 1px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.12); }
.legend-label { font-family: var(--font-body); font-size: 0.68rem; color: rgba(240,230,200,0.7); line-height: 1; }

/* ── Tooltip ── */
.town-map-tooltip {
  position: fixed; background: #110e06;
  border: 1px solid rgba(232,201,106,0.3);
  padding: 4px 8px;
  font-family: var(--font-title); font-size: 0.6rem; color: var(--gold);
  pointer-events: none; z-index: 600; display: none;
  max-width: 160px; line-height: 1.4; letter-spacing: .04em;
}
.town-map-tooltip .tt-sub {
  font-family: var(--font-body); font-style: italic;
  font-size: 0.68rem; color: rgba(232,201,106,0.5); margin-top: 1px;
}

/* ── Building detail panel (slides up inside map area) ── */
#detailPanel {
  position: absolute; bottom:0; left:0; right:0;
  background: #110e06;
  border-top: 1px solid rgba(232,201,106,0.3);
  transform: translateY(100%);
  transition: transform .25s ease;
  z-index: 50; max-height: 90%;
  display: flex; flex-direction: column;
}
#detailPanel.open { transform: translateY(0); }
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(232,201,106,0.15); flex-shrink: 0;
}
.detail-name { font-family: var(--font-title); font-size: 0.78rem; font-weight: 600; color: var(--gold); line-height: 1.2; }
.detail-type { font-family: var(--font-body); font-style: italic; font-size: 0.72rem; color: rgba(232,201,106,0.5); margin-top: 2px; }
.detail-close {
  background: none; border: 1px solid rgba(232,201,106,0.2);
  color: rgba(232,201,106,0.4); width: 18px; height: 18px;
  cursor: pointer; font-size: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.detail-close:hover { color: var(--gold); border-color: var(--gold); }
.detail-body {
  padding: 6px 10px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: rgba(232,201,106,0.15) transparent;
}
.detail-body::-webkit-scrollbar { width: 3px; }
.detail-body::-webkit-scrollbar-thumb { background: rgba(232,201,106,0.15); }
.detail-hours { font-family: var(--font-body); font-size: 0.72rem; color: rgba(232,201,106,0.5); margin-bottom: 5px; }
.detail-section-title {
  font-family: var(--font-title); font-size: 0.52rem; font-weight: 600;
  letter-spacing: .12em; color: rgba(232,201,106,0.7); text-transform: uppercase;
  margin: 6px 0 3px; border-bottom: 1px solid rgba(232,201,106,0.1); padding-bottom: 2px;
}
.detail-person { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; border-bottom: 1px dotted rgba(232,201,106,0.07); }
.detail-person-name { font-family: var(--font-body); font-size: 0.78rem; color: var(--parchment); }
.detail-person-role { font-family: var(--font-body); font-style: italic; font-size: 0.68rem; color: rgba(232,201,106,0.4); }
.detail-note { font-family: var(--font-body); font-style: italic; font-size: 0.72rem; color: rgba(232,201,106,0.45); margin-bottom: 5px; padding: 3px 7px; border-left: 2px solid rgba(139,107,46,0.4); }
.detail-menu-item { display:flex; justify-content:space-between; font-family: var(--font-body); font-size: 0.74rem; color: rgba(240,230,200,0.6); padding: 1px 0; }
.detail-menu-price { font-family: var(--font-title); font-size: 0.55rem; color: rgba(232,201,106,0.7); flex-shrink:0; }


/* ===============================================================
   CASTLE PANEL — Task 27
=============================================================== */

.castle-panel-inner {
  padding: 2px 0 16px;
}

.castle-section {
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(232,201,106,0.08);
}
.castle-section-title {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.65);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(232,201,106,0.1);
}
.castle-empty {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(240,230,200,0.35);
  font-style: italic;
}

/* Progress bar */
.castle-progress-wrap {
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(232,201,106,0.08);
}
.castle-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.castle-progress-label {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.65);
}
.castle-progress-pct {
  font-family: var(--font-title);
  font-size: 0.68rem;
  color: var(--gold-bright);
}
.castle-progress-track {
  height: 6px;
  background: rgba(232,201,106,0.08);
  border: 1px solid rgba(232,201,106,0.18);
}
.castle-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(232,201,106,0.45), var(--gold-bright));
  transition: width 0.5s ease;
}
.castle-progress-done {
  font-family: var(--font-title);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(100,220,120,0.8);
  margin-top: 4px;
}

/* Stat grid */
.castle-stat-grid { margin-bottom: 10px; }
.castle-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid rgba(232,201,106,0.05);
}
.castle-stat-label {
  font-family: var(--font-title);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.45);
  flex-shrink: 0;
  margin-right: 8px;
}
.castle-stat-val {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--parchment);
  text-align: right;
}

/* Buttons */
.castle-btn {
  font-family: var(--font-title);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(232,201,106,0.06);
  border: 1px solid rgba(232,201,106,0.2);
  color: rgba(232,201,106,0.65);
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 4px;
  margin-top: 4px;
}
.castle-btn:hover { background: rgba(232,201,106,0.14); color: var(--gold-bright); border-color: rgba(232,201,106,0.45); }
.castle-btn--primary {
  background: rgba(232,201,106,0.1);
  border-color: rgba(232,201,106,0.3);
  color: var(--gold);
  padding: 6px 12px;
  font-size: 0.52rem;
}
.castle-btn--primary:hover { background: rgba(232,201,106,0.2); color: var(--gold-bright); }

/* Projects */
.castle-project { margin-bottom: 10px; }
.castle-project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.castle-project-name {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--parchment);
}
.castle-project-pct {
  font-family: var(--font-title);
  font-size: 0.48rem;
  color: rgba(232,201,106,0.5);
}
.castle-project-track {
  height: 4px;
  background: rgba(232,201,106,0.07);
  border: 1px solid rgba(232,201,106,0.12);
  margin-bottom: 2px;
}
.castle-project-fill {
  height: 100%;
  background: rgba(232,201,106,0.45);
  transition: width 0.4s ease;
}
.castle-project-desc {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(240,230,200,0.45);
  font-style: italic;
}
.castle-done-list {
  font-family: var(--font-title);
  font-size: 0.44rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(100,220,120,0.6);
  margin-top: 6px;
}

/* Rooms grid */
.castle-rooms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.castle-room-card {
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.12);
  padding: 7px 9px;
}
.castle-room-name {
  font-family: var(--font-title);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 2px;
}
.castle-room-desc {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(240,230,200,0.5);
  font-style: italic;
  line-height: 1.35;
}

/* Staff & garrison rows */
.castle-staff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(232,201,106,0.06);
}
.castle-staff-name {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--parchment);
  flex: 1;
}
.castle-staff-role {
  font-family: var(--font-title);
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.45);
  flex-shrink: 0;
}

/* Supplies */
.castle-supplies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.castle-supply-item {}
.castle-supply-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 3px;
}
.castle-supply-name {
  font-family: var(--font-title);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.55);
  flex: 1;
}
.castle-supply-val {
  font-family: var(--font-title);
  font-size: 0.55rem;
  color: rgba(232,201,106,0.75);
}

/* Event log */
.castle-log-entry {
  padding: 5px 0;
  border-bottom: 1px solid rgba(232,201,106,0.05);
}
.castle-log-date {
  display: block;
  font-family: var(--font-title);
  font-size: 0.44rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.4);
  margin-bottom: 2px;
}
.castle-log-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: rgba(240,230,200,0.7);
  font-style: italic;
  line-height: 1.45;
}

/* University */
.castle-university {
  background: rgba(40,80,120,0.1);
  border: 1px solid rgba(100,180,255,0.15);
  margin: 6px 0;
}


/* ===============================================================
   TUTORIAL OVERLAY — Task 30
   Spotlight + callout bubble with arrow pointing at target element
=============================================================== */

#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: all;
  display: none;
}
#tutorial-overlay.active { display: block; }

/* Dark backdrop — the spotlight hole is cut via JS box-shadow on the highlight ring */
#tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);  /* transparent — actual dim from spotlight ring */
  pointer-events: all;
}

/* Spotlight ring — positioned over target, box-shadow creates the dim effect */
#tutorial-spotlight {
  position: absolute;
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.72);
  border: 2px solid rgba(232,201,106,0.6);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  z-index: 1;
}

/* Callout bubble */
#tutorial-bubble {
  position: absolute;
  background: #110e06;
  border: 1px solid rgba(232,201,106,0.45);
  box-shadow: 0 4px 32px rgba(0,0,0,0.8), 0 0 0 1px rgba(232,201,106,0.1);
  padding: 14px 16px 12px;
  max-width: 260px;
  min-width: 180px;
  z-index: 2;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: all;
}

/* Arrow pointer — a CSS triangle attached to the bubble */
#tutorial-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 10px solid transparent;
  z-index: 3;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
/* Arrow direction classes */
#tutorial-arrow.arrow-left  { border-right-color:  rgba(232,201,106,0.45); }
#tutorial-arrow.arrow-right { border-left-color:   rgba(232,201,106,0.45); }
#tutorial-arrow.arrow-up    { border-bottom-color: rgba(232,201,106,0.45); }
#tutorial-arrow.arrow-down  { border-top-color:    rgba(232,201,106,0.45); }

#tutorial-step-label {
  font-family: var(--font-title);
  font-size: 0.44rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.45);
  margin-bottom: 6px;
}
#tutorial-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  margin-bottom: 7px;
  line-height: 1.3;
}
#tutorial-body {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: rgba(240,230,200,0.82);
  line-height: 1.55;
  margin-bottom: 12px;
}
.tutorial-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tutorial-btn {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  border: 1px solid rgba(232,201,106,0.3);
  background: rgba(232,201,106,0.08);
  color: var(--gold);
  transition: all 0.15s;
}
.tutorial-btn:hover { background: rgba(232,201,106,0.18); color: var(--gold-bright); }
.tutorial-btn--skip {
  background: none;
  border-color: rgba(232,201,106,0.12);
  color: rgba(232,201,106,0.35);
}
.tutorial-btn--skip:hover { color: rgba(232,201,106,0.6); }
#tutorial-progress-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
.tutorial-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(232,201,106,0.18);
  transition: background 0.2s;
}
.tutorial-dot.active { background: var(--gold); }
.tutorial-dot.done   { background: rgba(232,201,106,0.45); }


/* ===============================================================
   AUTH OVERLAY — Task 19
   Slides over the landing screen before the user signs in.
   Dismissed by dismissAuthOverlay() on successful auth.
=============================================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 2, 0.96);
  backdrop-filter: blur(6px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.auth-overlay--out {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.auth-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232,201,106,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(232,201,106,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.auth-box {
  position: relative;
  z-index: 1;
  width: min(440px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(28px, 5vh, 48px) clamp(24px, 5vw, 48px);
  background: rgba(10, 8, 5, 0.85);
  border: 1px solid rgba(232, 201, 106, 0.22);
  box-shadow:
    0 0 80px rgba(0,0,0,0.8),
    0 0 0 1px rgba(232,201,106,0.06) inset;
  animation: auth-box-rise 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes auth-box-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-ornament {
  width: min(260px, 70%);
  margin-bottom: 16px;
  opacity: 0.8;
}
.auth-ornament-bottom {
  margin-top: 20px;
  margin-bottom: 0;
}
.auth-copyright {
  font-family: var(--font-title);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.40);
  text-align: center;
  margin-top: 10px;
}

.auth-eyebrow {
  font-family: var(--font-title);
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.55);
  margin-bottom: 6px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-shadow: 0 0 40px rgba(232,201,106,0.4), 0 2px 8px rgba(0,0,0,0.9);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(232,201,106,0.45);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-tab {
  background: none;
  border: none;
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.38);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.auth-tab.active,
.auth-tab:hover {
  color: var(--gold);
  border-bottom-color: rgba(232,201,106,0.5);
}

.auth-tab-divider {
  color: rgba(232,201,106,0.2);
  font-size: 0.8rem;
  user-select: none;
}

/* ── Error ───────────────────────────────────────────────── */
.auth-error {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(180, 60, 40, 0.15);
  border: 1px solid rgba(200, 80, 60, 0.35);
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(220, 140, 120, 0.95);
  font-style: italic;
  text-align: center;
  animation: auth-error-in 0.3s ease;
}
@keyframes auth-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Forms ───────────────────────────────────────────────── */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form.hidden {
  display: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.5);
}

.auth-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(232,201,106,0.2);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}
.auth-input:focus {
  border-color: rgba(232,201,106,0.55);
  background: rgba(255,255,255,0.07);
}
.auth-input::placeholder {
  color: rgba(232,201,106,0.18);
  letter-spacing: 0.05em;
}

/* ── Submit button ───────────────────────────────────────── */
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 13px 24px;
  background: rgba(232,201,106,0.08);
  border: 1px solid rgba(232,201,106,0.55);
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.auth-submit:hover:not(:disabled) {
  background: rgba(232,201,106,0.16);
  border-color: rgba(232,201,106,0.85);
  box-shadow: 0 0 22px rgba(232,201,106,0.18);
}
.auth-submit:disabled {
  cursor: default;
}

.auth-submit-spinner {
  display: inline-block;
  animation: spin 0.8s linear infinite;
  font-size: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sign Out button (moved to chip row — hide from header) ── */
.signout-btn { display: none; }

/* ══ A3 — Item Acquisition Overlay ══════════════════════════════════════════ */
#char-portrait-wrap { position: relative; }

.item-acquired-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8,5,2,0.75);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.item-acquired-overlay--visible { opacity: 1; transform: scale(1); pointer-events: all; }
.item-acquired-overlay--out     { opacity: 0; transform: scale(1.04); }

.item-acquired-img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(232,201,106,0.15);
}
.item-acquired-label {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.item-acquired-name {
  font-family: var(--font-title);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
.item-acquired-tag {
  font-family: var(--font-title);
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232,201,106,0.5);
}

/* ══ A6 — Minimap Visit Button ══════════════════════════════════════════════ */
.detail-visit-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(232,201,106,0.1);
  border: 1px solid rgba(232,201,106,0.35);
  color: var(--gold-bright);
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.detail-visit-btn:hover {
  background: rgba(232,201,106,0.2);
  border-color: var(--gold);
}

/* ── Multi-portrait shimmer for unloaded NPCs ──────────────────────────────── */
.portrait-quad-shimmer {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: rgba(232,201,106,0.04);
}
.portrait-quad-shimmer .placeholder-shimmer {
  position: absolute; inset: 0;
}
.portrait-quad-pending {
  font-family: var(--font-title);
  font-size: 2rem;
  color: rgba(232,201,106,0.25);
  letter-spacing: 0.1em;
  z-index: 1;
  text-transform: uppercase;
}

/* ── A3 Use Now / To Inventory buttons ─────────────────────────────────────── */
.item-acquired-btns {
  position: absolute;
  bottom: 48px;
  left: 0; right: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 0 16px;
}
.item-acquired-btn {
  font-family: var(--font-title);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid rgba(232,201,106,0.35);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex: 1;
  max-width: 160px;
}
.item-acquired-btn--use {
  background: rgba(180,100,100,0.15);
  color: rgba(232,150,150,0.9);
  border-color: rgba(180,100,100,0.35);
}
.item-acquired-btn--use:hover {
  background: rgba(180,100,100,0.28);
  border-color: rgba(232,150,150,0.6);
}
.item-acquired-btn--keep {
  background: rgba(232,201,106,0.1);
  color: var(--gold-bright);
  border-color: rgba(232,201,106,0.35);
}
.item-acquired-btn--keep:hover {
  background: rgba(232,201,106,0.2);
  border-color: var(--gold);
}
/* ═══════════════════════════════════════════════════════════
   NAVIGATION CHIP ROW STYLING
   ═══════════════════════════════════════════════════════════ */

.chip-row--navigation {
  background-color: rgba(100, 80, 60, 0.3);
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  border: 1px solid rgba(180, 150, 110, 0.3);
}

.nav-chip {
  background-color: rgba(139, 115, 85, 0.4) !important;
  border-color: rgba(180, 150, 110, 0.5) !important;
  color: #f4e4c1 !important;
  font-weight: 500;
}

.nav-chip:hover {
  background-color: rgba(139, 115, 85, 0.6) !important;
  border-color: rgba(180, 150, 110, 0.7) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-chip:active {
  transform: translateY(0);
}

/* Sentence starter chips - keep default styling */
.chip-row--starters {
  margin-bottom: 6px;
}

.sentence-starter {
  font-style: italic;
  opacity: 0.9;
}

.sentence-starter:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION CHIP ROW STYLING
   ═══════════════════════════════════════════════════════════ */

.chip-row--navigation {
  background-color: rgba(100, 80, 60, 0.3);
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  border: 1px solid rgba(180, 150, 110, 0.3);
}

.nav-chip {
  background-color: rgba(139, 115, 85, 0.4) !important;
  border-color: rgba(180, 150, 110, 0.5) !important;
  color: #f4e4c1 !important;
  font-weight: 500;
}

.nav-chip:hover {
  background-color: rgba(139, 115, 85, 0.6) !important;
  border-color: rgba(180, 150, 110, 0.7) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-chip:active {
  transform: translateY(0);
}

/* Sentence starter chips - keep default styling */
.chip-row--starters {
  margin-bottom: 6px;
}

.sentence-starter {
  font-style: italic;
  opacity: 0.9;
}

.sentence-starter:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   SUGGESTION CHIPS — COMPACT UNIFIED STYLES
   ═══════════════════════════════════════════════════════════ */

.chat-suggestions {
  padding: 4px !important;
}

.chip-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 3px !important;
  margin-bottom: 3px !important;
}
.chip-row:last-child { margin-bottom: 0 !important; }

.suggestion-chip {
  flex: 1 1 calc(25% - 3px) !important;
  font-family: var(--font-title) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.06em !important;
  color: var(--gold) !important;
  border: 1px solid var(--border) !important;
  border-radius: 2px !important;
  background: rgba(232,201,106,0.05) !important;
  padding: 5px 4px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-transform: uppercase !important;
  text-align: center !important;
  line-height: 1.2 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  white-space: normal !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.suggestion-chip:hover {
  background: rgba(232,201,106,0.15) !important;
  color: var(--gold-bright) !important;
}

/* Sentence starters — slightly smaller text, not uppercase */
.sentence-starter {
  text-transform: none !important;
  font-size: 0.60rem !important;
  letter-spacing: 0.03em !important;
}

/* Nav chips — match base size */
.nav-chip {
  font-size: 0.62rem !important;
}

/* ═══════════════════════════════════════════════════════════════
   BATTLE ENGINE
   ═══════════════════════════════════════════════════════════════ */

#battle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 2, 1, 0.97);
  backdrop-filter: blur(6px);
  animation: battleFadeIn 0.4s ease;
}
#battle-overlay.active { display: flex; flex-direction: column; align-items: stretch; }

@keyframes battleFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.battle-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 16px;
  gap: 12px;
}

/* ── Combatants row (side by side) ── */
.battle-combatants {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  padding: 12px 0 4px;
}

.battle-combatant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 260px;
}

.battle-vs {
  font-size: 1.6rem;
  color: rgba(232, 201, 106, 0.4);
  align-self: center;
  flex-shrink: 0;
  padding: 0 8px;
  margin-top: -20px;
}

.battle-portrait {
  width: 180px;
  height: 240px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  flex-shrink: 0;
  position: relative;
}

.battle-combatant--enemy .battle-portrait {
  border: 1px solid rgba(180, 60, 40, 0.5);
  box-shadow: 0 0 40px rgba(180, 60, 40, 0.25);
  background: #0a0404;
}

.battle-combatant--player .battle-portrait {
  border: 1px solid rgba(100, 180, 120, 0.4);
  box-shadow: 0 0 30px rgba(80, 160, 100, 0.2);
  background: #040a06;
}

.battle-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.battle-combatant-name {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--parchment);
  text-transform: uppercase;
  text-align: center;
}

.battle-hp-bar-wrap {
  width: 100%;
  max-width: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}
.battle-hp-bar-wrap.enemy  { border: 1px solid rgba(180,60,40,0.3); }
.battle-hp-bar-wrap.player { border: 1px solid rgba(100,200,120,0.3); }

.battle-hp-bar {
  height: 100%;
  transition: width 0.4s ease;
  border-radius: 3px;
}
.battle-combatant--enemy  .battle-hp-bar { background: linear-gradient(90deg, #c83030, #e85050); }
.battle-combatant--player .battle-hp-bar { background: linear-gradient(90deg, #307830, #50b850); }

.battle-hp-text {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.battle-combatant--enemy  .battle-hp-text { color: rgba(230, 120, 100, 0.9); }
.battle-combatant--player .battle-hp-text { color: rgba(100, 220, 130, 0.9); }

/* ── Combat log ── */
.battle-log-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(232, 201, 106, 0.15);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(12, 9, 4, 0.7);
  min-height: 0;
}

.battle-log-header {
  font-family: var(--font-title);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: rgba(232, 201, 106, 0.5);
  text-transform: uppercase;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(232, 201, 106, 0.1);
  flex-shrink: 0;
}

.battle-log-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.battle-log-entry {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(240, 230, 200, 0.8);
  border-bottom: 1px solid rgba(232, 201, 106, 0.06);
  padding-bottom: 4px;
}
.battle-log-entry.player-action { color: var(--gold); font-style: italic; }
.battle-log-entry.enemy-action  { color: rgba(220, 100, 80, 0.9); }
.battle-log-entry.system-msg    { color: rgba(180, 200, 255, 0.7); font-style: italic; }
.battle-log-entry.victory-msg   { color: rgba(100, 220, 120, 0.9); font-weight: bold; }

/* ── Action bar ── */
.battle-action-bar {
  padding: 8px 0 4px;
  flex-shrink: 0;
}

.battle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ── Spell/Item picker ── */
.battle-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(12, 9, 4, 0.9);
  border: 1px solid rgba(232, 201, 106, 0.2);
  border-radius: 4px;
}
.battle-picker.hidden { display: none; }

.battle-picker-label {
  font-family: var(--font-title);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 201, 106, 0.6);
}

.battle-picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

/* ── Buttons ── */
.battle-btn {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.battle-btn--attack  { background: rgba(180,60,40,.15);  border-color: rgba(220,80,60,.5);   color: rgba(230,110,90,.95); }
.battle-btn--defend  { background: rgba(60,100,180,.12); border-color: rgba(80,130,220,.4);  color: rgba(130,170,240,.9); }
.battle-btn--spell   { background: rgba(120,60,180,.12); border-color: rgba(160,80,220,.4);  color: rgba(200,150,255,.9); }
.battle-btn--item    { background: rgba(60,140,80,.12);  border-color: rgba(80,180,100,.4);  color: rgba(120,210,140,.9); }
.battle-btn--flee    { background: rgba(100,80,40,.12);  border-color: rgba(180,150,80,.35); color: rgba(200,170,100,.8); }
.battle-btn--pick    { background: rgba(232,201,106,.08);border-color: rgba(232,201,106,.3); color: var(--gold); }

.battle-btn--attack:hover  { background: rgba(180,60,40,.3);  }
.battle-btn--defend:hover  { background: rgba(60,100,180,.25);}
.battle-btn--spell:hover   { background: rgba(120,60,180,.25);}
.battle-btn--item:hover    { background: rgba(60,140,80,.25); }
.battle-btn--flee:hover    { background: rgba(100,80,40,.25); }
.battle-btn--pick:hover    { background: rgba(232,201,106,.18);}

.battle-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Shake on hit */
@keyframes battleShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.battle-shake { animation: battleShake 0.35s ease; }

/* ══════════════════════════════════════════════════════════════
   FINANCIAL SYSTEM — Transaction Confirmation & Finance Panel
   ══════════════════════════════════════════════════════════════ */

/* Transaction confirmation overlay — extends item-acquired-overlay */
#txn-confirm-overlay {
  padding: 14px 12px;
  gap: 0;
  overflow-y: auto;
  justify-content: flex-start;
}

#txn-confirm-overlay input[type="radio"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Finance panel tabs — scrollable on small screens */
#finances-panel-root [style*="overflow-x:auto"] {
  scrollbar-width: none;
}
#finances-panel-root [style*="overflow-x:auto"]::-webkit-scrollbar {
  display: none;
}

/* Department stat boxes */
.dept-stat-box {
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.12);
  border-radius: 4px;
  padding: 7px 9px;
  min-width: 56px;
}

/* Transfer modal selects */
#transfer-modal select,
#new-dept-modal select,
#new-dept-modal input:not([type="radio"]) {
  -webkit-appearance: none;
  appearance: none;
}

/* Ensure radio buttons always render visibly in dept modal */
#new-dept-modal input[type="radio"] {
  -webkit-appearance: radio;
  appearance: radio;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #e8c96a;
}

/* Department assessment modal */
#dept-report-modal .dept-stat {
  background: rgba(232,201,106,0.04);
  border: 1px solid rgba(232,201,106,0.12);
  border-radius: 4px;
  padding: 9px;
  text-align: center;
}

/* Festival modal */
#festival-modal {
  scrollbar-width: thin;
  scrollbar-color: rgba(232,201,106,0.2) transparent;
}

/* Finance test mode log */
#fin-test-log {
  scrollbar-width: thin;
  scrollbar-color: rgba(232,201,106,0.2) transparent;
  white-space: pre-wrap;
  word-break: break-word;
}

/* New dept product rows */
#dept-products-list input:not([type="radio"]) {
  -webkit-appearance: none;
  appearance: none;
}
#dept-products-list input::placeholder {
  color: rgba(232,201,106,0.25);
  font-size: 0.72rem;
}

/* Manage tab department rows */
.dept-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(232,201,106,0.07);
}

/* Finance panel balance switching */
.fin-balance-display {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--gold-bright);
  transition: opacity 0.2s ease;
}

/* Pending transaction badge on finance nav button */
.fin-pending-badge {
  display: inline-block;
  background: rgba(220,100,100,0.8);
  color: white;
  font-size: 0.4rem;
  padding: 1px 4px;
  border-radius: 6px;
  margin-left: 3px;
  vertical-align: middle;
}

/* Transfer button in finance header */
#finances-panel-root button[onclick*="showTransferModal"] {
  transition: background 0.2s, border-color 0.2s;
}
#finances-panel-root button[onclick*="showTransferModal"]:hover {
  background: rgba(232,201,106,0.16);
  border-color: rgba(232,201,106,0.45);
}

