:root {
  --gold: #f2cf72;
  --gold-glow: rgba(242, 207, 114, 0.32);
  --panel: #0b140e;
  --panel-border: #6b5734;
  --line: #78613b;
  --text: #f3eed8;
  --text-dim: #b8bba6;
  --hp-gradient: linear-gradient(90deg, #9b2320 0%, #e84c3d 60%, #ff7364 100%);
  --xp-gradient: linear-gradient(90deg, #0e6b7d 0%, #20b2aa 60%, #5ce6e6 100%);
  --en-gradient: linear-gradient(90deg, #8a6c1e 0%, #e5b93a 60%, #ffea78 100%);
  --font-display: 'Cinzel', Georgia, serif;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050b06;
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

#app {
  height: 100dvh;
  display: grid;
  grid-template-rows: 58px 1fr;
  position: relative;
  overflow: hidden;
}

/* Top Header Bar */
.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(31, 42, 27, 0.98) 0%, rgba(10, 18, 12, 0.99) 100%);
  border-bottom: 1px solid #78613b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 231, 165, 0.08);
  z-index: 5;
}

.brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f7d268;
  text-shadow: 0 2px 8px rgba(245, 202, 86, 0.4), 1px 2px #221405;
  display: flex;
  align-items: center;
  gap: 8px;
}

.online {
  font-size: 12px;
  color: #aeb59e;
  border-left: 1px solid #434e3b;
  padding-left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.online i {
  display: inline-block;
  background: #4ade80;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.wallet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 12px;
}

.sound-toggle {
  border: 1px solid #6b5229;
  border-radius: 6px;
  background: linear-gradient(180deg, #222e1e, #131d11);
  padding: 6px 10px;
  color: #ffdc68;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sound-toggle:hover {
  border-color: #ffd464;
  background: #2f402a;
  transform: translateY(-1px);
}

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #634b25;
  border-radius: 6px;
  background: linear-gradient(180deg, #1d2719, #0e160d);
  padding: 6px 12px;
  color: #ffdc68;
  font-family: var(--font-mono);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.currency-badge img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.avatar {
  width: 34px;
  height: 34px;
  border: 1.5px solid #8c6a34;
  border-radius: 50%;
  background: radial-gradient(circle, #32442b 0%, #121c10 100%);
  display: grid;
  place-items: center;
  color: #ffd464;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

/* Layout Grid */
.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 310px;
}

.world {
  position: relative;
  overflow: hidden;
  background: #112616;
}

.world canvas#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* HUD Panel */
.hud {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 250px;
  padding: 14px;
  border: 1px solid rgba(169, 139, 82, 0.62);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(20, 30, 20, 0.94), rgba(8, 15, 10, 0.92));
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 235, 177, 0.12);
  pointer-events: none;
  z-index: 3;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
  font-weight: 600;
}

.line b {
  color: #f7dba0;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.level-badge {
  background: linear-gradient(135deg, #74511d, #3c290e);
  color: #ffe699;
  border: 1px solid #d4af37;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.bar-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bar {
  height: 14px;
  border-radius: 4px;
  border: 1px solid #141f14;
  background: #19241a;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.bar.hp i { background: var(--hp-gradient); }
.bar.xp i { background: var(--xp-gradient); }
.bar.en i { background: var(--en-gradient); }

.bar-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

.bar label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 2px #000;
}

.hud-status {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(110, 90, 50, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.hud-status[hidden] {
  display: none !important;
}

.buff-icon {
  font-size: 14px;
}

.buff-label {
  color: #8be4f0;
  font-weight: 600;
  flex: 1;
}

.buff-timer {
  font-family: var(--font-mono);
  color: #ffe071;
  font-weight: bold;
}

/* Zone Badge */
.zone {
  position: absolute;
  top: 18px;
  right: 18px;
  text-align: right;
  z-index: 3;
  pointer-events: none;
}

.zone-tag {
  display: block;
  color: #dfb24c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.zone b {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fbf0cf;
  margin-top: 3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 12px rgba(245, 202, 86, 0.3);
}

/* Mini-Map Radar */
.map {
  position: absolute;
  right: 18px;
  top: 76px;
  width: 105px;
  height: 105px;
  border: 2px solid #9a7a43;
  border-radius: 50%;
  background: radial-gradient(circle, #1c2b1e 0%, #0b130c 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.68), 0 0 0 4px rgba(8, 14, 9, 0.55), inset 0 0 15px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  z-index: 3;
}

.map canvas#radar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.map small {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  color: #ffd464;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

/* Hints & Toasts */
.hint, .toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 4;
}

.hint {
  top: 56%;
  border: 1px solid #e2b047;
  background: rgba(18, 28, 18, 0.92);
  color: #ffeaa7;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translate(-50%, 8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast {
  top: 20%;
  border: 1px solid #735930;
  background: rgba(14, 23, 15, 0.94);
  backdrop-filter: blur(6px);
  color: #f7e6b5;
  font-family: var(--font-ui);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transform: translate(-50%, -15px) scale(0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(220, 175, 75, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Controls Hint (Bottom Left) */
.controls {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 8px 14px;
  border: 1px solid rgba(80, 95, 70, 0.5);
  border-radius: 6px;
  background: rgba(11, 18, 12, 0.85);
  backdrop-filter: blur(4px);
  font-size: 11px;
  color: #c7cdb7;
  z-index: 3;
}

.control-key {
  color: #ffd465;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Action Bar (Bottom Center) */
.actions {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #826a3d;
  border-radius: 12px;
  background: rgba(12, 20, 13, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.68), inset 0 1px 0 rgba(255, 230, 150, 0.14), 0 0 18px rgba(13, 20, 13, 0.38);
  z-index: 3;
}

.auto-toggle {
  width: 72px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #6d6843;
  border-radius: 8px;
  background: linear-gradient(135deg, #263121, #121a11);
  color: #c5c8a8;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative;
  transition: all 0.2s ease;
}

.auto-title {
  font-size: 11px;
  letter-spacing: 1px;
}

.auto-state {
  font-size: 8px;
  color: #ba765b;
}

.auto-toggle:hover {
  border-color: #ffd464;
  transform: translateY(-2px);
}

.auto-toggle.active {
  border-color: #52cf68;
  background: linear-gradient(135deg, #225227, #132a17);
  color: #e2ffd9;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.35);
}

.auto-toggle.active .auto-state {
  color: #8bf29e;
}

.action {
  width: 52px;
  height: 52px;
  border: 1.5px solid #64563a;
  border-radius: 8px;
  background: linear-gradient(135deg, #2a3d28, #131c13);
  font-size: 22px;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.action:hover {
  transform: translateY(-2px);
  border-color: #f7d268;
  box-shadow: 0 0 14px rgba(247, 210, 104, 0.35);
}

.action:active {
  transform: translateY(1px);
}

.action.unavailable:not(.cool) {
  filter: saturate(0.45);
  opacity: 0.58;
}

.action-key {
  position: absolute;
  top: 3px;
  left: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #dedfcb;
  text-shadow: 0 1px 2px #000;
}

.action-icon {
  font-size: 22px;
  line-height: 1;
}

.cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 6, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.action.cool .cooldown-overlay {
  opacity: 1;
}

.cooldown-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  color: #ffe699;
  text-shadow: 0 1px 4px #000;
}

/* Side Panel */
.side {
  overflow-y: auto;
  border-left: 1px solid #5a4425;
  background: linear-gradient(135deg, #0d160e 0%, #152216 100%);
  display: flex;
  flex-direction: column;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  position: sticky;
  top: 0;
  background: rgba(14, 23, 15, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #5a4425;
  z-index: 2;
}

.tabs button {
  padding: 12px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #9ca28c;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tabs button:hover {
  color: #f7e1a0;
  background: rgba(255, 255, 255, 0.03);
}

.tabs button.active {
  color: #ffd464;
  border-bottom-color: #ffd464;
  background: rgba(255, 212, 100, 0.05);
}

.inside {
  padding: 16px;
  display: flex;
  overflow: auto;
  scrollbar-color: #765a2f #101810;
  scrollbar-width: thin;
  flex-direction: column;
  gap: 12px;
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f3c759;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.title small {
  font-family: var(--font-mono);
  font-weight: normal;
  color: #9ea58e;
  font-size: 9px;
}

.quest, .card {
  position: relative;
  border: 1px solid #635337;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(27, 39, 25, 0.96) 0%, rgba(12, 19, 13, 0.98) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.quest:hover, .card:hover {
  border-color: #a2874d;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 235, 177, 0.08);
}

.quest:hover {
  background: linear-gradient(135deg, rgba(36, 49, 31, 0.96), rgba(15, 25, 16, 0.96));
}

.quest {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 12px;
}

.icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #785a2c;
  border-radius: 6px;
  background: radial-gradient(circle, #2d3d25 0%, #172415 100%);
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.quest h3 {
  margin: 0 28px 4px 0;
  font-size: 12px;
  font-weight: 700;
  color: #fce8b8;
}

.quest p, .card p {
  margin: 0 0 8px;
  color: #aeb59e;
  font-size: 11px;
  line-height: 1.4;
}

.reward {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #473212;
  border: 1px solid #7f5c22;
  color: #ffd464;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: bold;
}

.progress {
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  background: #121c13;
  border: 1px solid #1a281b;
  position: relative;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c48218 0%, #fcd65b 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quest small {
  display: block;
  text-align: right;
  color: #d8c48a;
  font-family: var(--font-mono);
  font-size: 9px;
  margin-top: 4px;
}

.card {
  padding: 14px;
}

.card strong {
  color: #f7d268;
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

.card button {
  width: 100%;
  padding: 10px;
  border: 1px solid #8c6a34;
  border-radius: 6px;
  background: linear-gradient(180deg, #2b3d26, #162415);
  color: #ffe07b;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card button:hover:not(:disabled) {
  border-color: #ffd464;
  background: linear-gradient(180deg, #3c5635, #20341e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 212, 100, 0.2);
}

.card button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.equip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.equip span {
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #3d4a36;
  border-radius: 6px;
  background: #111a11;
  font-size: 20px;
}

.gear-slot {
  min-height: 60px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px solid #43523c;
  border-radius: 6px;
  background: #111a11;
  color: #b9baa0;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gear-slot img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.gear-slot.equipped {
  border-color: #e5c35b;
  background: linear-gradient(135deg, #273820, #142013);
  box-shadow: 0 0 12px rgba(229, 195, 91, 0.25);
  color: #f7d577;
}

.gear-slot:hover {
  border-color: #ffd464;
  transform: translateY(-2px);
}

/* Bag Panel */
.bag-wallet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bag-wallet > div {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 2px 8px;
  padding: 10px;
  border: 1px solid #5a4b2c;
  border-radius: 6px;
  background: #151e14;
}

.bag-wallet img {
  grid-row: 1/3;
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.bag-wallet span {
  color: #aeb19d;
  font-size: 9px;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.bag-wallet b {
  color: #fce18d;
  font-family: var(--font-mono);
  font-size: 14px;
}

.bag-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bag-item {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #43523b;
  border-radius: 6px;
  background: #101911;
  color: #dedcc5;
  font-size: 10px;
  transition: all 0.15s ease;
}

.bag-item:hover {
  border-color: #7d6537;
  background: #172418;
}

.bag-item > img, .bag-emoji {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

.bag-emoji {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.bag-item > span:nth-child(2) {
  flex: 1;
  font-weight: 600;
}

.bag-item small {
  display: block;
  margin-top: 3px;
  color: #8f9680;
  font-size: 8px;
  font-weight: normal;
}

.bag-item > b {
  align-self: flex-start;
  color: #ffd464;
  font-family: var(--font-mono);
  font-size: 11px;
}

.use-potion {
  width: 100%;
  padding: 10px;
  border: 1px solid #a6723e;
  border-radius: 6px;
  background: linear-gradient(180deg, #42301e, #22180f);
  color: #f7d488;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.use-potion:hover:not(:disabled) {
  border-color: #ffd464;
  background: #553e27;
  transform: translateY(-1px);
}

.use-potion:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Region Track Cards */
.region-track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 10px;
}

.region-card {
  position: relative;
  min-height: 68px;
  padding: 8px 8px 8px 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  text-align: left;
  border: 1px solid #5a4a2b;
  border-radius: 6px;
  background: linear-gradient(135deg, #1c2618, #0e160e);
  color: #ecdcae;
  cursor: pointer;
  transition: all 0.2s ease;
}

.region-card > b {
  position: absolute;
  left: 8px;
  top: 10px;
  color: #e5be59;
  font-family: var(--font-display);
  font-size: 18px;
}

.region-card span {
  font-size: 10px;
  font-weight: 700;
}

.region-card small {
  color: #9d9f8c;
  font-size: 8px;
  font-family: var(--font-mono);
}

.region-card.current {
  border-color: #f7d268;
  background: linear-gradient(135deg, #2b3d24, #152213);
  box-shadow: 0 0 14px rgba(247, 210, 104, 0.25);
}

.region-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.region-card > i {
  position: absolute;
  right: 6px;
  top: 6px;
  font-style: normal;
  font-size: 12px;
}

.region-card:not(:disabled):hover {
  border-color: #ffd464;
  transform: translateY(-1px);
}

.region-card > i {
  max-width: 76px;
  color: #b5aa88;
  font-size: 7px;
  text-align: right;
}

.area-track {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.area-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  padding: 7px 9px;
  border: 1px solid rgba(152, 133, 83, 0.32);
  border-radius: 5px;
  background: linear-gradient(100deg, rgba(28, 39, 25, 0.92), rgba(14, 21, 15, 0.88));
  color: #d6d0b2;
}

.area-card > b {
  font-size: 10px;
}

.area-card > small {
  color: #a99a6c;
  font: 700 8px var(--font-mono);
}

.area-card > span {
  grid-column: 1 / -1;
  color: #c4a865;
  font-size: 8px;
}

.area-card.active {
  border-color: #94b466;
  box-shadow: inset 2px 0 #94b466;
}

.area-card.boss {
  border-color: #8e6434;
  background: linear-gradient(100deg, rgba(61, 36, 24, 0.9), rgba(25, 19, 16, 0.92));
}

.area-card.boss.active {
  border-color: #e1a94e;
  box-shadow: inset 2px 0 #e1a94e, 0 0 12px rgba(225, 169, 78, 0.12);
}

.area-card.cleared > span {
  color: #9ccf82;
}

.progression-note {
  display: grid;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 9px 10px;
  border: 1px solid rgba(210, 165, 75, 0.35);
  border-radius: 6px;
  background: rgba(39, 32, 20, 0.72);
}

.progression-note b {
  color: #edcf7d;
  font: 700 9px var(--font-mono);
}

.progression-note span {
  color: #bbb59e;
  font-size: 9px;
  line-height: 1.5;
}

.dungeon-card {
  position: relative;
  display: grid;
  gap: 9px;
  margin: 4px 0 10px;
  padding: 14px 12px 12px;
  overflow: hidden;
  border: 1px solid #765634;
  border-radius: 8px;
  background: radial-gradient(ellipse at 100% 0, rgba(99, 64, 42, 0.4), transparent 55%), linear-gradient(150deg, #211e1b, #111713 75%);
  box-shadow: inset 0 1px rgba(255, 224, 154, 0.09), 0 6px 18px rgba(0, 0, 0, 0.2);
}

.dungeon-emblem {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #b88e4d;
  border-radius: 50%;
  background: #28231a;
  color: #f0ce81;
  font-size: 21px;
  box-shadow: 0 0 18px rgba(217, 165, 78, 0.2);
}

.dungeon-card > strong {
  color: #f0d89d;
  font: 700 15px var(--font-display);
}

.dungeon-card > p,
.dungeon-loot > p,
.dungeon-live > p {
  margin: 0;
  color: #b8b4a3;
  font-size: 10px;
  line-height: 1.55;
}

.dungeon-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.dungeon-facts > span {
  display: grid;
  gap: 4px;
  padding: 7px 5px;
  border: 1px solid rgba(164, 133, 79, 0.28);
  border-radius: 4px;
  background: rgba(6, 11, 10, 0.55);
  color: #8d957e;
  font: 700 7px var(--font-mono);
}

.dungeon-facts b {
  color: #ddc582;
  font-size: 9px;
}

.dungeon-npc-note {
  padding: 7px 8px;
  border-left: 2px solid #c29b5b;
  background: rgba(196, 155, 91, 0.08);
  color: #d2bf91 !important;
}

.dungeon-contract,
.dungeon-rules {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(143, 119, 73, 0.33);
  border-radius: 5px;
  background: rgba(8, 13, 11, 0.58);
}

.dungeon-contract > b,
.dungeon-rules > b,
.rare-item-box > b,
.dungeon-loot > strong,
.material-title {
  color: #e4c87b;
  font: 700 9px var(--font-mono);
}

.dungeon-contract > span,
.dungeon-rules > span {
  color: #a7a995;
  font-size: 9px;
  line-height: 1.45;
}

.dungeon-contract > span::before {
  content: '◇';
  margin-right: 6px;
  color: #ba9a58;
}

.dungeon-contract > span.done {
  color: #9bd08c;
}

.dungeon-contract > span.done::before {
  content: '✓';
  color: #9bd08c;
}

.dungeon-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #897044;
  border-radius: 5px;
  background: linear-gradient(135deg, #403321, #241d15);
  color: #f0d89d;
  font: 700 9px var(--font-mono);
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dungeon-button:hover:not(:disabled) {
  border-color: #f0cb73;
  filter: brightness(1.18);
  transform: translateY(-1px);
}

.dungeon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.dungeon-button.ready,
.dungeon-button.enter {
  border-color: #8fac62;
  background: linear-gradient(135deg, #344329, #1b251a);
  color: #d5e2a8;
}

.dungeon-lock {
  text-align: center;
  color: #e29c79 !important;
}

.dungeon-loot,
.dungeon-live {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid rgba(120, 103, 69, 0.35);
  border-radius: 6px;
  background: rgba(15, 22, 17, 0.86);
}

.dungeon-loot ul,
.rare-item-box ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dungeon-loot li,
.rare-item-box li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border: 1px solid rgba(133, 127, 102, 0.2);
  border-radius: 4px;
  background: rgba(8, 12, 10, 0.55);
  color: #cac4ae;
  font-size: 9px;
}

.loot-rare b {
  color: #73d9f4;
}

.loot-mythic b {
  color: #f279d9;
}

.empty-loot {
  color: #858979 !important;
  font-style: italic;
}

.material-title {
  display: block;
  margin: 4px 0;
}

.rare-item-box {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(158, 127, 78, 0.34);
  border-radius: 5px;
  background: rgba(12, 16, 12, 0.7);
}

#buyPotion:disabled,
#forgeWeapon:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: saturate(0.55);
}

.action:focus-visible,
.auto-toggle:focus-visible,
.tabs button:focus-visible,
.region-card:focus-visible,
.inside button:focus-visible {
  outline: 2px solid #ffe28a;
  outline-offset: 2px;
}

/* Main Menu Styles */
#app.menu-open {
  grid-template-rows: 1fr;
}

#app.menu-open > .top {
  display: none;
}

#app.menu-open > .layout {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

#app.menu-open .side,
#app.menu-open .hud,
#app.menu-open .zone,
#app.menu-open .map,
#app.menu-open .hint,
#app.menu-open .controls,
#app.menu-open .actions,
#app.menu-open .toast {
  display: none !important;
}

.main-menu {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px 20px 58px;
  background: radial-gradient(circle at center, rgba(10, 22, 12, 0.85) 0%, rgba(5, 10, 6, 0.96) 100%);
  backdrop-filter: blur(4px);
}

.menu-layout {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  width: min(100%, 880px);
  margin: auto;
}

.menu-frame {
  position: relative;
  flex: 0 0 378px;
  width: 378px;
  height: 453px;
  background: url('assets/ui/menu-ui-kit.png') -51px -270px/768px 768px no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.8));
}

.menu-brand-plaque {
  position: absolute;
  left: -54px;
  top: -16px;
  width: 486px;
  height: 72px;
  display: grid;
  place-items: center;
  background: url('assets/ui/menu-ui-kit.png') -240px -87px/768px 768px no-repeat;
  image-rendering: pixelated;
  display: none;
}

.menu-brand-plaque h1 {
  margin: 0;
  color: #f7d88e;
  font: 800 clamp(18px, 2.4vw, 26px) / 1.1 var(--font-display);
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 2px 2px #271b0e, 0 0 12px rgba(247, 216, 142, 0.4);
}

.menu-panel-content, .menu-subview {
  position: absolute;
  inset: 30px 35px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  text-align: center;
}

.menu-kicker {
  margin: 0 0 10px;
  color: #dcb364;
  font: 700 11px / 1.5 var(--font-mono);
  letter-spacing: 1.2px;
  text-align: center;
}

.menu-intro {
  margin: 0 0 18px;
  color: #f3e9d2;
  font: 14px / 1.6 var(--font-ui);
  text-shadow: 0 2px 4px #000;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.menu-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1.5px solid #8c7246;
  outline: 1px solid #211d14;
  background: linear-gradient(180deg, rgba(38, 48, 33, 0.95), rgba(16, 23, 16, 0.98));
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  color: #f0dfb2;
  font: 700 12px / 1.2 var(--font-mono);
  letter-spacing: 1.4px;
  text-shadow: 0 1px 2px #000;
  cursor: pointer;
  transition: all 0.16s ease;
}

.menu-button:hover, .menu-button:focus-visible {
  transform: translateY(-2px);
  border-color: #ffdb7b;
  background: linear-gradient(180deg, #614d28, #2c2b1a);
  color: #ffffff;
  outline-color: #c9a456;
  box-shadow: 0 4px 14px rgba(255, 219, 123, 0.25);
}

.menu-button.menu-primary {
  border-color: #e2b963;
  background: linear-gradient(180deg, #6e5429, #362916);
  color: #fff0be;
}

.menu-version {
  margin: 14px 0 0;
  color: #9c967a;
  font: 9px / 1.4 var(--font-mono);
  letter-spacing: 1.2px;
}

.menu-hero-card {
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #ede5cf;
  text-shadow: 0 2px 4px #000;
  animation: menu-hero-in 0.8s ease-out both;
}

.menu-seal {
  width: 280px;
  height: 280px;
  display: grid;
  place-items: center;
  background: none;
  image-rendering: auto;
  filter: drop-shadow(0 0 24px rgba(220, 165, 60, 0.2));
}

.menu-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.menu-hero-card h2 {
  margin: 4px 0 6px;
  color: #f7d690;
  font: 700 15px / 1.3 var(--font-display);
  letter-spacing: 2px;
}

.menu-hero-card p {
  max-width: 240px;
  margin: 0;
  color: #cfc8b0;
  font: 13px / 1.5 var(--font-ui);
}

.hero-divider {
  margin-top: 18px;
  color: #d4a957;
  letter-spacing: 6px;
}

.menu-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #c2be9f;
  font: 11px var(--font-mono);
  text-shadow: 0 2px 4px #000;
}

.menu-hint span {
  color: #ffd464;
  font-weight: bold;
}

.menu-hint i {
  padding: 0 10px;
  color: #a4864f;
}

@keyframes menu-hero-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #app {
    grid-template-rows: 50px 1fr;
  }
  .brand {
    font-size: 14px;
  }
  .online {
    display: none;
  }
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 1fr) minmax(190px, 30dvh);
  }
  .side {
    border-left: 0;
    border-top: 1px solid #5a4425;
  }
  .inside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    overflow: auto;
    padding: 10px;
    gap: 8px;
  }
  .title, .card:not(.bag-panel), .equip {
    display: none;
  }
  .quest {
    padding: 8px;
  }
  .hud {
    transform: scale(0.85);
    transform-origin: top left;
  }
  .map {
    width: 76px;
    height: 76px;
    right: 10px;
    top: 55px;
  }
  .zone {
    right: 10px;
    top: 10px;
  }
  .zone b {
    font-size: 14px;
  }
  .controls {
    display: none;
  }
  .actions {
    bottom: 8px;
    gap: 5px;
    padding: 5px;
  }
  .action {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .auto-toggle {
    width: 58px;
    height: 42px;
  }
  .menu-hero-card {
    display: none;
  }
  .menu-brand-plaque {
    display: grid;
  }
  .region-track {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    overflow-x: auto;
  }
  .top {
    padding: 0 10px;
    gap: 8px;
  }
  .wallet {
    gap: 5px;
  }
  .currency-badge {
    padding: 5px 7px;
  }
  .avatar {
    display: none;
  }
  .actions {
    max-width: calc(100% - 18px);
  }
}

@media (max-width: 420px) {
  .layout {
    grid-template-rows: minmax(260px, 1fr) minmax(185px, 30dvh);
  }
  .brand {
    font-size: 11px;
    letter-spacing: 1px;
  }
  .sound-toggle {
    padding: 5px 7px;
  }
  .currency-badge img {
    width: 15px;
    height: 15px;
  }
  .inside {
    grid-template-columns: 1fr;
  }
}
/* Character sheet and integrated equipment paperdoll */
.inside:has(.character-screen) {
  display: block;
  overflow-y: auto;
  padding: 10px;
  scrollbar-color: #705a31 #10150f;
}

.character-screen {
  --sheet-gold: #d8b55c;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #eee4c6;
  font-family: var(--font-mono);
}

.character-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid #66512e;
  background: linear-gradient(115deg, #25251c, #111710 65%, #2b2115);
  box-shadow: inset 0 0 0 2px #151710, 0 4px 14px #0008;
}

.character-kicker, .character-section-heading > span, .character-section-label {
  color: var(--sheet-gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.character-heading h2 {
  margin: 3px 0 0;
  color: #f4e7c4;
  font: 700 18px Georgia, serif;
  letter-spacing: 1px;
}

.character-heading p {
  margin: 4px 0 0;
  color: #a6a18d;
  font-size: 9px;
}

.character-level {
  display: grid;
  justify-items: center;
  color: #d1bd84;
  font-size: 8px;
}

.character-level b { color: #ffe29a; font-size: 23px; line-height: 1.1; }

.character-top-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.78fr) minmax(155px, 1.35fr);
  gap: 8px;
}

.character-portrait, .character-stats {
  min-width: 0;
  border: 1px solid #443c29;
  background: linear-gradient(145deg, #181c16, #0d120e);
}

.character-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 7px;
  text-align: center;
}

.portrait-frame {
  display: grid;
  place-items: center;
  width: 76px;
  height: 84px;
  border: 2px solid #81683a;
  background: radial-gradient(ellipse, #54442d, #171a14 72%);
  box-shadow: inset 0 0 0 3px #12150f, 0 0 14px #d69d3030;
}

.portrait-frame img {
  width: 70px;
  height: 78px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 2px #000);
}

.character-portrait > span { color: #c7b98d; font-size: 7px; letter-spacing: .35px; }
.character-portrait > small { color: #9da18a; font-size: 8px; }
.character-xp { width: 92%; height: 5px; overflow: hidden; background: #080d0a; border: 1px solid #38422e; }
.character-xp i { display: block; height: 100%; background: linear-gradient(90deg, #32b7a6, #d1c45a); }

.character-stats { padding: 9px; }
.character-section-label { margin-bottom: 5px; font-size: 8px; }
.character-stats > div:not(.character-section-label) {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  padding: 5px 0;
  border-top: 1px solid #ffffff0b;
  color: #aaa994;
  font-size: 9px;
}
.character-stats b { color: #efe2bd; white-space: nowrap; }
.character-stats b small { color: #848878; font-size: 8px; font-weight: 400; }

.character-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 1px 5px;
  border-bottom: 1px solid #58482c;
}
.character-section-heading small { color: #898a78; font-size: 7px; text-align: right; }

.paperdoll {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid #493c29;
  background: radial-gradient(ellipse at center, #27261d, #111510 75%);
  box-shadow: inset 0 0 16px #0008;
}

.paperdoll-slot {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid #504733;
  background: linear-gradient(145deg, #20221b, #101510);
  color: #a7a18c;
  cursor: default;
}
.paperdoll-slot img { width: 27px; height: 27px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 3px #000); }
.paperdoll-slot > span { color: #79735f; font: 18px Georgia, serif; }
.paperdoll-slot .class-weapon-icon { font-size: 23px; filter: drop-shadow(0 2px 3px #000); }
.paperdoll-slot small { font: 700 7px var(--font-mono); letter-spacing: .15px; }
.paperdoll-slot i { position: absolute; top: 2px; right: 2px; color: #8bce73; font: 700 5px var(--font-mono); }
.paperdoll-slot.is-equipped { border-color: #c79d4a; background: linear-gradient(145deg, #3c3520, #191b13); box-shadow: inset 0 0 10px #c9982422, 0 0 7px #d7a84622; color: #f1d68f; cursor: pointer; }
.paperdoll-slot.is-equipped:hover { border-color: #ffe18a; filter: brightness(1.12); }
.paperdoll-slot.is-locked { opacity: .65; }

.equipment-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
  margin-top: -5px;
  padding: 6px 8px;
  border: 1px solid #322f23;
  background: #10140f;
  color: #b5ae92;
  font-size: 8px;
}

.character-skills { display: grid; gap: 5px; }
.character-skill {
  display: grid;
  grid-template-columns: 20px 30px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #49402c;
  background: linear-gradient(100deg, #1e2118, #111610);
  color: #e9dfc1;
  text-align: left;
  cursor: pointer;
}
.character-skill:hover:not(:disabled) { border-color: #c49b48; background: #292719; }
.character-skill:disabled { opacity: .45; cursor: not-allowed; }
.skill-key { display: grid; place-items: center; width: 19px; height: 20px; border: 1px solid #625333; color: #e4c36c; font-size: 9px; }
.skill-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #55472d; background: #11150f; color: #f1bd48; font-size: 18px; }
.skill-icon img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.skill-copy { min-width: 0; }
.skill-copy b, .skill-copy small { display: block; }
.skill-copy b { overflow: hidden; color: #ead7a5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.skill-copy small { margin-top: 3px; color: #979886; font-size: 7px; line-height: 1.35; }
.skill-use { color: #be9c51; font-size: 13px; }

.talent-roadmap { padding: 8px; border: 1px solid #423a29; background: #111510; }
.talent-roadmap > div:first-child b, .talent-roadmap > div:first-child small { display: block; }
.talent-roadmap > div:first-child b { color: #cbb36f; font-size: 8px; letter-spacing: .7px; }
.talent-roadmap > div:first-child small { margin-top: 3px; color: #858778; font-size: 7px; }
.talent-milestones { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
.talent-milestones span { display: flex; align-items: center; gap: 5px; color: #88897c; font-size: 7px; }
.talent-milestones i { display: grid; place-items: center; width: 21px; height: 20px; border: 1px solid #49412e; color: #c5a958; font: 700 7px var(--font-mono); }
.talent-milestones { grid-template-columns: 1fr; }
.talent-node { display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 6px; padding: 6px; border: 1px solid #48402d; background: linear-gradient(100deg,#202018,#111510); color: #d8cfb5; text-align: left; cursor: pointer; }
.talent-node:disabled { opacity: .58; cursor: default; }
.talent-node:not(:disabled):hover { border-color: #d5a45a; background: #29251b; }
.talent-node.learned { border-color: #718c53; background: linear-gradient(100deg,#26311e,#151a12); }
.talent-node > i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #655334; color: #edbd61; font-style: normal; }
.talent-node span b,.talent-node span small { display: block; }
.talent-node span b { color: #ead9a6; font-size: 8px; }
.talent-node span small { margin-top: 2px; color: #9e9a88; font-size: 7px; }
.talent-node strong { color: #c5a958; font: 700 6px var(--font-mono); }
.bag-wallet { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ember-wallet { border-color: #8b5131 !important; background: linear-gradient(145deg,#392319,#1c1711) !important; }
.ember-wallet > span:first-child { color: #ff9c52; font-size: 20px; }
.currency-lore { padding: 8px; border-left: 2px solid #b26a39; background: #171710; color: #a9a28d; font-size: 8px; line-height: 1.5; }
.codex-summary { padding: 12px; border: 1px solid #59462a; background: radial-gradient(ellipse at top,#302719,#131710 78%); text-align: center; }
.codex-summary > span,.codex-summary > b,.codex-summary > small { display: block; }
.codex-summary > span { color: #bfa65c; font: 700 8px var(--font-mono); }
.codex-summary > b { margin: 5px; color: #f3d27c; font: 700 24px var(--font-mono); }
.codex-summary > small { color: #aaa28d; font-size: 8px; }
.codex-milestones { display: flex; justify-content: center; gap: 14px; margin-top: 9px; }
.codex-milestones i { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #57492e; color: #c8ad60; font: 700 8px var(--font-mono); font-style: normal; }
.codex-milestones i.complete { border-color: #9d7943; background: #574125; color: #ffe39a; }
.codex-list { display: grid; gap: 5px; }
.codex-list article { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 4px 7px; padding: 7px; border: 1px solid #34372c; background: #111610; }
.codex-list article > span { grid-row: span 2; color: #c39b53; font-size: 16px; text-align: center; }
.codex-list article > b { color: #ddd1ab; font-size: 9px; text-transform: capitalize; }
.codex-list article > strong { color: #f0cf78; font: 700 10px var(--font-mono); }
.codex-list article > small { grid-column: 2 / 4; color: #818879; font: 6px var(--font-mono); }
.codex-list article.boss-found { border-color: #80503e; background: #211712; }

@media (max-width: 900px) {
  .character-top-grid { grid-template-columns: minmax(88px, .7fr) minmax(145px, 1.3fr); }
}

.class-select-note { margin: -4px 0 8px; color: #c8bea4; font: 10px/1.4 var(--font-ui); text-align: center; }
.menu-class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; max-height: 290px; overflow: auto; }
.class-choice { display: grid; grid-template-columns: 43px 1fr 18px; align-items: center; gap: 6px; min-width: 0; padding: 4px; border: 1px solid #58472d; background: linear-gradient(135deg,#1c2118,#11150f); color: #e9ddbd; text-align: left; cursor: pointer; }
.class-choice:hover, .class-choice.selected { border-color: #e2bd65; background: linear-gradient(135deg,#3c3420,#191a12); box-shadow: inset 0 0 10px #d8ad3820; }
.class-choice-portrait { display: grid; place-items: center; width: 42px; height: 48px; border: 1px solid #443a29; background: radial-gradient(ellipse,#4a3c28,#171a14 75%); }
.class-choice-portrait img { width: 40px; height: 46px; object-fit: contain; image-rendering: pixelated; }
.class-choice-copy { min-width: 0; }
.class-choice-copy b, .class-choice-copy small, .class-choice-copy i { display: block; }
.class-choice-copy b { color: #f1d48b; font: 700 9px var(--font-mono); }
.class-choice-copy small { margin-top: 2px; color: #b9ad8b; font: 7px var(--font-mono); }
.class-choice-copy i { margin-top: 3px; color: #908d7d; font: normal 7px/1.25 var(--font-ui); }
.class-choice-mark { color: #d4b15a; font-size: 13px; text-align: center; }
.class-start { margin-top: 8px; min-height: 34px; font-size: 9px; }
.menu-subview:has(.menu-class-grid) { inset: 30px 30px 24px; justify-content: flex-start; overflow: auto; padding-top: 10px; }
@media (max-width: 500px) { .menu-class-grid { grid-template-columns: 1fr 1fr; } .class-choice-copy i { display: none; } }
/* Conta e sincronização de saves */
.account-top {
  min-width: 48px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #765b2b;
  border-radius: 9px;
  background: linear-gradient(180deg, #20281b, #11190f);
  color: #e8c66c;
  font: 700 10px 'JetBrains Mono', monospace;
  cursor: pointer;
}
.account-top.connected { border-color: #7b9a48; color: #c8e68e; }
.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #050806d9;
  backdrop-filter: blur(5px);
}
.account-overlay[hidden] { display: none; }
.account-card {
  position: relative;
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid #8b6a32;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0, #354026, #131911 56%, #0b100d);
  box-shadow: 0 22px 90px #000c, inset 0 0 25px #b17a2812;
  color: #eee2c3;
}
.account-card h2 { margin: 5px 0 12px; color: #eacb7a; font: 700 23px Cinzel, serif; }
.account-copy { min-height: 42px; color: #c3b899; line-height: 1.5; font-size: 14px; }
.account-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: none;
  color: #d7c59e;
  font: 28px Outfit, sans-serif;
  cursor: pointer;
}
.account-form { display: grid; gap: 11px; margin-top: 18px; }
.account-form label { display: grid; gap: 6px; color: #d8c99f; font-size: 13px; }
.account-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #594e35;
  border-radius: 7px;
  outline: none;
  background: #0a0f0d;
  color: #f7ebcb;
  font: 15px Outfit, sans-serif;
}
.account-form input:focus { border-color: #d1a64f; box-shadow: 0 0 0 2px #d1a64f24; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 5px; }
.account-actions[hidden] { display: none; }
.account-form .menu-button, .account-card > .menu-button { width: 100%; min-height: 42px; }
.account-back { margin-top: 12px; }
.account-card button:disabled { opacity: .48; cursor: not-allowed; }
@media (max-width: 520px) {
  .account-card { padding: 25px 18px 19px; }
  .account-actions { grid-template-columns: 1fr; }
}
