@font-face {
  font-family: "Minecraft";
  src:
    url("assets/fonts/minecraft.woff2") format("woff2"),
    url("assets/fonts/minecraft.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Monocraft";
  src: url("assets/fonts/Monocraft.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --dirt: #8b5a2b;
  --dirt-dark: #5c3a1a;
  --grass: #5a9a3a;
  --sky-top: #78b6ff;
  --sky-mid: #a8d4ff;
  --sky-bot: #c8e8ff;
  --accent: #55ff55;
  --font-display: "Monocraft", "Minecraft", ui-monospace, monospace;
  --font-ui: "Monocraft", "Minecraft", ui-monospace, monospace;
  --sword: url("assets/cursor/diamond_sword_tl.png") 0 0, url("assets/cursor/diamond_sword.png") 0 0, crosshair;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  cursor: var(--sword);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  color: #f2f2f2;
  background: #1a120c;
  overflow-x: hidden;
  image-rendering: pixelated;
  cursor: var(--sword);
  letter-spacing: 0.5px;
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

a,
button,
[role="button"],
.hot-slot,
.cell,
.mc-btn,
.nav-tab,
.shop-item {
  cursor: var(--sword);
}

img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* —— Full Minecraft world background —— */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.sky-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      #3d8fe8 0%,
      var(--sky-top) 28%,
      var(--sky-mid) 52%,
      var(--sky-bot) 68%,
      transparent 68%
    );
}

.sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 56px;
  height: 56px;
  background: #ffe566;
  border: 4px solid #ffcc33;
  box-shadow:
    0 0 0 4px rgba(255, 220, 80, 0.35),
    0 0 40px 12px rgba(255, 220, 80, 0.45);
  animation: sunPulse 6s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.12); }
}

.clouds {
  position: absolute;
  inset: 0;
  animation: drift 60s linear infinite;
  opacity: 0.9;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-100px); }
}

.terrain-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(42vh, 420px);
  background:
    url("assets/bg/terrain.png") repeat-x bottom center / auto 100%;
  image-rendering: pixelated;
  animation: terrainScroll 80s linear infinite;
}

@keyframes terrainScroll {
  from { background-position: 0 bottom; }
  to { background-position: -2560px bottom; }
}

.bedrock-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: url("assets/blocks/bedrock.png") repeat center / 24px 24px;
  image-rendering: pixelated;
  box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.35);
}

/* Fallback soft clouds if wool missing */
.clouds::before,
.clouds::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0;
  image-rendering: pixelated;
}

.clouds::before {
  width: 140px;
  height: 36px;
  top: 16%;
  left: 18%;
  box-shadow:
    28px -12px 0 8px rgba(255, 255, 255, 0.85),
    70px 0 0 4px rgba(255, 255, 255, 0.8);
}

.clouds::after {
  width: 110px;
  height: 30px;
  top: 12%;
  right: 16%;
  box-shadow:
    -24px -10px 0 6px rgba(255, 255, 255, 0.85),
    40px 4px 0 2px rgba(255, 255, 255, 0.75);
}

.site-header.topbar,
.topbar.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: block;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%),
    url("assets/bg/planks_tile.png") center / 40px 40px,
    #5c3d1e;
  border-bottom: 4px solid #000;
  box-shadow:
    inset 0 2px 0 rgba(255, 220, 160, 0.12),
    0 4px 0 rgba(0, 0, 0, 0.35);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* —— Top bar —— */
.topbar {
  position: relative;
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 10px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  animation: bob 2.4s ease-in-out infinite;
  filter: drop-shadow(2px 2px 0 #000);
  flex-shrink: 0;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-3px) rotate(-8deg); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  line-height: 1.1;
}

.brand-tag {
  font-family: var(--font-display);
  font-size: 7px;
  color: #d8b888;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Shared compact chips in topbar */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 10px 4px 6px;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.14),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4);
  font-family: var(--font-display);
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  cursor: var(--sword);
  line-height: 1.1;
}

.stat-chip img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  filter: drop-shadow(1px 1px 0 #000);
}

.stat-chip-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.stat-chip-label {
  font-size: 7px;
  color: #c8b090;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.stat-chip-value {
  font-size: 11px;
  color: #fff;
}

.iron-wallet {
  background:
    url("assets/bg/dirt_tile.png") center / 28px 28px,
    #5c3a1a;
  font-size: 14px;
  color: #fff;
}

.icon-btn {
  min-width: 44px;
  padding: 8px 10px !important;
  font-size: 18px !important;
}

.icon-btn.muted {
  filter: grayscale(1) brightness(0.7);
}

/* —— Layout —— */
main.view-stage,
.view-stage {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px 16px 48px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Top section nav */
.main-nav {
  position: relative;
  z-index: 45;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  justify-self: center;
  padding: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.08),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35);
}

.main-nav .nav-tab {
  font-family: var(--font-display);
  font-size: 9px;
  padding: 8px 12px;
  color: #e8dcc0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    url("assets/bg/stone_tile.png") center / 32px 32px,
    #4a4a4a;
  border: 3px solid #111;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.16),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35);
  cursor: var(--sword);
  text-shadow: 1px 1px 0 #000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 36px;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease;
}

.main-nav .nav-tab:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.main-nav .nav-tab.active {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(160, 255, 120, 0.22), transparent),
    url("assets/bg/grass_tile.png") center / 32px 32px,
    #2f7a22;
  border-color: #0a1808;
  box-shadow:
    inset 2px 2px 0 rgba(220, 255, 160, 0.28),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(90, 200, 60, 0.35);
  transform: translateY(-1px);
}

.main-nav .nav-tab img {
  width: 18px;
  height: 18px;
  filter: drop-shadow(1px 1px 0 #000);
}

.view.panel-view {
  display: none;
  width: 100%;
  animation: riseIn 0.35s ease-out both;
}

.view.panel-view.active {
  display: block;
}

#panel-timer.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 12px 0 24px;
}

/* —— Hero (timer view) —— */
.hero-copy {
  animation: riseIn 0.7s ease-out both;
}

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

.logo-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 48px);
  line-height: 1.25;
  color: #fff;
  text-shadow:
    4px 4px 0 #000,
    0 0 24px rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.title-block {
  filter: drop-shadow(2px 2px 0 #000);
  animation: bob 2.8s ease-in-out infinite;
}

.title-block.flip {
  transform: scaleX(-1);
  animation-delay: 0.4s;
}

.tagline {
  margin: 14px auto 0;
  max-width: 34ch;
  font-size: 24px;
  line-height: 1.25;
  color: #14300a;
  background:
    url("assets/bg/grass_tile.png") center / 32px 32px;
  display: inline-block;
  padding: 8px 14px;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.2),
    3px 3px 0 rgba(0, 0, 0, 0.35);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

/* —— Timer —— */
.timer-stage {
  width: 100%;
  animation: riseIn 0.85s 0.12s ease-out both;
}

.timer-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 auto 18px;
  width: min(520px, 100%);
  padding: 8px;
  background:
    url("assets/bg/stone_tile.png") center / 40px 40px,
    #2a2a2a;
  border: 4px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.12),
    0 6px 0 rgba(0, 0, 0, 0.35);
}

.mode-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  padding: 12px 14px;
  color: #c8c8c8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    url("assets/bg/dirt_tile.png") center / 32px 32px,
    #3a3a3a;
  border: 3px solid #111;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.12),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4);
  cursor: var(--sword);
  text-shadow: 1px 1px 0 #000;
  text-align: left;
  min-height: 64px;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.15s ease;
}

.mode-chip img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #000);
  opacity: 0.75;
}

.mode-chip-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mode-chip-title {
  font-size: 11px;
  color: inherit;
  line-height: 1.2;
}

.mode-chip-sub {
  font-size: 7px;
  color: #a8a8a8;
  line-height: 1.25;
  text-shadow: 1px 1px 0 #000;
}

.mode-chip:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.mode-chip.active {
  color: #fff;
  transform: translateY(-2px);
}

.mode-chip.active img {
  opacity: 1;
}

.mode-chip.active .mode-chip-sub {
  color: #f0e8c8;
}

.mode-chip.mode-rhythm.active {
  background:
    linear-gradient(180deg, rgba(120, 220, 80, 0.25), transparent),
    url("assets/bg/grass_tile.png") center / 32px 32px,
    #2f7a22;
  border-color: #0a1a06;
  box-shadow:
    inset 2px 2px 0 rgba(200, 255, 140, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(90, 200, 60, 0.45),
    0 4px 0 rgba(0, 0, 0, 0.35);
}

.mode-chip.mode-free.active {
  background:
    linear-gradient(180deg, rgba(100, 180, 255, 0.28), transparent),
    url("assets/bg/stone_tile.png") center / 32px 32px,
    #1e4a78;
  border-color: #061018;
  box-shadow:
    inset 2px 2px 0 rgba(160, 220, 255, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(70, 160, 255, 0.5),
    0 4px 0 rgba(0, 0, 0, 0.35);
}

.mode-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.timer-frame {
  position: relative;
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 24px 22px;
  background:
    url("assets/bg/stone_tile.png") center / 64px 64px,
    #7a7a7a;
  border: 4px solid #000;
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.25),
    inset -4px -4px 0 rgba(0, 0, 0, 0.35),
    0 10px 0 rgba(0, 0, 0, 0.4);
}

.timer-frame.free-mode {
  background:
    url("assets/bg/planks_tile.png") center / 64px 64px,
    #8b6914;
}

.mc-btn.finish {
  background:
    url("assets/bg/grass_tile.png") center / 32px 32px,
    #2f6b9a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 3px 0 #000;
}

.mc-btn.hidden,
.hidden {
  display: none !important;
}

/* Settings modal */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 16px;
}

.settings-modal.hidden {
  display: none !important;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.settings-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 18px;
  background:
    url("assets/bg/planks_tile.png") center / 64px 64px,
    #8b6914;
  border: 4px solid #000;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.15),
    0 10px 0 rgba(0, 0, 0, 0.4);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
  font-size: 14px;
}

.settings-row input[type="number"] {
  font-family: var(--font-ui);
  font-size: 18px;
  width: 96px;
  padding: 6px 10px;
  background: #373737;
  color: #fff;
  border: 3px solid #000;
  text-align: center;
  cursor: var(--sword);
  -moz-appearance: textfield;
}

.settings-row input[type="number"]::-webkit-outer-spin-button,
.settings-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.progress-track.hidden-track {
  visibility: hidden;
  height: 8px;
  margin-bottom: 12px;
}

/* Today focus pill */
.today-focus {
  background: #1a2430;
  box-shadow:
    inset 2px 2px 0 rgba(120, 200, 255, 0.2),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45);
  color: #a8e0ff;
  max-width: none;
  font-size: inherit;
}

.today-focus .stat-chip-value {
  color: #c8f0ff;
}

.today-focus.pop {
  animation: ironPop 0.55s ease;
}

/* —— Chest button & modal —— */
.chest-btn {
  background:
    url("assets/bg/planks_tile.png") center / 28px 28px,
    #6b4a20;
  gap: 8px;
}

.chest-btn.has-chest {
  box-shadow:
    inset 2px 2px 0 rgba(255, 220, 120, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 0 10px rgba(255, 200, 60, 0.45);
  animation: chestPulse 1.6s ease-in-out infinite;
}

@keyframes chestPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.chest-btn img {
  width: 22px;
  height: 22px;
}

.chest-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 16px;
}

.chest-modal.hidden {
  display: none !important;
}

.chest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.chest-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 20px 18px;
  text-align: center;
  background:
    url("assets/bg/planks_tile.png") center / 64px 64px,
    #8b6914;
  border: 4px solid #000;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.15),
    0 10px 0 rgba(0, 0, 0, 0.45);
}

.chest-panel h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 14px;
  color: #ffe566;
  text-shadow: 2px 2px 0 #000;
}

.chest-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
}

.chest-stage {
  position: relative;
  height: 260px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.mc-chest {
  position: relative;
  width: 176px;
  height: 200px;
  filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.45));
}

.mc-chest img {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 176px;
  height: auto;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.5s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.mc-chest-closed {
  opacity: 1;
  z-index: 2;
  width: 176px;
}

.mc-chest-open {
  opacity: 0;
  z-index: 1;
  width: 176px;
  transform: translate(-50%, -42%) scale(0.96);
}

/* Kapalı: sadece kapalı sandık */
.mc-chest:not(.opening):not(.opened) .mc-chest-closed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mc-chest:not(.opening):not(.opened) .mc-chest-open {
  opacity: 0;
}

/* Açılırken: kapalı kaybolur, açık görünür */
.mc-chest.opening .mc-chest-closed,
.mc-chest.opened .mc-chest-closed {
  opacity: 0;
  transform: translate(-50%, -62%) scale(1.05);
}

.mc-chest.opening .mc-chest-open,
.mc-chest.opened .mc-chest-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.chest-loot {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, 28px) scale(0.3);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 16px;
  color: #e8e8e8;
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 5;
}

.chest-loot.show {
  opacity: 1;
  transform: translate(-50%, -30px) scale(1.2);
}

.chest-loot img {
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #000);
  animation: lootSpin 0.8s ease;
}

@keyframes lootSpin {
  0% { transform: scale(0.2) rotate(-20deg); }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.chest-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
  font-size: 12px;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
}

.chest-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Flying +time animation */
.fly-time {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 14px;
  color: #b8ff6a;
  text-shadow:
    2px 2px 0 #000,
    0 0 12px rgba(100, 255, 80, 0.6);
  opacity: 0;
  white-space: nowrap;
  padding: 8px 12px;
  background: rgba(20, 40, 10, 0.85);
  border: 3px solid #55aa33;
  box-shadow: 0 4px 0 #000;
  transition:
    transform 0.85s cubic-bezier(0.22, 0.8, 0.25, 1),
    opacity 0.85s ease,
    left 0.85s cubic-bezier(0.22, 0.8, 0.25, 1),
    top 0.85s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.fly-time.show {
  opacity: 1;
}

.frame-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  background: url("assets/blocks/cobblestone.png") center / cover;
  border: 2px solid #000;
  image-rendering: pixelated;
  z-index: 2;
}

.frame-corner.tl { top: -6px; left: -6px; }
.frame-corner.tr { top: -6px; right: -6px; }
.frame-corner.bl { bottom: -6px; left: -6px; }
.frame-corner.br { bottom: -6px; right: -6px; }

.mode-label {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 12px;
}

.timer-display {
  font-family: var(--font-display);
  font-size: clamp(40px, 12vw, 56px);
  color: #fff;
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 2px;
  margin-bottom: 16px;
  transition: color 0.3s;
}

.timer-frame.running .timer-display {
  color: #a8ff8a;
}

.timer-frame.break .mode-label {
  color: #55ffff;
}

.timer-frame.break .timer-display {
  color: #a8ffff;
}

.progress-track {
  height: 16px;
  margin: 0 auto 20px;
  background:
    url("assets/blocks/bedrock.png") center / 16px 16px,
    #1a1a1a;
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 #000;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background:
    url("assets/blocks/emerald_block.png") center / 16px 16px,
    repeating-linear-gradient(90deg, #55aa55 0 8px, #3d8b3d 8px 16px);
  transition: width 0.35s linear;
  image-rendering: pixelated;
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.session-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 20px;
  color: #eee;
  text-shadow: 1px 1px 0 #000;
}

.reward-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ddd;
}

/* —— Minecraft buttons —— */
.mc-btn {
  font-family: var(--font-ui);
  font-size: 22px;
  line-height: 1;
  padding: 10px 18px;
  color: #fff;
  background:
    url("assets/bg/stone_tile.png") center / 32px 32px,
    #727272;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.28),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 3px 0 #000;
  cursor: var(--sword);
  text-shadow: 2px 2px 0 #000;
  transition: transform 0.08s, filter 0.15s;
}

.mc-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.28),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 1px 0 #000;
}

.mc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mc-btn.primary {
  background:
    url("assets/bg/grass_tile.png") center / 32px 32px,
    #3c8527;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 3px 0 #000;
}

.mc-btn.small {
  font-size: 18px;
  padding: 8px 12px;
}

.mc-btn.buy {
  width: 100%;
  margin-top: 8px;
  background:
    url("assets/bg/grass_tile.png") center / 32px 32px,
    #3c8527;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35),
    0 3px 0 #000;
}

.mc-btn.buy:disabled {
  background:
    url("assets/bg/stone_tile.png") center / 32px 32px,
    #555;
}

.mc-btn.active-erase {
  background:
    url("assets/blocks/bricks.png") center / 32px 32px,
    #aa3333;
  box-shadow:
    inset 2px 2px 0 rgba(255, 200, 200, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4),
    0 3px 0 #000;
}

/* —— Panels —— */
.panel {
  margin-top: 0;
  padding: 22px 18px 28px;
  background:
    url("assets/bg/planks_tile.png") center / 64px 64px,
    #9a7b4f;
  border: 4px solid #000;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.15),
    inset -3px -3px 0 rgba(0, 0, 0, 0.35),
    0 8px 0 rgba(0, 0, 0, 0.35);
}

.panel.hidden {
  display: none;
}

#panel-world {
  background:
    url("assets/bg/dirt_tile.png") center / 48px 48px,
    var(--dirt);
}

#panel-inventory {
  display: none !important;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.08);
}

.panel-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.panel-head p {
  margin: 0;
  font-size: 20px;
  color: #f0e0c8;
  text-shadow: 1px 1px 0 #000;
  line-height: 1.2;
}

/* —— Shop —— */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 12px;
  background:
    url("assets/bg/stone_tile.png") center / 40px 40px,
    #373737;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.18),
    inset -2px -2px 0 rgba(0, 0, 0, 0.4);
  text-align: center;
  transition: transform 0.15s;
}

.shop-item:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
}

.shop-item img {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  filter: drop-shadow(2px 2px 0 #000);
}

.shop-item .name {
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.35;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 6px;
  min-height: 2.7em;
}

.shop-item .price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  color: #ddd;
}

.shop-item .price img {
  width: 16px;
  height: 16px;
  margin: 0;
  filter: none;
}

/* —— Inventory —— */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  padding-bottom: 24px;
}

.inv-slot {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    url("assets/blocks/stone.png") center / cover,
    #8b8b8b;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 #555,
    inset -2px -2px 0 #c6c6c6;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: var(--sword);
}

.inv-slot:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inv-slot.selected {
  border-color: #fff;
  outline: 2px solid #ffff55;
  outline-offset: 1px;
}

.inv-slot:not(:disabled):hover {
  filter: brightness(1.1);
}

.hotbar-hint {
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
  padding: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.inv-slot.empty {
  opacity: 0.55;
}

.inv-slot img {
  width: 40px;
  height: 40px;
}

.inv-slot .qty {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.inv-slot .slot-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  font-size: 14px;
  text-align: center;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* —— World —— */
.world-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.selected-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
}

.tool-slot {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    url("assets/blocks/stone.png") center / cover,
    #8b8b8b;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 #555,
    inset -2px -2px 0 #c6c6c6;
  font-size: 18px;
}

.tool-slot img {
  width: 32px;
  height: 32px;
}

.tool-slot.empty {
  color: #333;
}

.world-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hotbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
  padding: 8px;
  background:
    url("assets/bg/stone_tile.png") center / 32px 32px,
    rgba(0, 0, 0, 0.45);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.1);
}

.hot-slot {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    url("assets/blocks/stone.png") center / cover,
    #8b8b8b;
  border: 3px solid #373737;
  box-shadow:
    inset 2px 2px 0 #555,
    inset -2px -2px 0 #c6c6c6;
  cursor: var(--sword);
  padding: 0;
}

.hot-slot:hover {
  filter: brightness(1.1);
}

.hot-slot.selected {
  border-color: #fff;
  outline: 2px solid #ffff55;
  outline-offset: 1px;
}

.hot-slot img {
  width: 32px;
  height: 32px;
}

.hot-slot .qty {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-family: var(--font-display);
  font-size: 8px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.shop-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-display);
  font-size: 7px;
  padding: 2px 5px;
  border: 2px solid #000;
  text-shadow: 1px 1px 0 #000;
  color: #fff;
}

.shop-tag.mob {
  background: #3d8c40;
}

.shop-tag.fluid {
  background: #2a6db5;
}

.shop-item.mob img {
  background: url("assets/blocks/grass_top.png") center / cover;
  border: 2px solid #000;
}

.world-wrap {
  overflow: auto;
  border: 4px solid #000;
  background:
    linear-gradient(180deg, #78b6ff 0 28%, transparent 28%),
    url("assets/bg/grass_tile.png") bottom / 40px 40px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
  max-height: min(78vh, 720px);
}

.world-grid {
  --cell: 40px;
  display: grid;
  grid-template-columns: repeat(26, var(--cell));
  grid-template-rows: repeat(16, var(--cell));
  width: max-content;
  margin: 0 auto;
  background: #5a9a3a;
  touch-action: manipulation;
}

.cell {
  width: var(--cell);
  height: var(--cell);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  cursor: var(--sword);
  transition: filter 0.1s;
  image-rendering: pixelated;
}

.cell:hover {
  filter: brightness(1.12);
  outline: 1px solid rgba(255, 255, 255, 0.55);
  outline-offset: -1px;
  z-index: 1;
}

.cell.filled {
  border-color: rgba(0, 0, 0, 0.22);
}

.cell.is-mob {
  animation: mobBob 2.4s ease-in-out infinite;
}

.cell.is-fluid {
  animation: waterShimmer 2.8s linear infinite;
}

@keyframes mobBob {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

@keyframes waterShimmer {
  0%, 100% { filter: brightness(1) hue-rotate(0deg); }
  50% { filter: brightness(1.12) hue-rotate(8deg); }
}

/* —— Floating mute button —— */
.mute-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 10px;
  background:
    url("assets/bg/planks_tile.png") center / 32px 32px,
    #5a3a18;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.18),
    0 6px 0 rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9px;
  text-shadow: 1px 1px 0 #000;
  cursor: var(--sword);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.mute-fab img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #000);
}

.mute-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.mute-fab.muted {
  background:
    url("assets/bg/stone_tile.png") center / 32px 32px,
    #3a3a3a;
  color: #bbb;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.08),
    0 6px 0 rgba(0, 0, 0, 0.4);
}

.mute-fab.muted img {
  opacity: 0.7;
  filter: grayscale(1) drop-shadow(1px 1px 0 #000);
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background:
    url("assets/bg/planks_tile.png") center / 48px 48px,
    #373737;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.2),
    0 6px 0 rgba(0, 0, 0, 0.4);
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.4;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.reward {
  color: #a8ff8a;
}

/* —— Footer —— */
.site-footer {
  text-align: center;
  padding: 0 16px 40px;
  font-size: 18px;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
  position: relative;
  z-index: 1;
}

.footer-strip {
  height: 48px;
  margin-bottom: 12px;
  background:
    url("assets/blocks/grass_side.png") repeat-x center / 48px 48px,
    url("assets/blocks/dirt.png") repeat-x bottom / 48px 48px;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  image-rendering: pixelated;
}

.site-footer p {
  margin: 0;
}

.footer-tagline {
  margin-bottom: 10px !important;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px !important;
  font-family: var(--font-display);
  font-size: 11px;
  color: #f5e6c8;
  text-shadow: 1px 1px 0 #000;
}

.footer-credit .footer-gem,
.footer-credit .footer-heart {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(1px 1px 0 #000);
  vertical-align: middle;
}

.footer-credit .footer-heart {
  animation: heartBeat 1.4s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.footer-author {
  color: #7fd0ff;
  text-decoration: none;
  border-bottom: 2px solid rgba(127, 208, 255, 0.45);
  text-shadow: 1px 1px 0 #000;
  transition: color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.footer-author:hover {
  color: #b8e8ff;
  border-bottom-color: #b8e8ff;
  filter: brightness(1.1);
}

.seo-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ironPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.iron-wallet.pop {
  animation: ironPop 0.55s ease;
}

/* —— Streak campfire button —— */
.streak-btn {
  gap: 8px;
  padding: 3px 10px 3px 5px;
  min-height: 42px;
  background:
    linear-gradient(180deg, rgba(80, 48, 24, 0.55), rgba(28, 16, 8, 0.85)),
    url("assets/bg/dirt_tile.png") center / 28px 28px,
    #2a1a0e;
  transition: box-shadow 0.25s ease, filter 0.2s ease;
}

.streak-btn:hover {
  filter: brightness(1.08);
}

.streak-btn.lit {
  background:
    linear-gradient(180deg, rgba(120, 60, 18, 0.5), rgba(40, 18, 6, 0.9)),
    url("assets/bg/dirt_tile.png") center / 28px 28px,
    #3a1e0a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 200, 100, 0.35),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 140, 40, 0.25),
    0 0 10px rgba(255, 100, 20, 0.4);
}

.streak-fire {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.08);
}

.streak-fire img {
  width: 24px !important;
  height: 24px !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  position: relative;
  z-index: 1;
}

.streak-glow {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 40, 0.55), transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.streak-btn.lit .streak-glow {
  opacity: 1;
  animation: streakGlow 1.4s ease-in-out infinite;
}

.streak-btn.lit .streak-fire img {
  animation: streakFlicker 0.9s steps(2) infinite;
  filter: drop-shadow(0 0 4px rgba(255, 120, 20, 0.85));
}

.streak-btn:not(.lit) .streak-fire img {
  filter: grayscale(1) brightness(0.55) contrast(0.9);
  opacity: 0.85;
}

@keyframes streakGlow {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes streakFlicker {
  from { transform: translateY(0); }
  to { transform: translateY(-1px); }
}

.streak-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
}

.streak-label {
  font-size: 7px;
  letter-spacing: 0.5px;
  color: #c8a070;
  text-transform: uppercase;
}

.streak-row {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.streak-count {
  font-size: 12px;
  color: #fff;
  min-width: 0.8em;
}

.streak-unit {
  font-size: 8px;
  color: #e8d0a8;
}

.streak-status {
  display: none;
}

.streak-btn.lit .streak-count {
  color: #ffe7a0;
}

/* —— XP pill —— */
.xp-pill {
  gap: 8px;
  padding: 4px 10px;
  background: #2a1c12;
  min-width: 118px;
  cursor: var(--sword);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.xp-pill img {
  width: 20px;
  height: 20px;
}

.xp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.xp-level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.xp-level {
  font-family: var(--font-display);
  font-size: 9px;
  color: #f0d0a8;
  text-shadow: 1px 1px 0 #000;
}

.xp-rank-label {
  font-family: var(--font-display);
  font-size: 7px;
  color: #c47a3a;
  text-shadow: 1px 1px 0 #000;
}

.xp-bar {
  height: 7px;
  background: #0a1208;
  border: 2px solid #000;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, #b86a2a 0 4px, #8a4a18 4px 8px);
  transition: width 0.4s ease, background 0.3s ease;
}

.xp-pill[data-rank="bronze"] {
  background: #2a1c12;
}
.xp-pill[data-rank="bronze"] .xp-rank-label { color: #c47a3a; }

.xp-pill[data-rank="copper"] {
  background: #2a1810;
  box-shadow:
    inset 2px 2px 0 rgba(224, 138, 90, 0.28),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45);
}
.xp-pill[data-rank="copper"] .xp-rank-label,
.xp-pill[data-rank="copper"] .xp-level { color: #e08a5a; }

.xp-pill[data-rank="iron"] {
  background: #1c1e22;
  box-shadow:
    inset 2px 2px 0 rgba(200, 200, 210, 0.25),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45);
}
.xp-pill[data-rank="iron"] .xp-rank-label,
.xp-pill[data-rank="iron"] .xp-level { color: #d0d0d8; }

.xp-pill[data-rank="gold"] {
  background: #2a2208;
  box-shadow:
    inset 2px 2px 0 rgba(255, 210, 74, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 0 10px rgba(255, 190, 40, 0.25);
}
.xp-pill[data-rank="gold"] .xp-rank-label,
.xp-pill[data-rank="gold"] .xp-level { color: #ffd24a; }

.xp-pill[data-rank="diamond"] {
  background: #0c1e28;
  box-shadow:
    inset 2px 2px 0 rgba(90, 212, 255, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 0 10px rgba(80, 200, 255, 0.28);
}
.xp-pill[data-rank="diamond"] .xp-rank-label,
.xp-pill[data-rank="diamond"] .xp-level { color: #5ad4ff; }

.xp-pill[data-rank="emerald"] {
  background: #0c2414;
  box-shadow:
    inset 2px 2px 0 rgba(60, 255, 122, 0.3),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 0 12px rgba(40, 230, 100, 0.3);
}
.xp-pill[data-rank="emerald"] .xp-rank-label,
.xp-pill[data-rank="emerald"] .xp-level { color: #3cff7a; }

/* —— Stats panel —— */
.panel-xp {
  background:
    url("assets/bg/stone_tile.png") center / 48px 48px,
    #2a2a28 !important;
}

.xp-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.rank-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 3px solid #000;
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.12),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45);
}

.rank-hero-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
}

.rank-hero-icon img {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #000);
}

.rank-hero-kicker {
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c8b090;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 2px;
}

.rank-hero-name {
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 2px;
}

.rank-hero-level {
  font-size: 12px;
  color: #eee;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 10px;
}

.rank-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #ddd;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 4px;
}

.rank-progress-track {
  height: 14px;
  background: #0a0a0a;
  border: 3px solid #000;
  overflow: hidden;
}

.rank-progress-fill {
  height: 100%;
  width: 0;
  transition: width 0.4s ease;
}

.rank-progress-hint {
  margin-top: 6px;
  font-size: 8px;
  color: #b8a888;
  text-shadow: 1px 1px 0 #000;
}

.rank-hero.rank-bronze {
  background: linear-gradient(135deg, #4a2e18, #2a1a10);
}
.rank-hero.rank-bronze .rank-hero-name { color: #e0a060; }

.rank-hero.rank-copper {
  background: linear-gradient(135deg, #5a3018, #2a140c);
}
.rank-hero.rank-copper .rank-hero-name { color: #e08a5a; }

.rank-hero.rank-iron {
  background: linear-gradient(135deg, #3a3c44, #1c1e24);
}
.rank-hero.rank-iron .rank-hero-name { color: #e0e0e8; }

.rank-hero.rank-gold {
  background: linear-gradient(135deg, #5a4810, #2a2008);
}
.rank-hero.rank-gold .rank-hero-name { color: #ffd24a; }

.rank-hero.rank-diamond {
  background: linear-gradient(135deg, #184860, #0c2030);
}
.rank-hero.rank-diamond .rank-hero-name { color: #5ad4ff; }

.rank-hero.rank-emerald {
  background: linear-gradient(135deg, #145828, #0c2414);
}
.rank-hero.rank-emerald .rank-hero-name { color: #3cff7a; }

.xp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.xp-card {
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 3px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.08);
}

.xp-card .label {
  font-size: 11px;
  color: #c8b890;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 6px;
}

.xp-card .value {
  font-family: var(--font-display);
  font-size: 14px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.rank-ladder {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.rank-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #000;
  text-align: center;
  opacity: 0.45;
  filter: grayscale(0.7);
}

.rank-step.unlocked {
  opacity: 1;
  filter: none;
}

.rank-step.active {
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.2),
    0 0 0 2px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.rank-step img {
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 #000);
}

.rank-step-name {
  font-family: var(--font-display);
  font-size: 8px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
}

.rank-step-range {
  font-size: 7px;
  color: #c8b890;
  text-shadow: 1px 1px 0 #000;
}

.rank-step.rank-bronze.unlocked { background: rgba(120, 70, 30, 0.35); }
.rank-step.rank-copper.unlocked { background: rgba(160, 80, 40, 0.35); }
.rank-step.rank-iron.unlocked { background: rgba(120, 120, 130, 0.28); }
.rank-step.rank-gold.unlocked { background: rgba(180, 140, 30, 0.32); }
.rank-step.rank-diamond.unlocked { background: rgba(40, 140, 180, 0.32); }
.rank-step.rank-emerald.unlocked { background: rgba(30, 150, 70, 0.32); }

.stats-days-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 11px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.stats-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-row {
  display: grid;
  grid-template-columns: 88px 1fr 64px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid #000;
}

.day-row .day-label {
  font-family: var(--font-display);
  font-size: 9px;
  color: #e8ffe0;
  text-shadow: 1px 1px 0 #000;
}

.day-row .day-track {
  height: 14px;
  background: #0c1408;
  border: 2px solid #000;
  overflow: hidden;
}

.day-row .day-fill {
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      #55ff55 0 6px,
      #33cc33 6px 12px
    );
  min-width: 0;
  transition: width 0.35s ease;
}

.day-row.lit-day .day-fill {
  background:
    repeating-linear-gradient(
      90deg,
      #ffaa33 0 6px,
      #ff6622 6px 12px
    );
}

.day-row .day-mins {
  font-size: 12px;
  text-align: right;
  color: #c8f0a8;
  text-shadow: 1px 1px 0 #000;
}

.day-row .day-fire {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.day-row:not(.lit-day) .day-fire {
  filter: grayscale(0.5) brightness(0.85);
  opacity: 0.85;
}

/* —— Achievements —— */
.panel-adv {
  background:
    url("assets/bg/spruce_tile.png") center / 64px 64px,
    url("assets/bg/planks_tile.png") center / 64px 64px,
    #3a2a18 !important;
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.adv-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #2a2a2a;
  border: 3px solid #555;
  box-shadow:
    inset 2px 2px 0 #444,
    inset -2px -2px 0 #111;
  opacity: 0.55;
  filter: grayscale(0.7);
}

.adv-card.unlocked {
  opacity: 1;
  filter: none;
  border-color: #c6a33a;
  background:
    linear-gradient(180deg, #3a3420, #2a2418);
  box-shadow:
    inset 2px 2px 0 rgba(255, 220, 120, 0.25),
    inset -2px -2px 0 #111,
    0 0 10px rgba(255, 200, 80, 0.25);
}

.adv-card img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(2px 2px 0 #000);
}

.adv-card .adv-title {
  font-family: var(--font-display);
  font-size: 10px;
  color: #ffe566;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 4px;
}

.adv-card:not(.unlocked) .adv-title {
  color: #aaa;
}

.adv-card .adv-desc {
  font-size: 12px;
  color: #ddd;
  text-shadow: 1px 1px 0 #000;
  line-height: 1.25;
}

.adv-card .adv-lock {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
}

/* Advancement popup toast */
.adv-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  width: min(420px, calc(100vw - 24px));
}

.adv-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.adv-toast-inner {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background:
    url("assets/bg/planks_tile.png") center / 48px 48px,
    #2b2418;
  border: 4px solid #c6a33a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 220, 120, 0.2),
    0 8px 0 rgba(0, 0, 0, 0.45);
}

.adv-toast-label {
  font-size: 11px;
  color: #ffe566;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 2px;
}

.adv-toast-title {
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 4px;
}

.adv-toast-desc {
  font-size: 12px;
  color: #ddd;
  text-shadow: 1px 1px 0 #000;
}

@media (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    justify-self: start;
  }

  .main-nav {
    width: 100%;
    justify-content: stretch;
  }

  .main-nav .nav-tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 6px;
    font-size: 8px;
  }

  .topbar-right {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .brand-name {
    font-size: 12px;
  }

  .brand-tag {
    display: none;
  }

  .timer-mode-switch {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mode-chip {
    min-height: 56px;
  }

  .mode-chip-title {
    font-size: 12px;
  }

  .stat-chip-label {
    display: none;
  }

  .streak-status {
    display: none;
  }

  .streak-unit {
    display: none;
  }

  .main-nav .nav-tab span {
    display: none;
  }

  .main-nav .nav-tab {
    padding: 8px 10px;
  }

  .topbar-right {
    gap: 6px;
  }

  .xp-pill {
    min-width: 96px;
  }

  .tagline {
    font-size: 20px;
  }

  .timer-actions {
    flex-direction: column;
  }

  .mc-btn {
    width: 100%;
  }

  .icon-btn {
    width: auto !important;
  }

  .world-grid {
    --cell: 28px;
    grid-template-columns: repeat(26, var(--cell));
    grid-template-rows: repeat(16, var(--cell));
  }

  .cell {
    width: var(--cell);
    height: var(--cell);
  }

  .mute-fab .mute-label {
    display: none;
  }

  .mute-fab {
    padding: 10px;
    right: 12px;
    bottom: 12px;
  }

  .terrain-layer {
    height: 28vh;
  }

  .sun {
    width: 40px;
    height: 40px;
  }

  .topbar-right {
    flex-wrap: wrap;
    justify-content: center;
  }

  .xp-pill {
    min-width: 90px;
  }

  .rank-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .rank-hero-icon {
    margin: 0 auto;
  }

  .rank-ladder {
    grid-template-columns: repeat(3, 1fr);
  }

  .day-row {
    grid-template-columns: 72px 1fr 52px;
  }
}
