/* Don't Starve esintili el çizimi parşömen & mürekkep arayüzü (3D sahne uyumlu) */
:root {
  --bg-outer: #1d1713;
  --parchment: #efe3c8;
  --parchment-dark: #dfd0ae;
  --ink: #231a14;
  --ink-soft: #5a4636;
  --accent: #b85d2b;
  --accent-hover: #d16e35;
  --gold: #d9a036;
  --border-ink: #2a1f18;
  --shadow: rgba(15, 10, 7, 0.5);
}

body.phase-night {
  --bg-outer: #0f121b;
  --parchment: #d9cfb8;
  --parchment-dark: #c5b99e;
  --accent: #8f4e2b;
}

body.phase-fullmoon {
  --bg-outer: #09060c;
  --parchment: #cfc6c0;
  --parchment-dark: #b6aaa3;
  --ink: #1a1216;
  --accent: #8c2633;
  --accent-hover: #a83242;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg-outer);
  color: var(--ink);
  font-family: "Georgia", "Palatino Linotype", serif;
  transition: background 1.2s ease;
  overflow: hidden;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  gap: 8px;
}

/* Üst HUD — Tek sıra ve sabit yükseklik (sahneyi asla kaydırmaz) */
#hud {
  width: 100%;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--parchment);
  border: 2px solid var(--border-ink);
  border-radius: 9px 12px 10px 11px;
  padding: 5px 9px;
  font-weight: bold;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--border-ink);
  transition: background 0.8s ease;
}

.pill .label {
  font-weight: normal;
  color: var(--ink-soft);
  font-size: 12px;
}

.pill .sep {
  opacity: 0.45;
}

.moon-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(35, 26, 20, 0.12);
  color: var(--ink);
}

body.phase-fullmoon .moon-badge {
  background: #7c1f2c;
  color: #f9e6e6;
}

/* El çizimi butonlar */
.sketch-btn {
  position: relative;
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--border-ink);
  border-radius: 9px 8px 10px 9px;
  padding: 5px 10px;
  font-family: inherit;
  font-weight: bold;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border-ink);
  transition: transform 0.1s ease, background 0.2s ease;
}

.sketch-btn:hover {
  background: var(--parchment-dark);
  transform: translateY(-1px);
}

.sketch-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--border-ink);
}

.sketch-btn.primary {
  background: var(--accent);
  color: #fdf6e9;
}

.sketch-btn.primary:hover {
  background: var(--accent-hover);
}

.sketch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.subtle-btn {
  font-size: 12.5px;
  padding: 7px 10px;
}

.icon-btn {
  padding: 7px 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b52b27;
  color: #fff;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 4px;
}

/* 3 Sütunlu Ana Düzen */
#main-layout {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  gap: 10px;
  align-items: stretch;
}

.side-panel {
  background: var(--parchment);
  border: 2.5px solid var(--border-ink);
  border-radius: 11px;
  padding: 0;
  box-shadow: 2px 3px 0 var(--border-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.25s ease;
}

.scroll-panel {
  background: linear-gradient(180deg, #e5d5b0 0%, var(--parchment) 14%, var(--parchment) 86%, #dfd0ae 100%);
}

.scroll-roller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #9b6c3e 0%, #6f4724 55%, #523217 100%);
  color: #fdf2d6;
  border-bottom: 2px solid var(--border-ink);
  flex-shrink: 0;
}

.scroll-roller .side-title {
  color: #fdf2d6;
  text-shadow: 0 1px 2px #1a0f07;
}

.bottom-roller {
  height: 12px;
  padding: 0;
  border-bottom: none;
  border-top: 2px solid var(--border-ink);
}

.scroll-toggle-btn {
  background: rgba(255, 244, 214, 0.2);
  color: #fdf2d6;
  border: 1.5px solid rgba(255, 244, 214, 0.55);
  border-radius: 6px;
  width: 24px;
  height: 22px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scroll-toggle-btn:hover {
  background: rgba(255, 244, 214, 0.35);
}

.scroll-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  flex: 1;
  min-height: 0;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.32s ease, opacity 0.22s ease, padding 0.25s ease;
}

.side-panel.rolled-up {
  align-self: flex-start;
  width: 205px !important;
}

.side-panel.rolled-up .scroll-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.shop-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.decor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.decor-tab {
  background: rgba(42, 31, 24, 0.1);
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  color: var(--ink);
}

.decor-tab.active {
  background: var(--accent);
  color: #fdf6e9;
}

#panel-inventory {
  width: 268px;
}

#panel-adventure {
  width: 288px;
}

.side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px dashed rgba(42, 31, 24, 0.3);
  padding-bottom: 5px;
}

.side-title {
  font-weight: bold;
  font-size: 13.5px;
  color: var(--ink);
}

.level-badge {
  background: var(--accent);
  color: #fdf6e9;
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: bold;
}

.hero-stats-box {
  background: rgba(255, 250, 240, 0.55);
  border: 1.5px solid rgba(42, 31, 24, 0.45);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.stat-label {
  width: 44px;
  font-weight: bold;
  flex-shrink: 0;
}

.stat-track {
  flex: 1;
  height: 9px;
  background: rgba(35, 26, 20, 0.16);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.hp-fill {
  background: linear-gradient(90deg, #b8322b, #df4e3e);
}

.xp-fill {
  background: linear-gradient(90deg, #4b6cb7, #6894e8);
}

.monster-fill {
  background: linear-gradient(90deg, #6b244c, #b53064);
}

.stat-val {
  font-size: 11px;
  font-weight: bold;
  min-width: 42px;
  text-align: right;
}

.hero-nums {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 12px;
}

.mini-stat {
  background: rgba(42, 31, 24, 0.09);
  border-radius: 6px;
  padding: 2px 7px;
}

.status-tag {
  font-size: 11px;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(42, 31, 24, 0.12);
  color: var(--ink);
}

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

.equip-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 4px;
  background: rgba(255, 250, 240, 0.6);
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  min-height: 48px;
  text-align: center;
}

.equip-slot:hover {
  background: var(--parchment-dark);
}

.slot-lbl {
  font-size: 10px;
  opacity: 0.72;
  font-weight: bold;
}

.slot-val {
  font-size: 11px;
  font-weight: bold;
  line-height: 1.15;
}

.inv-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.inv-tab {
  background: rgba(42, 31, 24, 0.1);
  border: 1.5px solid var(--border-ink);
  border-radius: 7px;
  padding: 4px 4px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  color: var(--ink);
}

.inv-tab.active {
  background: var(--accent);
  color: #fdf6e9;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
}

.side-scroll::-webkit-scrollbar,
.combat-log::-webkit-scrollbar {
  width: 6px;
}

.side-scroll::-webkit-scrollbar-thumb,
.combat-log::-webkit-scrollbar-thumb {
  background: rgba(42, 31, 24, 0.35);
  border-radius: 4px;
}

.inv-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 250, 240, 0.62);
  border: 2px solid var(--border-ink);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

.season-pill {
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}

.season-pill:hover {
  background: var(--parchment-dark);
}

.inv-card.rarity-common { border-left-color: #6b665d; }
.inv-card.rarity-rare { border-left-color: #2f6db5; }
.inv-card.rarity-epic { border-left-color: #8236a8; }
.inv-card.rarity-legendary { border-left-color: #c98a1c; background: rgba(255, 236, 178, 0.65); }
.inv-card.rarity-mythic { border-left-color: #c92a2a; background: rgba(255, 210, 210, 0.72); }
.inv-card.rarity-celestial { border-left-color: #0ca678; background: rgba(208, 250, 245, 0.78); }

.item-card.quest-mythic {
  border-color: #b81d24;
  background: rgba(255, 212, 212, 0.78);
}

.inv-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: bold;
}

.inv-card-desc {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.inv-card-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-btn {
  background: var(--parchment);
  color: var(--ink);
  border: 1.5px solid var(--border-ink);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.mini-btn:hover {
  background: var(--parchment-dark);
}

.mini-btn.primary {
  background: var(--accent);
  color: #fdf6e9;
}

/* Sağ Panel: Dünya Haritası & Savaş */
.minimap-wrap {
  border: 2px solid var(--border-ink);
  border-radius: 9px;
  overflow: hidden;
  background: #dfd0ad;
  box-shadow: inset 0 0 12px rgba(42, 31, 24, 0.25);
  flex-shrink: 0;
}

#world-minimap {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}

.zone-card {
  background: rgba(255, 250, 240, 0.62);
  border: 2px solid var(--border-ink);
  border-radius: 9px;
  padding: 8px 9px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.zone-card h4 {
  margin: 0;
  font-size: 13.5px;
}

.zone-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.adv-combat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  background: rgba(255, 246, 232, 0.65);
  border: 2px solid var(--border-ink);
  border-radius: 9px;
  padding: 7px 8px;
}

.combat-vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.combat-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.combat-name {
  font-size: 11.5px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combat-log {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  background: rgba(35, 26, 20, 0.08);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11.5px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.combat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.combat-actions #btn-retreat {
  grid-column: span 2;
}

.sketch-btn.active-mode {
  background: #c96228;
  color: #fff6e9;
}

@media (max-width: 1200px) {
  #panel-inventory { width: 225px; }
  #panel-adventure { width: 240px; }
}

/* 3D Sahne Alanı */
#stage-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#viewport-3d {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  border: 3px solid var(--border-ink);
  border-radius: 12px;
  box-shadow: 0 12px 30px var(--shadow);
  overflow: hidden;
  background: #1a120d;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* 3D üstü 2D etiket ve konuşma balonları */
#overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.world-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #f6ebd1;
  background: rgba(24, 16, 11, 0.72);
  border: 1.5px solid rgba(239, 227, 200, 0.35);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.order-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #fff4d6;
  color: #231a14;
  border: 2.5px solid #231a14;
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 2px 3px 0 rgba(20, 12, 8, 0.75);
  white-space: nowrap;
}

.order-bubble.waiting {
  background: #e3d4b4;
}

.cook-tray {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: 148px;
}

.cook-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #efe1be;
  border: 2px solid #1c130e;
  border-radius: 50%;
  font-size: 15px;
  box-shadow: 1.5px 2px 0 rgba(20, 12, 8, 0.7);
  overflow: hidden;
}

.cook-badge .cook-prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: #c96228;
}

.cook-badge.ready {
  background: #63d46e;
  border-color: #16421b;
  box-shadow: 0 0 8px rgba(99, 212, 110, 0.85), 1.5px 2px 0 rgba(20, 12, 8, 0.7);
  animation: pulseReady 0.95s infinite alternate;
}

@keyframes pulseReady {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.floating-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: 15px;
  text-shadow: -1.5px 0 #1c130e, 1.5px 0 #1c130e, 0 -1.5px #1c130e, 0 1.5px #1c130e;
  white-space: nowrap;
}

.patience-bar {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 38px;
  height: 6px;
  background: rgba(20, 14, 10, 0.8);
  border: 1.5px solid #1c130e;
  border-radius: 999px;
  overflow: hidden;
}

.patience-fill {
  height: 100%;
  transition: width 0.2s linear;
}

/* Alt Han Günlüğü */
#bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--parchment);
  border: 2.5px solid var(--border-ink);
  border-radius: 10px;
  padding: 7px 12px 8px;
  box-shadow: 2px 3px 0 var(--border-ink);
  font-size: 13px;
  flex-shrink: 0;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px dashed rgba(42, 31, 24, 0.25);
  padding-bottom: 4px;
}

.log-title {
  font-weight: bold;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.2px;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  height: 76px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: text;
}

.log-list::-webkit-scrollbar {
  width: 6px;
}

.log-list::-webkit-scrollbar-track {
  background: rgba(42, 31, 24, 0.08);
  border-radius: 4px;
}

.log-list::-webkit-scrollbar-thumb {
  background: rgba(42, 31, 24, 0.35);
  border-radius: 4px;
}

.log-entry {
  display: flex;
  align-items: baseline;
  gap: 7px;
  line-height: 1.35;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 2px 5px;
  border-radius: 5px;
}

.log-entry:first-child {
  color: var(--ink);
  font-weight: bold;
  background: rgba(42, 31, 24, 0.07);
}

.log-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(42, 31, 24, 0.12);
  color: var(--ink);
}

.log-entry.tone-fullmoon .log-tag {
  background: #7c1f2c;
  color: #f9e6e6;
}

.log-entry.tone-night .log-tag {
  background: #2b354f;
  color: #e6ecf8;
}

.carrying-pill {
  background: #e3c27b;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}

.injury-pill {
  background: #9e2a2b;
  color: #fff3e6;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

/* Modallar */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 5, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--parchment);
  border: 3px solid var(--border-ink);
  border-radius: 14px 12px 15px 11px;
  padding: 18px 20px;
  box-shadow: 5px 6px 0 var(--border-ink);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px dashed rgba(42, 31, 24, 0.3);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  background: transparent;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-weight: bold;
  cursor: pointer;
  color: var(--ink);
}

.modal-subtitle {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 250, 240, 0.55);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  padding: 10px 12px;
}

.item-info h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.item-info p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.item-meta {
  font-size: 12px;
  margin-top: 4px;
  font-weight: bold;
  color: #6b4423;
}

.event-desc {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 10px 0 16px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-list .sketch-btn {
  text-align: left;
  padding: 10px 14px;
}

.hidden {
  display: none !important;
}

/* Mobil Düzen & Alt Başparmak Çubuğu (Masaüstünde gizli) */
.mobile-dock,
.mobile-backdrop,
.mobile-edit-bar {
  display: none;
}

@media (max-width: 960px) {
  #app {
    padding: max(6px, env(safe-area-inset-top)) 6px max(4px, env(safe-area-inset-bottom));
    gap: 6px;
  }

  #hud {
    height: auto;
    min-height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 5px;
    padding-bottom: 2px;
  }

  #hud::-webkit-scrollbar {
    display: none;
  }

  .pill {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .sketch-btn {
    padding: 5px 9px;
    font-size: 11.5px;
  }

  /* Mobilde alt dock'ta bulunan masaüstü butonlarını üst HUD'da gizle */
  #btn-quests,
  #btn-decor,
  #btn-arrange,
  #btn-rotate-prop {
    display: none !important;
  }

  #main-layout {
    flex-direction: column;
    gap: 0;
  }

  #stage-wrap {
    flex: 1;
    width: 100%;
  }

  #viewport-3d {
    min-height: 220px;
    border-width: 2px;
    border-radius: 10px;
  }

  /* Alt Çekmeceler: Yan paneller + Günlük mobilde aşağıdan kayan çekmece olur */
  #panel-inventory,
  #panel-adventure,
  #bottom-bar {
    display: none;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: auto !important;
    max-height: 70dvh;
    z-index: 42;
    box-shadow: 0 -4px 26px rgba(0, 0, 0, 0.65), 3px 4px 0 var(--border-ink);
  }

  #panel-inventory.mobile-open,
  #panel-adventure.mobile-open,
  #bottom-bar.mobile-open {
    display: flex;
  }

  /* Mobilde açılan çekmeceler rulo kapalıysa bile her zaman tam açılsın */
  .side-panel.rolled-up .scroll-body {
    max-height: 1000px;
    opacity: 1;
    padding: 9px 10px;
  }

  .side-panel .scroll-toggle-btn {
    display: none;
  }

  #bottom-bar .log-list {
    height: 190px;
  }

  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 5, 3, 0.56);
    z-index: 40;
  }

  .mobile-edit-bar {
    display: flex;
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    gap: 8px;
    padding: 6px 10px;
    background: rgba(28, 19, 13, 0.85);
    border: 2px solid var(--border-ink);
    border-radius: 12px;
    z-index: 25;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }

  .mobile-edit-bar .sketch-btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12.5px;
  }

  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    width: 100%;
    flex-shrink: 0;
    padding: 4px 2px;
    background: rgba(24, 16, 11, 0.92);
    border-top: 2px solid var(--border-ink);
    border-radius: 10px;
    z-index: 45;
  }

  .dock-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 46px;
    background: var(--parchment);
    color: var(--ink);
    border: 2px solid var(--border-ink);
    border-radius: 8px;
    padding: 4px 2px;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 1.5px 1.5px 0 var(--border-ink);
  }

  .dock-btn .dock-ico {
    font-size: 16px;
    line-height: 1.05;
  }

  .dock-btn.active-dock {
    background: var(--accent);
    color: #fdf6e9;
  }

  .dock-btn .badge {
    position: absolute;
    top: 2px;
    right: 3px;
    width: 15px;
    height: 15px;
    font-size: 9.5px;
    margin: 0;
  }

  .mini-btn {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 12px;
  }

  .modal {
    padding: 8px;
  }

  .modal-card {
    max-width: 96vw;
    max-height: 84dvh;
    padding: 13px 12px;
  }

  .item-card {
    flex-direction: column;
    align-items: stretch;
  }

  .item-card > div:last-child {
    display: flex;
    justify-content: flex-end;
  }
}

/* Sims Tarzı Dekorasyon, Satış Standı, Pazarlık & Görev Ekibi */
.design-section {
  background: rgba(255, 250, 238, 0.72);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.design-section h3 {
  margin: 0 0 8px 0;
  font-size: 13.5px;
  color: var(--ink);
}
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 8px;
}
.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-ink);
  cursor: pointer;
  transition: transform 0.12s;
  box-shadow: 1px 1px 0 var(--border-ink);
}
.swatch-btn:hover { transform: scale(1.1); }
.swatch-btn.active {
  outline: 3px solid var(--gold);
  transform: scale(1.12);
}
.style-chip {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  font-family: inherit;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  background: var(--parchment);
  color: var(--ink);
  cursor: pointer;
}
.style-chip.active {
  background: var(--accent);
  color: #fff8eb;
}
.rarity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.rarity-tab {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  font-family: inherit;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  background: var(--parchment-dark);
  color: var(--ink);
  cursor: pointer;
}
.rarity-tab.active {
  background: var(--accent);
  color: #fff8eb;
}
.haggle-box {
  background: linear-gradient(135deg, rgba(255, 245, 220, 0.96), rgba(236, 215, 175, 0.96));
  border: 2px solid #8f4e2b;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 3px 3px 0 var(--border-ink);
}
.haggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.patience-track {
  width: 100%;
  height: 10px;
  background: rgba(35, 26, 20, 0.16);
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.patience-fill {
  height: 100%;
  background: linear-gradient(90deg, #c93b2b, #e0a636, #499c4f);
  transition: width 0.25s ease;
}
.haggle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quest-staff-bar {
  background: rgba(255, 249, 232, 0.85);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 10px;
}
.quest-staff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.staff-chip {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  font-family: inherit;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  background: var(--parchment);
  color: var(--ink);
  cursor: pointer;
}
.staff-chip.selected {
  background: #3d6e44;
  color: #fff;
}
.staff-chip.busy {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-sell {
  background: #8c2f2f;
  color: #fff5ea;
}
.btn-sell:hover:not(:disabled) {
  background: #a83939;
}
.btn-group-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#adv-battle-canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  background: #1b1714;
  margin-bottom: 6px;
}
.adv-comp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 4px 0 5px;
}
.adv-comp-row .staff-chip {
  font-size: 11px;
  padding: 2px 6px;
}
.adv-zone-select {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 6px;
  border: 2px solid var(--border-ink);
  border-radius: 7px;
  background: #fdf6e3;
  color: var(--ink);
  cursor: pointer;
}
.adv-combat {
  margin-top: 4px;
}
.adv-combat .combat-log {
  max-height: 76px;
  overflow-y: auto;
  font-size: 11.5px;
}
.adv-combat .combat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 5px;
}
.adv-combat .combat-actions #btn-skill-strike {
  grid-column: 1 / -1;
}
.staff-speech-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #fff8e6;
  color: #2b1a0e;
  border: 2px solid #7c2d12;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  max-width: 210px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 18;
}
.staff-speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border-width: 7px 6px 0 6px;
  border-style: solid;
  border-color: #7c2d12 transparent transparent transparent;
}
.guest-dialogue-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(255, 250, 238, 0.96);
  color: #2c1d11;
  border: 1.5px solid #8c5a2b;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  max-width: 220px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 16;
}
.guest-dialogue-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #8c5a2b transparent transparent transparent;
}
.recipe-lab-canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  background: #1d1510;
  margin-bottom: 6px;
}
.recipe-lab-summary {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  padding: 5px 8px;
  border-radius: 7px;
  margin-bottom: 6px;
  text-align: center;
}
.recipe-lab-ing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.recipe-lab-result {
  margin-top: 8px;
  padding: 8px 10px;
  border: 2px solid var(--border-ink);
  border-radius: 9px;
  background: #fff8e6;
  font-size: 12.5px;
}
.recipe-lab-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
  border: 2px solid var(--border-ink);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  margin: 5px 0;
}
.fame-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f3d27a, #d99f36);
  color: #2a1a0d;
  border: 1.5px solid var(--border-ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: bold;
}
.stand-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stand-item-art {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 2px solid var(--border-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #fff7e2, #d4bc8e);
  box-shadow: inset 0 0 8px rgba(0,0,0,0.18), 2px 2px 0 var(--border-ink);
}
.stand-item-art.art-rare { background: radial-gradient(circle at 35% 30%, #dbeafe, #60a5fa); border-color: #1d4ed8; }
.stand-item-art.art-epic { background: radial-gradient(circle at 35% 30%, #f3e8ff, #a855f7); border-color: #6b21a8; }
.stand-item-art.art-legendary { background: radial-gradient(circle at 35% 30%, #fef3c7, #f59e0b); border-color: #b45309; }
.stand-item-art.art-mythic { background: radial-gradient(circle at 35% 30%, #fee2e2, #ef4444); border-color: #991b1b; }
.stand-item-art.art-celestial { background: radial-gradient(circle at 35% 30%, #e0f2fe, #38bdf8); border-color: #0369a1; }
.stand-stats-line {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.stand-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  background: rgba(255, 248, 232, 0.78);
  border: 1.5px solid var(--border-ink);
  border-radius: 8px;
  font-size: 12px;
}
.floor-switcher {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(35, 26, 20, 0.78);
  border: 2px solid var(--gold);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}
.floor-btn {
  padding: 5px 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: bold;
  border: 1.5px solid var(--border-ink);
  border-radius: 7px;
  background: var(--parchment);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.floor-btn:hover { transform: translateY(-1px); }
.floor-btn.active {
  background: var(--accent);
  color: #fff8eb;
  border-color: var(--gold);
}

/* --- KİLER & MALZEME SIRT ÇANTASI HUD + PARŞÖMEN TARİF KARTI --- */
.pantry-hud {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 22;
  background: rgba(34, 24, 17, 0.9);
  border: 2px solid #8a6439;
  border-radius: 10px;
  padding: 7px 9px;
  color: #f6ebd4;
  min-width: 172px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.pantry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #f4d38b;
}
.pantry-alert {
  background: #b91c1c;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  animation: pantryPulse 1.1s infinite;
}
@keyframes pantryPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.pantry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.pantry-chip {
  background: rgba(255, 243, 214, 0.1);
  border: 1px solid rgba(212, 164, 70, 0.35);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}
.pantry-chip.low {
  background: rgba(185, 28, 28, 0.42);
  border-color: #f87171;
  color: #fecaca;
  font-weight: 700;
}
.pantry-actions {
  display: flex;
  gap: 5px;
}
.pantry-btn {
  flex: 1;
  background: #5c3a1e;
  color: #f6ebd4;
  border: 1px solid #b58442;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.pantry-btn:hover {
  background: #784b26;
}
.parchment-scroll-card {
  background: linear-gradient(135deg, #f7ebd2, #ead5a8);
  color: #3b2414;
  border: 2px solid #9c6b30;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: inset 0 0 12px rgba(139, 90, 43, 0.22);
}
.parchment-scroll-card h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  color: #5c2812;
}
.parchment-scroll-card p {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.4;
}

/* --- GECE 00:00 GÜNÜN KARNESİ (DAILY REPORT TOAST) --- */
.daily-report-toast {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: linear-gradient(145deg, #f8edd6, #e8d2a2);
  color: #3a2313;
  border: 2.5px solid #8a5a26;
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 390px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
}
.daily-report-toast h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: #5c2512;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.daily-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}
.daily-report-close {
  background: #5c3a1e;
  color: #f6ebd4;
  border: 1px solid #9c6b30;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
