@import "https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap";

/* src/index.css */
:root {
  --bg-0: #1a120b;
  --bg-1: #2a1d10;
  --grass: #4a7a2a;
  --dirt: #6b4423;
  --stone: #6b6b6b;
  --gold: #d4af37;
  --ink: #f0e6d2;
  --ink-dim: #b8a98a;
  --btn: #6f6f6f;
  --btn-hi: #9a9a9a;
  --btn-lo: #3c3c3c;
  --accent: #58c33a;
  --accent-dk: #2f7a1c;
  --panel: #1c140ceb;
  --border: #15100a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  width: 100%;
  height: 100%;
}

body {
  color: var(--ink);
  background: radial-gradient(circle at 50% 0%, #3a5fb0 0%, #1c2c5a 38%, var(--bg-0) 80%);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
  overflow: hidden;
  font-family: "Press Start 2P", monospace;
}

.app-root, .menu-screen, .game-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.mc-btn {
  color: var(--ink);
  text-shadow: 2px 2px #000;
  background: linear-gradient(var(--btn-hi), var(--btn) 50%, var(--btn-lo));
  border: 3px solid var(--border);
  cursor: pointer;
  letter-spacing: 1px;
  padding: 12px 16px;
  transition: filter 80ms, transform 50ms;
  font-family: inherit;
  font-size: 11px;
  box-shadow: inset 2px 2px #ffffff40, inset -2px -2px #00000073;
}

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

.mc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 2px 2px #0000004d;
}

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

.mc-btn.small {
  padding: 8px 10px;
  font-size: 9px;
}

.mc-btn-primary {
  background: linear-gradient(#7fe05a, var(--accent) 50%, var(--accent-dk));
}

.menu-screen {
  background-image: linear-gradient(#0a060240, #0a06028c), repeating-linear-gradient(90deg, #0000 0 38px, #0000000a 38px 40px), repeating-linear-gradient(0deg, #0000 0 38px, #0000000a 38px 40px);
}

.menu-bg-canvas {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  z-index: 0;
  width: 100%;
  height: 100%;
  inset: 0;
}

.menu-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 14px;
}

.menu-center, .menu-footer {
  position: relative;
  z-index: 2;
}

.mc-name {
  color: var(--ink);
  text-align: center;
  border: 3px solid var(--border);
  outline: none;
  background: #0000008c;
  width: min(360px, 88vw);
  padding: 12px;
  font-family: inherit;
  font-size: 10px;
  box-shadow: inset 2px 2px #0006;
}

.mc-name:focus {
  border-color: var(--accent);
}

.menu-center {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items:  center;
  gap: 22px;
  padding: 10px;
}

.mc-logo-text {
  text-align: center;
  color: #cfcfcf;
  text-shadow: 4px 4px 0 #000, 5px 5px 0 var(--accent-dk);
  letter-spacing: 2px;
  font-size: clamp(28px, 7vw, 64px);
  line-height: 1.2;
}

.mc-logo-text span {
  color: var(--accent);
}

.mc-tagline {
  color: var(--ink-dim);
  text-shadow: 2px 2px #000;
  text-align: center;
  font-size: 11px;
}

.mc-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(360px, 88vw);
}

.mc-menu-buttons .mc-btn {
  width: 100%;
}

.mc-server {
  text-align: center;
  color: var(--ink);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0006;
  border: 2px dashed #6b5a3a;
  padding: 10px;
  font-size: 10px;
}

.mc-server:hover {
  background: #0009;
}

.mc-ca {
  color: var(--gold);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  display: flex;
  background: #00000080;
  border: 2px solid #5a4a2a;
  flex-direction: column;
  align-items:  center;
  gap: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 9px;
}

.mc-ca-hint {
  color: var(--ink-dim);
  font-size: 7px;
}

.menu-footer {
  display: flex;
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  justify-content: space-between;
  align-items:  center;
  padding: 14px;
  font-size: 9px;
}

.menu-footer-right {
  display: flex;
  gap: 8px;
}

.mc-icon {
  background: linear-gradient(var(--btn-hi), var(--btn) 50%, var(--btn-lo));
  border: 3px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  width: 38px;
  height: 38px;
  font-family: inherit;
  font-size: 14px;
  box-shadow: inset 2px 2px #ffffff40, inset -2px -2px #00000073;
}

.mc-icon:hover {
  filter: brightness(1.2);
}

.wallet-connect {
  background: linear-gradient(#a06bff, #7a3fe0 50%, #5320a0);
}

.wallet-pill {
  display: flex;
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0000008c;
  border: 2px solid #4a3a6a;
  align-items:  center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 9px;
}

.wallet-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  width: 8px;
  height: 8px;
}

.wallet-addr {
  color: #c9b6ff;
}

.wallet-bal {
  color: var(--ink-dim);
}

.wallet-bal.token {
  color: var(--gold);
}

.wallet-x {
  color: #ff7a7a;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 10px;
}

.game-screen {
  background: linear-gradient(var(--bg-0), #0d0905);
}

.game-hud {
  display: flex;
  border-bottom: 3px solid var(--border);
  background: #00000073;
  flex-wrap: wrap;
  align-items:  center;
  gap: 12px;
  padding: 10px 14px;
}

.hud-stats {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  align-items:  center;
  gap: 16px;
}

.hud-level {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.hud-lvl-badge {
  color: var(--accent);
  text-shadow: 1px 1px #000;
  font-size: 9px;
}

.hud-xpbar {
  background: #000;
  border: 2px solid #333;
  width: 90px;
  height: 10px;
}

.hud-xpfill {
  background: linear-gradient(var(--accent), var(--accent-dk));
  height: 100%;
  transition: width .2s;
}

.hud-coins {
  color: var(--gold);
  text-shadow: 1px 1px #000;
  font-size: 11px;
}

.hud-pick {
  font-size: 12px;
}

.hud-pick-pow {
  color: var(--ink-dim);
  font-size: 9px;
}

.game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px 0;
}

.tab-btn {
  color: var(--ink-dim);
  border: 2px solid var(--border);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0006;
  border-bottom: none;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 9px;
}

.tab-btn.active {
  color: var(--ink);
  background: var(--panel);
  border-color: #5a4a2a;
}

.game-body {
  overflow-y: auto;
  background: var(--panel);
  border-top: 2px solid #5a4a2a;
  flex: 1;
  padding: 16px;
}

.mine-wrap {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 14px;
}

.mine-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  width: min(560px, 100%);
}

@media (width <= 480px) {
  .mine-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.block {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid var(--border);
  cursor: pointer;
  display: flex;
  user-select: none;
  justify-content: center;
  align-items:  center;
  transition: transform 50ms;
  font-size: clamp(16px, 4vw, 26px);
  box-shadow: inset 2px 2px #ffffff2e, inset -3px -3px #0006;
}

.block:active {
  transform: scale(.92);
}

.block-emoji {
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 #000);
}

.block-hpbar {
  position: absolute;
  pointer-events: none;
  background: #0009;
  height: 5px;
  bottom: 3px;
  left: 4px;
  right: 4px;
}

.block-hpbar > span {
  display: block;
  background: #d33;
  height: 100%;
  transition: width 80ms;
}

.block-pop {
  position: absolute;
  color: var(--gold);
  text-shadow: 1px 1px #000;
  pointer-events: none;
  animation: floatUp .7s ease-out forwards;
  font-size: 10px;
  top: -6px;
}

@keyframes floatUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-26px);
  }
}

.mine-hint {
  color: var(--ink-dim);
  text-align: center;
  max-width: 520px;
  font-size: 8px;
  line-height: 1.8;
}

.panel {
  max-width: 640px;
  margin: 0 auto;
}

.panel-title {
  text-shadow: 2px 2px #000;
  margin-bottom: 16px;
  font-size: 14px;
}

.panel-subtitle {
  color: var(--ink-dim);
  margin: 18px 0 10px;
  font-size: 10px;
}

.bounty-list, .shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bounty-card, .shop-card {
  display: flex;
  border: 2px solid var(--border);
  background: #00000059;
  align-items:  center;
  gap: 12px;
  padding: 12px;
}

.bounty-card.done {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #58c33a4d;
}

.bounty-emoji, .shop-emoji {
  font-size: 22px;
}

.bounty-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.bounty-label {
  font-size: 9px;
}

.bounty-bar {
  position: relative;
  background: #000;
  border: 2px solid #333;
  height: 14px;
}

.bounty-fill {
  background: linear-gradient(var(--accent), var(--accent-dk));
  height: 100%;
  transition: width .2s;
}

.bounty-count {
  position: absolute;
  display: flex;
  text-shadow: 1px 1px #000;
  justify-content: center;
  align-items:  center;
  font-size: 7px;
  inset: 0;
}

.bounty-reward {
  color: var(--gold);
  font-size: 7px;
}

.claim {
  background: linear-gradient(#7fe05a, var(--accent) 50%, var(--accent-dk));
}

.shop-info {
  flex: 1;
}

.shop-name {
  font-size: 9px;
}

.shop-pow {
  color: var(--ink-dim);
  margin-top: 5px;
  font-size: 8px;
}

.shop-card.owned {
  border-color: #3a5a2a;
}

.shop-card.next {
  border-color: var(--gold);
}

.shop-tag {
  color: var(--accent);
  font-size: 8px;
}

.shop-tag.locked {
  color: var(--ink-dim);
}

.stat-row {
  border-bottom: 1px dashed #3a2e1c;
  padding: 8px 0;
  font-size: 9px;
}

.stat-row b {
  color: var(--gold);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.resource-cell {
  display: flex;
  border: 2px solid var(--border);
  background: #0000004d;
  align-items:  center;
  gap: 8px;
  padding: 8px;
  font-size: 8px;
}

.resource-emoji {
  font-size: 16px;
}

.resource-name {
  color: var(--ink-dim);
  flex: 1;
}

.resource-count {
  color: var(--gold);
}

.game-body::-webkit-scrollbar {
  width: 10px;
}

.adv-sheet-body::-webkit-scrollbar {
  width: 10px;
}

.game-body::-webkit-scrollbar-thumb {
  border: 2px solid var(--border);
  background: #5a4a2a;
}

.adv-sheet-body::-webkit-scrollbar-thumb {
  border: 2px solid var(--border);
  background: #5a4a2a;
}

.adv-screen {
  display: flex;
  background: #14110c;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.hud-hearts {
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
}

.adv-stage {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.adv-canvas {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
  background: #2a4d1e;
  width: 100%;
  height: 100%;
  inset: 0;
}

.minimap-canvas {
  position: absolute;
  image-rendering: pixelated;
  border: 2px solid var(--border);
  pointer-events: none;
  z-index: 5;
  width: 132px;
  height: 132px;
  top: 12px;
  right: 12px;
  box-shadow: 0 2px 8px #00000080;
}

@media (width <= 560px) {
  .minimap-canvas {
    width: 92px;
    height: 92px;
  }
}

.adv-toast {
  position: absolute;
  color: var(--ink);
  text-shadow: 1px 1px #000;
  z-index: 5;
  background: #000000d1;
  border: 2px solid #5a4a2a;
  padding: 10px 16px;
  font-size: 10px;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.adv-prompt {
  position: absolute;
  border: 2px solid var(--gold);
  color: var(--gold);
  text-shadow: 1px 1px #000;
  pointer-events: none;
  z-index: 4;
  background: #000000b3;
  padding: 8px 12px;
  font-size: 8px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 40px);
}

.adv-dpad {
  position: absolute;
  z-index: 6;
  opacity: .85;
  width: 150px;
  height: 150px;
  bottom: 26px;
  left: 18px;
}

.dpad {
  position: absolute;
  color: var(--ink);
  background: linear-gradient(var(--btn-hi), var(--btn) 50%, var(--btn-lo));
  border: 3px solid var(--border);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  width: 50px;
  height: 50px;
  font-size: 16px;
  box-shadow: inset 2px 2px #fff3, inset -2px -2px #00000073;
}

.dpad:active {
  filter: brightness(1.4);
}

.dpad.up {
  top: 0;
  left: 50px;
}

.dpad.left {
  top: 50px;
  left: 0;
}

.dpad.right {
  top: 50px;
  left: 100px;
}

.dpad.down {
  top: 100px;
  left: 50px;
}

.adv-actions {
  position: absolute;
  display: flex;
  z-index: 6;
  flex-direction: column;
  align-items:  center;
  gap: 12px;
  bottom: 26px;
  right: 18px;
}

.adv-action {
  border: 4px solid var(--border);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  background: radial-gradient(circle at 35% 30%, #ff9a5a, #d4541f 70%, #8a2f0f);
  border-radius: 50%;
  width: 78px;
  height: 78px;
  font-size: 30px;
  box-shadow: inset 2px 2px #ffffff40, inset -3px -3px #0006;
}

.adv-action:active {
  transform: scale(.92);
}

.adv-tabs {
  display: flex;
  gap: 6px;
}

.adv-tabs .mc-btn {
  padding: 8px;
  font-size: 13px;
}

.adv-hint {
  position: absolute;
  color: #f0e6d299;
  text-shadow: 1px 1px #000;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  font-size: 7px;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

@media (width <= 560px) {
  .adv-hint {
    display: none;
  }
}

.adv-overlay {
  position: absolute;
  display: flex;
  z-index: 20;
  background: #0009;
  justify-content: center;
  align-items:  center;
  padding: 16px;
  inset: 0;
}

.adv-sheet {
  display: flex;
  background: var(--panel);
  border: 4px solid var(--border);
  flex-direction: column;
  width: min(680px, 100%);
  max-height: 86%;
  box-shadow: 0 0 0 2px #5a4a2a;
}

.adv-sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 8px 0;
}

.adv-sheet-tabs button {
  color: var(--ink-dim);
  border: 2px solid var(--border);
  cursor: pointer;
  text-shadow: 1px 1px #000;
  background: #0006;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 9px;
}

.adv-sheet-tabs button.active {
  color: var(--ink);
  background: #5a4a2a80;
  border-color: #5a4a2a;
}

.adv-sheet-tabs .adv-close {
  color: #ff8a8a;
  margin-left: auto;
}

.adv-sheet-body {
  overflow-y: auto;
  padding: 16px;
}

.hud-players {
  color: #9fd0f0;
  text-shadow: 1px 1px #000;
  font-size: 9px;
}

.hud-holder {
  color: #1a1208;
  background: linear-gradient(var(--gold), #b8860b);
  border: 2px solid var(--border);
  text-shadow: none;
  padding: 4px 6px;
  font-size: 8px;
}

.mc-perks {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 10px;
  width: min(360px, 88vw);
}

.perk-hint {
  text-align: center;
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  font-size: 8px;
  line-height: 1.6;
}

.mc-perks .mc-btn {
  width: 100%;
}

.perk-badge {
  display: inline-block;
  color: var(--ink-dim);
  text-shadow: 1px 1px #000;
  background: #00000080;
  border: 2px solid #5a4a2a;
  padding: 8px 10px;
  font-size: 8px;
}

.perk-badge.on {
  color: #1a1208;
  background: linear-gradient(var(--gold), #b8860b);
  border-color: var(--border);
  text-shadow: none;
}

.quick-items {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.quick-item {
  position: relative;
  border: 3px solid var(--border);
  cursor: pointer;
  touch-action: none;
  background: #00000080;
  width: 46px;
  height: 46px;
  font-size: 20px;
  box-shadow: inset 2px 2px #ffffff26;
}

.quick-item:disabled {
  opacity: .35;
}

.quick-item span {
  position: absolute;
  color: var(--gold);
  text-shadow: 1px 1px #000;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  bottom: 0;
  right: 2px;
}

.chat-feed {
  position: absolute;
  display: flex;
  pointer-events: none;
  z-index: 5;
  flex-direction: column;
  gap: 3px;
  max-width: min(60%, 420px);
  top: 14px;
  left: 14px;
}

.chat-line {
  color: #f0e6d2;
  text-shadow: 1px 1px #000;
  word-break: break-word;
  background: #00000080;
  width: -moz-fit-content;
  width: fit-content;
  padding: 4px 7px;
  font-size: 8px;
  line-height: 1.5;
}

.chat-line b {
  color: #7fe05a;
}

.chat-line.me b {
  color: #ffd54a;
}

.chat-input-row {
  position: absolute;
  display: flex;
  z-index: 8;
  gap: 6px;
  width: min(440px, 80%);
  bottom: 90px;
  left: 14px;
}

.chat-input {
  color: var(--ink);
  border: 3px solid var(--border);
  outline: none;
  background: #000c;
  flex: 1;
  padding: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
}

.chat-input:focus {
  border-color: var(--accent);
}

@media (width <= 560px) {
  .chat-input-row {
    bottom: 150px;
  }
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.board-row {
  display: flex;
  border: 2px solid var(--border);
  background: #00000059;
  align-items:  center;
  gap: 10px;
  padding: 10px;
  font-size: 9px;
}

.board-row.me {
  border-color: var(--gold);
  background: #d4af371f;
}

.board-rank {
  width: 28px;
  font-size: 11px;
}

.board-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.board-meta {
  color: var(--ink-dim);
  font-size: 7px;
}

.board-coins {
  color: var(--gold);
}
