/* Stranded — Minecraft-Style 3D Survival | JH Games */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ─── CANVAS ────────────────────────────────────────────────────────────────── */
canvas#gameCanvas {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  image-rendering: pixelated;
}

/* Crosshair cursor while pointer is locked */
body.playing { cursor: crosshair; }
body.playing canvas#gameCanvas { cursor: none; }

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* ─── SHARED MINECRAFT BUTTON ───────────────────────────────────────────────── */
.mc-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ffffff;
  background: linear-gradient(180deg, #555555 0%, #444444 100%);
  border: 2px outset #777777;
  padding: 8px 24px;
  cursor: pointer;
  text-shadow: 2px 2px 0 #1a1a1a;
  letter-spacing: 0.5px;
  transition: background 0.05s;
  image-rendering: pixelated;
  outline: none;
  display: inline-block;
}
.mc-btn:hover {
  background: linear-gradient(180deg, #666666 0%, #555555 100%);
  border-color: #888888;
  color: #ffff55;
}
.mc-btn:active {
  border-style: inset;
  transform: translateY(1px);
  background: linear-gradient(180deg, #444444 0%, #3a3a3a 100%);
}
.mc-btn:disabled {
  background: linear-gradient(180deg, #333 0%, #2a2a2a 100%);
  color: #666;
  cursor: not-allowed;
  border-color: #444;
}

/* ─── LOADING SCREEN ────────────────────────────────────────────────────────── */
#loadingScreen {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #000;
}
#loadingScreen .load-title {
  font-size: 20px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #555;
  margin-bottom: 32px;
  letter-spacing: 2px;
}
#loadingScreen .load-label {
  font-size: 10px;
  color: #aaaaaa;
  margin-bottom: 12px;
}
#loadingScreen .progress-track {
  width: 360px;
  height: 20px;
  background: #2a2a2a;
  border: 2px solid #555;
  position: relative;
  image-rendering: pixelated;
}
#loadingScreen .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #44FF88, #22cc66);
  width: 0%;
  transition: width 0.2s linear;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.2);
}
#loadingScreen .progress-pct {
  font-size: 9px;
  color: #aaa;
  margin-top: 8px;
}

/* ─── LOGIN SCREEN ──────────────────────────────────────────────────────────── */
#loginScreen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px,
      transparent 1px, transparent 64px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px,
      transparent 1px, transparent 64px
    ),
    linear-gradient(160deg, #3b2a1a 0%, #5a3e25 40%, #3b2a1a 100%);
}

#loginScreen .login-box {
  background: rgba(20, 14, 8, 0.97);
  border: 4px solid #5a3e25;
  outline: 2px solid #2a1a0a;
  padding: 36px 40px 32px;
  width: 420px;
  text-align: center;
  box-shadow: 0 0 0 4px rgba(90,62,37,0.3), 8px 8px 0 rgba(0,0,0,0.5);
  image-rendering: pixelated;
}

#loginScreen h1 {
  font-size: 26px;
  color: #ffffff;
  text-shadow: 3px 3px 0 #5a3e25, 5px 5px 0 #2a1a0a;
  margin-bottom: 4px;
  letter-spacing: 4px;
}
#loginScreen .subtitle {
  color: #8b6f4e;
  font-size: 8px;
  margin-bottom: 28px;
  letter-spacing: 1px;
}

#loginScreen input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 2px solid #555;
  background: #1a1a1a;
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  outline: none;
  image-rendering: pixelated;
}
#loginScreen input::placeholder { color: #555; }
#loginScreen input:focus {
  border-color: #FFD700;
  background: #222;
}

#loginScreen .btn {
  width: 100%;
  margin-bottom: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  cursor: pointer;
  padding: 10px 16px;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 #1a1a1a;
  border: 2px outset #777;
  transition: background 0.05s;
}
#loginScreen .btn:hover { color: #ffff55; border-color: #888; }
#loginScreen .btn:active { border-style: inset; transform: translateY(1px); }

#loginScreen .btn-primary {
  background: linear-gradient(180deg, #557755 0%, #446644 100%);
  color: #fff;
}
#loginScreen .btn-primary:hover {
  background: linear-gradient(180deg, #668866 0%, #557755 100%);
}
#loginScreen .btn-secondary {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #ccc;
}
#loginScreen .btn-secondary:hover {
  background: linear-gradient(180deg, #666 0%, #555 100%);
}
#loginScreen .btn-guest {
  background: transparent;
  color: #777;
  border: 2px solid #333;
  font-size: 9px;
}
#loginScreen .btn-guest:hover { color: #aaa; border-color: #555; }
#loginScreen .btn-guest:active { border-style: inset; }

#loginScreen .toggle-link {
  color: #aaaaaa;
  cursor: pointer;
  font-size: 8px;
  margin-top: 10px;
  display: block;
  text-decoration: underline;
}
#loginScreen .toggle-link:hover { color: #ffffff; }

#loginScreen .error {
  color: #FF2244;
  font-size: 8px;
  margin-bottom: 8px;
  min-height: 16px;
}

#loginScreen .branding {
  color: #4a3020;
  font-size: 7px;
  margin-top: 20px;
  letter-spacing: 1px;
}

/* ─── TITLE SCREEN ──────────────────────────────────────────────────────────── */
#titleScreen {
  position: fixed; inset: 0; z-index: 900;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}

#titleBg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #1a3a5a 0%, #2d5016 30%, #4a7c23 50%, #8B6914 70%, #3a2a1a 100%);
  z-index: 0;
}
#titleBg::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 60% 10%, rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 40% 15%, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 40px 40px, 100px 100px;
  animation: starsTwinkle 4s ease-in-out infinite alternate;
}
#titleBg::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 30px, rgba(0,0,0,0.03) 30px, rgba(0,0,0,0.03) 32px),
    repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(0,0,0,0.03) 30px, rgba(0,0,0,0.03) 32px);
  background-size: 32px 32px;
}

@keyframes starsTwinkle { 0% { opacity: 0.6; } 100% { opacity: 1; } }

#titleContent {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
}

#titleLogo {
  font-size: clamp(36px, 8vw, 64px);
  color: #4CAF50;
  text-shadow:
    3px 3px 0 #2E7D32,
    6px 6px 0 #1B5E20,
    -1px -1px 0 #81C784,
    0 0 30px rgba(76,175,80,0.3),
    0 0 60px rgba(76,175,80,0.15);
  letter-spacing: 8px;
  margin-bottom: 4px;
  animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

#titleScreen .splash {
  color: #FFFF00;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  transform: rotate(-8deg);
  animation: splashPulse 1.5s ease-in-out infinite;
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 #000;
}

@keyframes splashPulse {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(-8deg) scale(1.1); }
}

#titleScreen .tagline {
  color: #cccccc;
  font-size: 9px;
  margin-bottom: 24px;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 3px;
}

#seedRow {
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

#titleScreen .menu-btn {
  width: 320px;
  margin-bottom: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #ffffff;
  background: linear-gradient(180deg, #555555 0%, #3a3a3a 100%);
  border: 3px outset #777777;
  padding: 14px 24px;
  cursor: pointer;
  text-shadow: 2px 2px 0 #1a1a1a;
  letter-spacing: 1px;
  text-align: center;
  display: block;
  transition: all 0.15s;
  position: relative;
}
#titleScreen .menu-btn:hover {
  background: linear-gradient(180deg, #6a6a6a 0%, #555555 100%);
  border-color: #999;
  color: #ffff55;
  transform: scale(1.02);
}
#titleScreen .menu-btn:active {
  border-style: inset;
  transform: translateY(2px) scale(0.99);
}
#titleScreen .menu-btn.danger {
  background: linear-gradient(180deg, #663333 0%, #442222 100%);
  border-color: #884444;
  color: #ff6666;
}
#titleScreen .menu-btn.danger:hover {
  background: linear-gradient(180deg, #884444 0%, #663333 100%);
  color: #ff8888;
}

.title-footer {
  margin-top: 24px;
  display: flex; gap: 20px; align-items: center;
}
#titleScreen .branding {
  color: #888;
  font-size: 7px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
}
#titleScreen .version {
  color: #666;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  text-shadow: 1px 1px 0 #000;
}

/* ─── HUD CONTAINER ─────────────────────────────────────────────────────────── */
#hud {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none;
  display: none;
}
#hud > * { pointer-events: auto; }

/* ─── CROSSHAIR ─────────────────────────────────────────────────────────────── */
#crosshair {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: none;
  width: 22px; height: 22px;
  display: none;
}
#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: #ffffff;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.6);
}
/* horizontal bar */
#crosshair::before {
  width: 22px; height: 2px;
  top: 50%; left: 0;
  transform: translateY(-50%);
}
/* vertical bar */
#crosshair::after {
  width: 2px; height: 22px;
  left: 50%; top: 0;
  transform: translateX(-50%);
}

/* ─── HEARTS ────────────────────────────────────────────────────────────────── */
#hearts {
  position: fixed;
  bottom: 74px; left: 50%;
  transform: translateX(-50%) translateX(-110px);
  display: flex;
  gap: 2px;
  z-index: 12;
  pointer-events: none;
}
.heart-icon {
  width: 16px; height: 16px;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  display: inline-block;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #550011);
}
.heart-icon.full  { color: #FF2244; }
.heart-icon.half  { color: #FF2244; opacity: 0.55; }
.heart-icon.empty { color: #555555; }

/* ─── HUNGER ────────────────────────────────────────────────────────────────── */
#hunger {
  position: fixed;
  bottom: 74px; left: 50%;
  transform: translateX(-50%) translateX(110px);
  display: flex;
  flex-direction: row-reverse;
  gap: 2px;
  z-index: 12;
  pointer-events: none;
}
.hunger-icon {
  width: 16px; height: 16px;
  font-size: 13px;
  line-height: 16px;
  text-align: center;
  display: inline-block;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #331100);
}
.hunger-icon.full  { color: #CC8800; }
.hunger-icon.half  { color: #CC8800; opacity: 0.55; }
.hunger-icon.empty { color: #555555; }

/* ─── HOTBAR ────────────────────────────────────────────────────────────────── */
#hotbar {
  position: fixed;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  z-index: 12;
  background: #1a1a1a;
  border: 2px solid #555;
  outline: 2px solid #2a2a2a;
  padding: 3px;
  image-rendering: pixelated;
}

.hotbar-slot {
  width: 48px; height: 48px;
  background: #2a2a2a;
  border: 2px solid #555555;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  image-rendering: pixelated;
  transition: border-color 0.05s;
}
.hotbar-slot:hover { border-color: #888; }
.hotbar-slot.active {
  border-color: #FFD700;
  box-shadow: inset 0 0 6px rgba(255,215,0,0.25);
  background: #333;
}
.hotbar-slot .slot-key {
  position: absolute;
  top: 2px; left: 3px;
  font-size: 7px;
  color: #777;
  font-family: 'Press Start 2P', monospace;
  pointer-events: none;
}
.hotbar-slot .slot-count {
  position: absolute;
  bottom: 2px; right: 3px;
  font-size: 8px;
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
}
.hotbar-slot .item-icon {
  font-size: 24px;
  image-rendering: pixelated;
  pointer-events: none;
}
.hotbar-slot img.item-img {
  width: 32px; height: 32px;
  image-rendering: pixelated;
  pointer-events: none;
}

/* ─── BLOCK NAME DISPLAY ─────────────────────────────────────────────────────── */
#blockName {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  font-size: 9px;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
  white-space: nowrap;
  display: none;
}

/* ─── DAY / NIGHT INDICATOR ──────────────────────────────────────────────────── */
#dayNight {
  position: fixed;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.6);
  border: 2px solid #555;
  padding: 5px 12px;
  pointer-events: none;
}
#dayNight .dn-icon {
  font-size: 14px;
  line-height: 1;
}
#dayNight .dn-label {
  font-size: 8px;
  color: #FFD700;
  text-shadow: 1px 1px 0 #000;
}
#dayNight .dn-time {
  font-size: 8px;
  color: #aaaaaa;
}

/* ─── INVENTORY PANEL ────────────────────────────────────────────────────────── */
#inventoryPanel {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.65);
}

#inventoryPanel .inv-window {
  background: #2a2a2a;
  border: 4px solid #555;
  outline: 2px solid #3a3a3a;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.6);
  image-rendering: pixelated;
}
#inventoryPanel .inv-title {
  font-size: 11px;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
}

/* Inventory 27-slot main grid (3 rows × 9) */
.inv-grid-main {
  display: grid;
  grid-template-columns: repeat(9, 46px);
  gap: 3px;
}
/* Hotbar row inside inventory */
.inv-grid-hotbar {
  display: grid;
  grid-template-columns: repeat(9, 46px);
  gap: 3px;
  margin-top: 4px;
  border-top: 2px solid #444;
  padding-top: 8px;
}

/* generic inv slot */
.inv-slot {
  width: 46px; height: 46px;
  background: #555555;
  border: 1px solid #333333;
  outline: 1px solid #6a6a6a;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  image-rendering: pixelated;
  transition: background 0.05s;
}
.inv-slot:hover { background: #6a6a6a; outline-color: #ffffff; }
.inv-slot.selected { outline: 2px solid #FFD700; background: #5a5a3a; }

.inv-slot .item-icon {
  font-size: 22px;
  pointer-events: none;
  image-rendering: pixelated;
}
.inv-slot img.item-img {
  width: 30px; height: 30px;
  image-rendering: pixelated;
  pointer-events: none;
}
.inv-slot .slot-count {
  position: absolute;
  bottom: 1px; right: 2px;
  font-size: 8px;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
}

/* Inventory bottom row: crafting + right section */
.inv-bottom-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ─── CRAFTING GRID ──────────────────────────────────────────────────────────── */
.crafting-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crafting-grid {
  display: grid;
  grid-template-columns: repeat(2, 46px);
  gap: 3px;
}
.craft-arrow {
  font-size: 18px;
  color: #aaaaaa;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
.craft-output {
  width: 46px; height: 46px;
  background: #3a3a2a;
  border: 2px solid #FFD700;
  outline: 1px solid #aa8800;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  cursor: pointer;
  image-rendering: pixelated;
}
.craft-output:hover { background: #4a4a3a; }
.craft-output .slot-count {
  position: absolute;
  bottom: 1px; right: 2px;
  font-size: 8px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

/* ─── ITEM TOOLTIP ───────────────────────────────────────────────────────────── */
#itemTooltip {
  position: fixed;
  z-index: 200;
  background: #1a1a1a;
  border: 2px solid #ffffff;
  outline: 1px solid #555;
  padding: 8px 12px;
  pointer-events: none;
  display: none;
  max-width: 220px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.7);
  image-rendering: pixelated;
}
#itemTooltip .tt-name {
  font-size: 9px;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 4px;
}
#itemTooltip .tt-type {
  font-size: 7px;
  color: #aaaaaa;
  margin-bottom: 4px;
}
#itemTooltip .tt-desc {
  font-size: 7px;
  color: #aaaaaa;
  line-height: 1.6;
  margin-top: 4px;
  border-top: 1px solid #333;
  padding-top: 4px;
}
#itemTooltip .tt-stats {
  font-size: 7px;
  color: #44FF88;
  margin-top: 4px;
}

/* ─── PAUSE MENU ─────────────────────────────────────────────────────────────── */
#pausePanel {
  position: fixed; inset: 0; z-index: 60;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.72);
}
#pausePanel h2 {
  font-size: 28px;
  color: #ffffff;
  text-shadow: 4px 4px 0 #333, 6px 6px 0 #000;
  letter-spacing: 4px;
  margin-bottom: 36px;
}
#pausePanel .menu-btn {
  width: 280px;
  margin-bottom: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ffffff;
  background: linear-gradient(180deg, #555555 0%, #444444 100%);
  border: 2px outset #777777;
  padding: 12px 24px;
  cursor: pointer;
  text-shadow: 2px 2px 0 #1a1a1a;
  letter-spacing: 0.5px;
  display: block;
  text-align: center;
}
#pausePanel .menu-btn:hover {
  background: linear-gradient(180deg, #666666 0%, #555555 100%);
  border-color: #888;
  color: #ffff55;
}
#pausePanel .menu-btn:active {
  border-style: inset;
  transform: translateY(1px);
}

/* ─── DEATH SCREEN ───────────────────────────────────────────────────────────── */
#deathScreen {
  position: fixed; inset: 0; z-index: 80;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(90, 0, 0, 0.78);
}
#deathScreen h1 {
  font-size: 36px;
  color: #FF2244;
  text-shadow: 4px 4px 0 #550011, 7px 7px 0 #000;
  letter-spacing: 4px;
  margin-bottom: 18px;
}
#deathScreen .death-info {
  font-size: 9px;
  color: #cc8888;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 10px;
  text-align: center;
  line-height: 2;
}
#deathScreen .menu-btn {
  width: 260px;
  margin-top: 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ffffff;
  background: linear-gradient(180deg, #662222 0%, #551111 100%);
  border: 2px outset #994444;
  padding: 12px 24px;
  cursor: pointer;
  text-shadow: 2px 2px 0 #1a1a1a;
  display: block;
  text-align: center;
}
#deathScreen .menu-btn:hover {
  background: linear-gradient(180deg, #883333 0%, #662222 100%);
  border-color: #bb5555;
  color: #ffff55;
}
#deathScreen .menu-btn:active {
  border-style: inset;
  transform: translateY(1px);
}

/* ─── ADMIN PANEL ────────────────────────────────────────────────────────────── */
#adminPanel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  display: none;
  background: #1a1a1a;
  border: 3px solid #FFD700;
  outline: 2px solid #aa8800;
  padding: 24px 28px;
  width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.7);
  image-rendering: pixelated;
}
#adminPanel .admin-title {
  font-size: 14px;
  color: #FFD700;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 2px;
  margin-bottom: 18px;
}
#adminPanel .admin-section {
  font-size: 8px;
  color: #aaaaaa;
  margin-bottom: 8px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}
#adminPanel .admin-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#adminPanel select,
#adminPanel input[type="number"],
#adminPanel input[type="text"] {
  padding: 5px 8px;
  background: #2a2a2a;
  border: 2px solid #555;
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  outline: none;
  flex: 1;
  min-width: 80px;
}
#adminPanel select:focus,
#adminPanel input:focus { border-color: #FFD700; }
#adminPanel .admin-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffffff;
  background: linear-gradient(180deg, #665500 0%, #554400 100%);
  border: 2px outset #998800;
  padding: 5px 12px;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}
#adminPanel .admin-btn:hover {
  background: linear-gradient(180deg, #887700 0%, #665500 100%);
  color: #ffff55;
}
#adminPanel .admin-btn:active {
  border-style: inset;
  transform: translateY(1px);
}
#adminPanel .admin-btn.danger {
  background: linear-gradient(180deg, #661111 0%, #551111 100%);
  border-color: #992222;
}
#adminPanel .admin-btn.danger:hover {
  background: linear-gradient(180deg, #882222 0%, #661111 100%);
}

.admin-tab {
  flex: 1;
  background: linear-gradient(180deg, #444 0%, #333 100%);
  border: 2px outset #555;
  color: #aaa;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 6px 4px;
  cursor: pointer;
}
.admin-tab:hover { background: linear-gradient(180deg, #555 0%, #444 100%); color: #fff; }
.admin-tab.active { background: linear-gradient(180deg, #665500 0%, #443300 100%); color: #FFD700; border-color: #FFD700; }
.adm-page { max-height: 300px; overflow-y: auto; }

/* ─── NOTIFICATION TOASTS ────────────────────────────────────────────────────── */
#notifications {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.notif {
  background: #1a1a1a;
  border: 2px solid #555555;
  padding: 7px 16px;
  font-size: 9px;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
  animation: notifSlide 0.25s ease-out, notifFade 0.4s 2.6s forwards;
  image-rendering: pixelated;
}
@keyframes notifSlide {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes notifFade {
  to { opacity: 0; transform: translateY(-8px); }
}
/* Types */
.notif-pickup  { border-color: #44FF88; color: #44FF88; }
.notif-craft   { border-color: #4488FF; color: #88ccff; }
.notif-warn    { border-color: #FF2244; color: #ff8888; }
.notif-info    { border-color: #FFD700; color: #FFD700; }
.notif-system  { border-color: #aa44ff; color: #cc88ff; }

/* ─── INTERACT PROMPT ────────────────────────────────────────────────────────── */
#interactPrompt {
  position: fixed;
  bottom: 140px; left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: none;
  font-size: 8px;
  color: #FFD700;
  text-shadow: 1px 1px 0 #000;
  background: rgba(0,0,0,0.65);
  border: 2px solid #555;
  padding: 6px 14px;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── XP BAR ─────────────────────────────────────────────────────────────────── */
#xpBar {
  position: fixed;
  bottom: 64px; left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  width: 452px; /* 9*48 + 8*4 + 2*3 padding for hotbar alignment */
  height: 5px;
  background: #1a1a1a;
  border: 1px solid #333;
  pointer-events: none;
}
#xpBar .xp-fill {
  height: 100%;
  background: #44FF88;
  transition: width 0.3s;
  box-shadow: 0 0 4px #44FF88;
}

/* ─── FLOATING DAMAGE TEXT ───────────────────────────────────────────────────── */
.dmg-float {
  position: fixed;
  z-index: 20;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #FF2244;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
}
.dmg-float.heal { color: #44FF88; }
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  40%  { opacity: 1; transform: translateY(-20px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}

/* ─── MAP PANEL ──────────────────────────────────────────────────────────────── */
#mapPanel {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8);
}
#mapPanel canvas {
  border: 4px solid #555;
  outline: 2px solid #333;
  image-rendering: pixelated;
}

/* ─── MISC OVERLAYS ──────────────────────────────────────────────────────────── */

/* Vignette when taking damage */
#damageVignette {
  position: fixed; inset: 0; z-index: 9;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255,0,0,0.45) 100%);
  opacity: 0;
  transition: opacity 0.1s;
}
#damageVignette.active { opacity: 1; }
#damageVignette.fade   { opacity: 0; transition: opacity 0.8s; }

/* Underwater tint */
#underwaterOverlay {
  position: fixed; inset: 0; z-index: 8;
  pointer-events: none;
  background: rgba(0, 40, 80, 0.5);
  display: none;
}

/* ─── UTILITIES ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex !important; }
.pixel-text { font-family: 'Press Start 2P', monospace; image-rendering: pixelated; }
