/* =============================================================
   Chest Dash — MC Inventory Chaos Game
   Androdom Design System + MC Override Palette
   ============================================================= */

/* ── 0. MC Color Variables ─────────────────────────────────── */
:root {
  --mc-dirt:      #6B4226;
  --mc-dirt-l:    #8B6914;
  --mc-stone:     #5C5C5C;
  --mc-stone-l:   #9D9D9D;
  --mc-grass:     #4A7C2F;
  --mc-grass-b:   #5D9B47;
  --mc-wood:      #BC9862;
  --mc-obsidian:  #1B1029;
  --mc-gold:      #FCDB05;
  --mc-redstone:  #CC0000;
  --mc-diamond:   #2CCDB1;
  --mc-emerald:   #17AE62;
  --mc-ender:     #0E0620;
  --mc-lapis:     #1D3EA8;
  --mc-iron:      #D0CECA;
  --mc-netherite: #47393A;
  --mc-hp-red:    #E3160E;
  --mc-hp-dark:   #6B0A06;

  /* Item placeholder colors */
  --item-dirt:         #8B6914;
  --item-stone:        #7F7F7F;
  --item-wood:         #A0784C;
  --item-grass:        #5D9B47;
  --item-diamond:      #2CCDB1;
  --item-gold:         #FCDB05;
  --item-iron:         #C8C8C8;
  --item-redstone:     #CC2200;
  --item-lapis:        #3355BB;
  --item-emerald:      #17AE62;
  --item-obsidian:     #3B2850;
  --item-coal:         #2D2D2D;
  --item-sand:         #DEC680;
  --item-gravel:       #7B6F6A;
  --item-ender:        #5C2E7E;
  /* Weapons */
  --item-wood-sword:   #A0784C;
  --item-stone-sword:  #7F7F7F;
  --item-iron-sword:   #C8C8C8;
  --item-gold-sword:   #FCDB05;
  --item-diamond-sword:#2CCDB1;
  --item-nether-sword: #47393A;
  /* Armor */
  --item-leather:      #A06040;
  --item-iron-armor:   #A8A8A8;
  --item-diamond-armor:#2CCDB1;
  --item-nether-armor: #3A2A30;

  /* Androdom dark-mode theme */
  --bg-main:        #0a0a0a;
  --bg-surface:     #111318;
  --bg-card:        #1a1f2b;
  --border-color:   #2a3040;
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color:   #6366f1;
  --bg-hover:       #1e293b;
}

html[data-theme="light"] {
  --bg-main:        #d4c5a9;
  --bg-surface:     #c8b990;
  --bg-card:        #f5efe0;
  --border-color:   #a08060;
  --text-primary:   #1a0e05;
  --text-secondary: #4a3520;
  --accent-color:   #4f46e5;
  --bg-hover:       #e8d9bc;
}

/* ── 1. Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── 2. MC Background Pattern ─────────────────────────────── */
.mc-bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(0,0,0,0.06) 15px, rgba(0,0,0,0.06) 16px),
    repeating-linear-gradient(90deg, transparent, transparent 15px, rgba(0,0,0,0.06) 15px, rgba(0,0,0,0.06) 16px);
}

html[data-theme="light"] .mc-bg-pattern {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(90,60,20,0.08) 15px, rgba(90,60,20,0.08) 16px),
    repeating-linear-gradient(90deg, transparent, transparent 15px, rgba(90,60,20,0.08) 15px, rgba(90,60,20,0.08) 16px);
}

/* ── 3. Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: 52px;
}
html[data-theme="light"] .navbar { background: rgba(180, 150, 100, 0.92); }

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.brand-link {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--text-primary);
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.brand-text-accent { color: var(--accent-color); }

.tool-pill-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.2rem 0.75rem 0.2rem 0.6rem;
}
html[data-theme="light"] .tool-pill-wrapper { background: rgba(0,0,0,0.08); }

.tool-pill-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.tool-pill-nav { display: flex; }
.tool-pill-active {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem; font-weight: 700; color: var(--mc-gold); text-decoration: none;
}

.right-cluster { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle-btn, .portal-btn, .github-link {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-hover); border: 1px solid var(--border-color); border-radius: 0.5rem;
  color: var(--text-secondary); cursor: pointer; font-size: 0.78rem; font-weight: 500;
  text-decoration: none; transition: color 0.2s, background 0.2s;
}
.theme-toggle-btn:hover, .portal-btn:hover, .github-link:hover { color: var(--text-primary); background: var(--border-color); }
.portal-btn span { font-size: 0.75rem; }

/* ── 4. Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  position: relative;
  z-index: 10;
  background: rgba(10,10,10,0.75);
  border-bottom: 2px solid var(--mc-stone);
  backdrop-filter: blur(8px);
  padding: 0.4rem 1.5rem;
}
html[data-theme="light"] .stats-bar { background: rgba(160,120,60,0.85); border-color: var(--mc-dirt); }

.stats-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
}

.stat-icon { font-size: 0.9rem; }
.stat-label { color: var(--text-secondary); }
.stat-value { color: var(--mc-gold); }

/* Hearts */
.hearts-row {
  display: flex;
  gap: 1px;
  align-items: center;
}
.heart {
  font-size: 0.8rem;
  line-height: 1;
  transition: opacity 0.2s;
}
.heart.empty { opacity: 0.2; filter: grayscale(1); }

/* Tier badge */
.tier-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
}
.tier-beginner  { color: var(--mc-stone-l); }
.tier-explorer  { color: var(--mc-emerald); }
.tier-warrior   { color: var(--mc-diamond); }
.tier-chaotic   { color: var(--mc-redstone); }
.tier-legendary { color: var(--mc-gold); }

/* ── 5. Game Workspace Layout ─────────────────────────────── */
.game-workspace {
  position: relative; z-index: 1; flex: 1;
  display: flex; gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  max-width: 1400px; margin: 0 auto; width: 100%;
}

.game-left { flex: 1; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.game-right { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }

/* ── 6. MC Section Panel ───────────────────────────────────── */
.mc-section {
  position: relative;
  background: rgba(20, 20, 20, 0.82);
  border: 2px solid var(--mc-stone);
  border-radius: 4px;
  padding: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 4px 4px 0 rgba(0,0,0,0.5);
  transition: z-index 0.1s;
}
.mc-section:hover {
  z-index: 10;
}
html[data-theme="light"] .mc-section {
  background: rgba(200, 175, 130, 0.9);
  border-color: var(--mc-dirt);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 4px 4px 0 rgba(80,50,20,0.4);
}

.mc-section-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem; color: var(--mc-stone-l);
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
html[data-theme="light"] .mc-section-header { color: #5a3a15; }
.mc-section-icon { font-size: 0.9rem; }

/* Chest shortcuts */
.chest-shortcuts {
  display: flex; gap: 0.3rem; margin-left: auto; flex-wrap: wrap;
}

.shortcut-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  padding: 0.2rem 0.4rem;
  background: var(--bg-hover);
  border: 1px solid var(--mc-stone);
  border-radius: 2px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.shortcut-btn:hover { color: var(--mc-gold); background: var(--border-color); }

/* ── 7. Inventory Grid & Slots ─────────────────────────────── */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
}

.mc-slot {
  aspect-ratio: 1;
  background: #313131;
  border: 2px solid;
  border-top-color: #1a1a1a;
  border-left-color: #1a1a1a;
  border-right-color: #7a7a7a;
  border-bottom-color: #7a7a7a;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.1s;
  min-width: 0;
  overflow: visible;
  user-select: none;
}
html[data-theme="light"] .mc-slot {
  background: #a09080;
  border-top-color: #7a6a5a; border-left-color: #7a6a5a;
  border-right-color: #d0c0a0; border-bottom-color: #d0c0a0;
}

.mc-slot:hover { filter: brightness(1.35); z-index: 99; }
.mc-slot.drag-over { filter: brightness(1.8); border-color: var(--mc-diamond) !important; }
.mc-slot.dragging-source { opacity: 0.3; }
.mc-slot.selected-slot { outline: 2px solid var(--mc-gold); outline-offset: -2px; }
.mc-slot.shift-hint { background: rgba(44,205,177,0.12); }

/* Hotbar */
.mc-hotbar { margin-top: 4px; }
.mc-hotbar .mc-slot {
  border-top-color: #a08020; border-left-color: #a08020;
  border-right-color: var(--mc-gold); border-bottom-color: var(--mc-gold);
  background: #3a3010;
}
html[data-theme="light"] .mc-hotbar .mc-slot {
  background: #c8a840;
  border-top-color: #906010; border-left-color: #906010;
  border-right-color: #f0d060; border-bottom-color: #f0d060;
}

.mc-hotbar-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem; color: var(--mc-gold);
  text-transform: uppercase; margin: 0.4rem 0 0.2rem;
  letter-spacing: 0.08em;
}

.mc-item {
  width: 78%; height: 78%;
  border-radius: 2px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  image-rendering: pixelated;
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,0.4), inset 2px 2px 0 rgba(255,255,255,0.2);
}

.mc-item-count {
  position: absolute; bottom: -2px; right: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem; color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  line-height: 1;
}

/* Weapon indicator glyph */
.mc-item-glyph {
  font-size: 0.6rem;
  position: absolute;
  top: 0; left: 0;
  line-height: 1;
  filter: drop-shadow(1px 1px 0 #000);
}

/* Item colors — blocks */
.item-dirt     { background-color: var(--item-dirt); }
.item-stone    { background-color: var(--item-stone); }
.item-wood     { background-color: var(--item-wood); }
.item-grass    { background-color: var(--item-grass); }
.item-diamond  { background-color: var(--item-diamond); }
.item-gold     { background-color: var(--item-gold); }
.item-iron     { background-color: var(--item-iron); }
.item-redstone { background-color: var(--item-redstone); }
.item-lapis    { background-color: var(--item-lapis); }
.item-emerald  { background-color: var(--item-emerald); }
.item-obsidian { background-color: var(--item-obsidian); }
.item-coal     { background-color: var(--item-coal); }
.item-sand     { background-color: var(--item-sand); }
.item-gravel   { background-color: var(--item-gravel); }
.item-ender    { background-color: var(--item-ender); }
.item-apple        { background-color: #7f0000; }
.item-stick        { background-color: #523418; }
.item-tnt          { background-color: #b71c1c; }
.item-bone         { background-color: #9e9e9e; }
.item-rotten-flesh { background-color: #558b2f; }
.item-slimeball    { background-color: #4caf50; }
.item-golden-apple { background-color: #ff6f00; }
.item-bucket       { background-color: #616161; }
.item-book         { background-color: #4e342e; }
.item-ender-eye    { background-color: #004d40; }

/* Item colors — weapons */
.item-wood-sword    { background-color: var(--item-wood-sword); }
.item-stone-sword   { background-color: var(--item-stone-sword); }
.item-iron-sword    { background-color: var(--item-iron-sword); }
.item-gold-sword    { background-color: var(--item-gold-sword); }
.item-diamond-sword { background-color: var(--item-diamond-sword); }
.item-nether-sword  { background-color: var(--item-nether-sword); }
/* Item colors — armor */
.item-leather      { background-color: var(--item-leather); }
.item-iron-armor   { background-color: var(--item-iron-armor); }
.item-diamond-armor{ background-color: var(--item-diamond-armor); }
.item-nether-armor { background-color: var(--item-nether-armor); }

/* ── 9. Steve Button ──────────────────────────────────────── */
.steve-section { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }

.steve-btn {
  width: 100%; padding: 1rem 0.5rem;
  background: #3a6e26;
  border: none;
  border-top: 3px solid #5daa40; border-left: 3px solid #5daa40;
  border-right: 3px solid #1e400f; border-bottom: 3px solid #1e400f;
  border-radius: 3px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  transition: transform 0.1s, filter 0.1s;
  box-shadow: 0 4px 0 #0d200a;
}
.steve-btn:hover { filter: brightness(1.2); }
.steve-btn:active {
  transform: translateY(3px); box-shadow: 0 1px 0 #0d200a;
  border-top-color: #1e400f; border-left-color: #1e400f;
  border-right-color: #5daa40; border-bottom-color: #5daa40;
}
.steve-btn.triggered { animation: steve-pulse 0.4s ease; }
.steve-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.5); }

@keyframes steve-pulse {
  0%  { filter: brightness(1); }
  30% { filter: brightness(2.5); }
  100%{ filter: brightness(1); }
}

.steve-emoji { font-size: 2.5rem; display: block; transition: transform 0.15s; }
.steve-btn:active .steve-emoji { transform: translateX(8px); }
.steve-label { font-family: 'Press Start 2P', monospace; font-size: 0.65rem; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,0.7); }

.click-counter { font-family: 'Press Start 2P', monospace; font-size: 0.55rem; color: var(--text-secondary); display: flex; gap: 0.3rem; align-items: center; }
.click-number { color: var(--mc-gold); font-size: 0.75rem; }

/* ── 10. Dice Sidebar ─────────────────────────────────────── */
.dice-section { text-align: center; }
.dice-result { font-family: 'Press Start 2P', monospace; font-size: 2.5rem; color: var(--mc-gold); text-shadow: 2px 2px 0 rgba(0,0,0,0.5); padding: 0.5rem; min-height: 4rem; display: flex; align-items: center; justify-content: center; }
.dice-type { font-family: 'Press Start 2P', monospace; font-size: 0.45rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; min-height: 1rem; }

/* ── 11. DICE POPUP ───────────────────────────────────────── */
.dice-popup {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: popup-fade-in 0.2s ease;
}

@keyframes popup-fade-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.dice-popup-inner {
  background: #1a1a1a;
  border: 3px solid var(--mc-stone);
  border-top-color: var(--mc-stone-l);
  border-left-color: var(--mc-stone-l);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.8);
  border-radius: 4px;
  padding: 2rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
  width: 90%;
}
html[data-theme="light"] .dice-popup-inner {
  background: #c8b890;
  border-color: var(--mc-dirt);
}

.dice-popup-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: var(--mc-gold);
  line-height: 1.6;
  text-align: center;
}

.dice-popup-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
  min-height: 1.5rem;
}

.dice-face {
  width: 100px;
  height: 100px;
  background: #2a2a2a;
  border: 3px solid var(--mc-stone-l);
  border-radius: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 2.5rem;
  color: var(--mc-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
  border-top-color: #888; border-left-color: #888;
  border-right-color: #333; border-bottom-color: #333;
}
.dice-face:hover:not(:disabled) { filter: brightness(1.3); transform: scale(1.05); }
.dice-face:active:not(:disabled) { transform: scale(0.96); }

.dice-face.rolling {
  animation: dice-roll 0.12s linear infinite;
  color: #fff;
  background: #3a3a3a;
}

@keyframes dice-roll {
  0%  { transform: rotate(-8deg) scale(1.02); }
  25% { transform: rotate(8deg)  scale(0.98); }
  50% { transform: rotate(-4deg) scale(1.01); }
  75% { transform: rotate(4deg)  scale(0.99); }
  100%{ transform: rotate(0deg)  scale(1.00); }
}

.dice-face.rolled {
  animation: none;
  color: var(--mc-gold);
  font-size: 3rem;
  background: #1a1a1a;
}

.dice-popup-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.dice-popup-type {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--mc-stone-l);
}

/* ── 12. Action Log ─────────────────────────────────────────── */
.log-section { flex: 1; display: flex; flex-direction: column; min-height: 200px; }

.action-log {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  padding: 0.6rem;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;   /* ← newest entries at bottom */
  gap: 2px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: var(--mc-stone) transparent;
}
html[data-theme="light"] .action-log { background: #1a1208; border-color: #3a2a10; }

.log-entry { display: block; word-break: break-word; }
.log-info    { color: #c0c0c0; }
.log-reward  { color: #4ade80; }
.log-penalty { color: #f87171; }
.log-dice    { color: #fb923c; }
.log-event   { color: var(--mc-diamond); }
.log-death   { color: var(--mc-gold); text-decoration: underline; }

/* ── 13. Footer ─────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 10, 10, 0.9);
  width: 100%; margin-top: auto;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  font-size: 0.75rem; color: var(--text-secondary); flex-wrap: wrap;
}
.footer-inner a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.footer-inner a:hover { color: var(--text-primary); }
.footer-sep { opacity: 0.4; }

/* ── 13b. Biome Chips & Achievements & Events ───────────────── */
.biome-group {
  display: flex;
  gap: 0.35rem;
}
.biome-chip {
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.4rem;
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.8);
}
.biome-forest  { background-color: #3b7a24; }
.biome-desert  { background-color: #d1b46a; color: #3a2205; }
.biome-nether  { background-color: #7a1515; }
.biome-end     { background-color: #3a157a; }

.stat-points {
  color: var(--mc-gold);
  font-size: 0.6rem !important;
}

/* Last Event Card */
.last-event-card {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--mc-stone);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  text-align: center;
}
.last-event-rarity {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  color: #fff;
}
.rarity-common     { background: var(--mc-stone); }
.rarity-uncommon   { background: var(--mc-grass); }
.rarity-rare       { background: var(--mc-lapis); }
.rarity-epic       { background: #a855f7; }
.rarity-legendary  { background: var(--mc-gold); color: #000; font-weight: bold; }

.last-event-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--text-primary);
}

/* Shortcuts Reference Table */
.shortcuts-ref {
  padding: 0.6rem;
}
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.65rem;
}
.shortcuts-table tr {
  border-bottom: 1px solid var(--border-color);
}
.shortcuts-table tr:last-child {
  border-bottom: none;
}
.shortcuts-table td {
  padding: 0.35rem 0.1rem;
  vertical-align: middle;
}
.sk-key {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--mc-gold);
  white-space: nowrap;
}
.sk-desc {
  color: var(--text-secondary);
  text-align: right;
}

/* Achievement Toast */
.achievement-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  background: #2a1f11;
  border: 3px solid #5a3a1a;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
  max-width: 320px;
  animation: toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes toast-slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.achievement-toast.hide {
  animation: toast-slide-out 0.3s ease forwards;
}
@keyframes toast-slide-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}
.achievement-icon {
  width: 32px;
  height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  display: inline-block;
  flex-shrink: 0;
}
.achievement-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.achievement-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  color: var(--mc-gold);
  text-transform: uppercase;
}
.achievement-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #fff;
}

/* ── 14. Standard Buttons ────────────────────────────────────── */
.btn { display:inline-flex; align-items:center; gap:0.4rem; padding:0.5rem 1rem; border-radius:0.5rem; font-size:0.85rem; font-weight:600; cursor:pointer; border:1px solid transparent; transition:all 0.2s; text-decoration:none; }
.btn-primary  { background:var(--accent-color); color:#fff; }
.btn-secondary{ background:var(--bg-hover); color:var(--text-primary); border-color:var(--border-color); }
.btn-success  { background:#16a34a; color:#fff; }
.btn-full     { width:100%; justify-content:center; }

/* ── 14.5 Achievements Grid ─────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--mc-border-dark);
  border-radius: 4px;
}

.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  background: var(--mc-bg-dark);
  border: 2px solid var(--mc-border-light);
  border-radius: 3px;
  position: relative;
  transition: all 0.2s ease;
  cursor: help;
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement-card.unlocked {
  opacity: 1;
  filter: grayscale(0);
  border-color: var(--mc-gold);
  background: linear-gradient(135deg, rgba(234, 184, 57, 0.12), var(--mc-bg-dark));
  box-shadow: 0 0 8px rgba(234, 184, 57, 0.25);
}

.achievement-card-icon {
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  margin-bottom: 0.25rem;
  display: block;
}

.achievement-card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.achievement-card.unlocked .achievement-card-title {
  color: var(--mc-gold);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
}

/* Tooltip on hover */
.achievement-card .tooltip-text {
  visibility: hidden;
  width: 170px;
  background-color: #141414;
  color: #fff;
  text-align: center;
  border: 2px solid var(--mc-gold);
  padding: 0.5rem;
  border-radius: 4px;
  position: absolute;
  z-index: 100;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.48rem;
  font-family: 'Press Start 2P', monospace;
  line-height: 1.5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.achievement-card:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.achievements-progress {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--mc-gold);
  margin-left: auto;
}

/* Minecraft Item Tooltip */
.mc-item .mc-tooltip {
  visibility: hidden;
  position: absolute;
  z-index: 9999;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  padding: 6px 8px;
  background: rgba(16, 0, 16, 0.94);
  border: 2px solid #2e0066;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.12s ease, visibility 0.12s;
  pointer-events: none;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  line-height: 1.4;
}

/* Position adjustment: chest tooltips point downwards, inventory upwards */
.mc-grid[data-grid="chest"] .mc-tooltip {
  top: 120%;
  bottom: auto;
}
.mc-grid[data-grid="inventory"] .mc-tooltip,
.mc-grid[data-grid="hotbar"] .mc-tooltip {
  bottom: 120%;
  top: auto;
}

.mc-item:hover .mc-tooltip {
  visibility: visible;
  opacity: 1;
}

.mc-tooltip-title {
  font-size: 0.44rem;
  color: #fff;
  display: block;
}

/* Custom rarity/type colors in tooltip titles */
.mc-item.item-diamond .mc-tooltip-title,
.mc-item.item-diamond-sword .mc-tooltip-title,
.mc-item.item-diamond-armor .mc-tooltip-title {
  color: #55ffff !important;
}
.mc-item.item-gold .mc-tooltip-title,
.mc-item.item-gold-sword .mc-tooltip-title,
.mc-item.item-golden-apple .mc-tooltip-title {
  color: var(--mc-gold) !important;
}
.mc-item.item-emerald .mc-tooltip-title,
.mc-item.item-ender-eye .mc-tooltip-title {
  color: #55ff55 !important;
}
.mc-item.item-nether-sword .mc-tooltip-title,
.mc-item.item-nether-armor .mc-tooltip-title {
  color: #ff55ff !important;
}

.mc-tooltip-stat {
  font-size: 0.38rem;
  color: #55ff55;
  margin-top: 4px;
  display: block;
}

/* Reset Button */
.reset-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.reset-btn:active {
  transform: scale(0.95);
}

/* ── 14.6 Death Screen ──────────────────────────────────────── */
.death-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(139, 0, 0, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(2.5px);
}

.death-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.death-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 2.2rem;
  color: #ff2222;
  text-shadow: 4px 4px 0 #000;
  margin: 0;
  animation: death-text-shake 0.4s infinite alternate;
}

@keyframes death-text-shake {
  0% { transform: rotate(-1deg); }
  100% { transform: rotate(1deg); }
}

.death-score-row {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

#death-score {
  color: var(--mc-gold);
}

.death-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #fff;
  background: #5c5c5c;
  border: 3px solid;
  border-top-color: #8c8c8c; border-left-color: #8c8c8c;
  border-right-color: #373737; border-bottom-color: #373737;
  padding: 0.75rem 2rem;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 4px 0 #111;
  transition: filter 0.1s, transform 0.1s;
}

.death-btn:hover {
  filter: brightness(1.15);
}

.death-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #111;
  border-top-color: #373737; border-left-color: #373737;
  border-right-color: #8c8c8c; border-bottom-color: #8c8c8c;
}

/* ── 15. Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .game-workspace { flex-direction: column; padding: 0.75rem; }
  .game-right { width: 100%; }
  .steve-btn { padding: 0.75rem; }
  .action-log { max-height: 200px; }
  .stats-bar { padding: 0.4rem 0.75rem; }
}
@media (max-width: 500px) {
  .mc-grid { gap: 2px; }
  .tool-pill-wrapper { display: none; }
  .chest-shortcuts { display: none; }
}
