/* ── Reset ──────────────────────────────────────────────────────────────── */
body {
  width: 100%; height: 100%;
  position: absolute;
  background: #000;
  margin: 0; padding: 0;
  overscroll-behavior: none;
  font-family: 'IM Fell French Canon', serif;
}

.container {
  width: 100%; height: 100%;
  position: relative;
}

.ui {
  width: 100%; height: 100%;
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}

/* Anything inside .ui that should receive clicks */
.icon-bar-item,
.inventory-item,
button,
#dialogue-next {
  pointer-events: auto;
}

/* ── Quest journal ──────────────────────────────────────────────────────── */
.quest-journal-layout {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-end;
}

.quest-journal {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(180,160,80,0.4);
  margin: 30px;
  padding: 10px 16px;
  width: 270px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 1;
  border-radius: 6px;
}

.quest-entry {
  font-size: 1.2em;
  color: #e0d090;
  border-bottom: 1px solid rgba(200,180,80,0.25);
  padding: 5px 0;
}

/* ── Quest UI (centre popup) ─────────────────────────────────────────────── */
.quest-ui-layout {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.quest-ui {
  background: rgba(0,0,0,0.82);
  border: 2px solid rgba(180,150,60,0.6);
  padding: 24px 28px;
  width: 680px;
  max-width: 90vw;
  z-index: 2;
  border-radius: 8px;
  pointer-events: auto;
}

.quest-title { font-size: 2.5em; color: #f0d070; text-shadow: 2px 2px #000; }
.quest-text-title { font-size: 2.2em; color: #f0d070; padding-bottom: 10px; }
.quest-text { font-size: 1em; color: #e0e0d0; line-height: 1.6; }

/* ── Icon bar ────────────────────────────────────────────────────────────── */
.icon-ui {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
}

.icon-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  z-index: 1;
}

.icon-bar-item {
  background-size: cover;
  width: 70px; height: 70px;
  margin: 3px;
  border-radius: 8px;
  border: 2px solid rgba(180,160,80,0.4);
  cursor: pointer;
  transition: border-color 0.15s;
  pointer-events: auto;
}
.icon-bar-item:hover {
  border-color: rgba(255,220,80,0.8);
}

/* ── Health bar ──────────────────────────────────────────────────────────── */
.health-ui {
  background-image: url('./resources/icons/ui/health-bar.png');
  width: 500px; height: 300px;
  z-index: 1;
}

.health-bar {
  background: linear-gradient(90deg, #88ff44, #44ff44);
  width: 200px; max-width: 200px;
  height: 38px;
  position: relative;
  top: 215px; left: 260px;
  border: 2px solid #000;
  border-radius: 5px;
  box-shadow: 0 0 6px rgba(0,255,50,0.5);
  transition: width 0.15s;
}

/* ── Stats panel ──────────────────────────────────────────────────────────── */
.stats-tooltip {
  position: relative; display: inline-block; z-index: 100;
  cursor: help;
}
.stats-tooltip .stats-tooltiptext {
  visibility: hidden;
  width: 200px;
  background: rgba(0,0,0,0.9);
  color: #ddd;
  font-size: 0.8em;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  top: -5px; right: 105%;
  border: 1px solid rgba(180,160,60,0.4);
}
.stats-tooltip:hover .stats-tooltiptext { visibility: visible; }

.stats-title { font-size: 2em; color: #f0d070; text-shadow: 2px 2px #000; }

.stats {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin: 30px;
  z-index: 1;
  pointer-events: auto;
}

.stats-inner {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.78);
  border: 1px solid rgba(180,150,60,0.4);
  padding: 14px 18px;
  width: 230px;
  border-radius: 8px;
}

.stats-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-size: 1.5em;
  color: #e0e0c0;
  text-shadow: 2px 2px #000;
  padding: 2px 0;
}

/* ── Inventory ────────────────────────────────────────────────────────────── */
.inventory-title { font-size: 2em; color: #f0d070; text-shadow: 2px 2px #000; }

.inventory {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin: 30px;
  z-index: 1;
  pointer-events: auto;
}

.inventory-inner {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.82);
  border: 1px solid rgba(180,150,60,0.4);
  padding: 14px 16px;
  border-radius: 8px;
}

.inventory-row { display: flex; flex-direction: row; justify-content: space-evenly; }
.inventory-column { display: flex; flex-direction: column; justify-content: space-evenly; }

.inventory-character {
  background-image: url('./resources/icons/ui/inventory-character.png');
  background-size: cover;
  width: 180px; height: 340px;
}

.inventory-item {
  border: 2px solid rgba(100,100,100,0.7);
  border-radius: 6px;
  background-color: rgba(20,20,20,0.8);
  width: 50px; height: 50px;
  margin: 2px;
  background-size: cover;
  cursor: pointer;
  transition: border-color 0.12s;
}
.inventory-item:hover { border-color: rgba(255,220,80,0.8); }

/* ── Minimap ──────────────────────────────────────────────────────────────── */
.minimap-container {
  position: absolute;
  bottom: 100px;
  left: 18px;
  z-index: 5;
  pointer-events: auto;
  user-select: none;
}

.minimap-title {
  color: #d4a030;
  font-size: 0.8em;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 3px;
  text-shadow: 1px 1px #000;
}

#minimap-canvas {
  display: block;
  border-radius: 6px;
  border: 2px solid rgba(120, 90, 30, 0.7);
  box-shadow: 0 0 12px rgba(0,0,0,0.7);
  image-rendering: pixelated;
}

/* ── NPC Dialogue box ─────────────────────────────────────────────────────── */
.dialogue-ui {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  padding: 0 60px 20px 60px;
  gap: 20px;
  z-index: 10;
  pointer-events: auto;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.dialogue-portrait {
  flex-shrink: 0;
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(200,170,60,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5em;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px #000;
  background: #334466;
  box-shadow: 0 0 16px rgba(0,0,0,0.6);
  margin-bottom: 4px;
}

.dialogue-body {
  flex: 1;
  background: rgba(0,0,0,0.88);
  border: 2px solid rgba(180,150,60,0.55);
  border-radius: 10px;
  padding: 16px 20px 12px 20px;
  max-width: 860px;
}

.dialogue-name {
  font-size: 1.4em;
  color: #f0d070;
  text-shadow: 1px 1px #000;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.dialogue-text {
  font-size: 1em;
  color: #e8e8d8;
  line-height: 1.65;
  min-height: 2.5em;
  font-family: 'IM Fell English', serif;
}

.dialogue-next {
  margin-top: 10px;
  padding: 6px 18px;
  background: rgba(160,130,40,0.85);
  border: 1px solid rgba(220,190,60,0.6);
  border-radius: 5px;
  color: #fff;
  font-family: 'IM Fell French Canon', serif;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.15s;
  float: right;
}
.dialogue-next:hover { background: rgba(200,160,50,0.95); }

/* ── Day/Night HUD ────────────────────────────────────────────────────────── */
.daytime-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(200,180,80,0.35);
  border-radius: 20px;
  padding: 4px 18px;
  color: #f0e080;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}

#daytime-icon { font-size: 1.2em; }

/* ── Interaction hint ─────────────────────────────────────────────────────── */
.interact-hint {
  position: absolute;
  bottom: 105px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(200,180,80,0.4);
  color: #e8e8c0;
  padding: 5px 18px;
  border-radius: 16px;
  font-size: 0.85em;
  pointer-events: none;
  z-index: 5;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1;   }
}
