:root {
  color-scheme: dark;
  --ink: #eef5e7;
  --muted: #9ba99b;
  --dim: #718176;
  --bg: #09120f;
  --panel: #111e18;
  --panel-2: #16251e;
  --line: rgba(199, 231, 193, .13);
  --acid: #bdff5b;
  --mint: #54e59a;
  --blue: #7bd8ed;
  --coral: #ff6f62;
  --mono: 'DM Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --pixel-shadow: 5px 5px 0 rgba(3, 8, 6, .55);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(73, 130, 83, .17), transparent 52%),
    radial-gradient(ellipse at 4% 100%, rgba(15, 95, 92, .12), transparent 42%),
    var(--bg);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

.app {
  width: min(1500px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 13px 24px 11px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.topbar {
  height: 54px;
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 220px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: block; filter: drop-shadow(0 5px 8px rgba(48, 181, 113, .22)); }
.brand-mark svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-copy strong { font-size: 17px; font-weight: 700; letter-spacing: -.045em; }
.brand-copy small { color: var(--dim); font: 9px/1 var(--mono); letter-spacing: .16em; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: #b4c1b3; font: 10px/1 var(--mono); letter-spacing: .08em; white-space: nowrap; }
.topbar-center #header-mode { color: var(--acid); }
.online-dot { width: 7px; height: 7px; border-radius: 1px; background: var(--mint); box-shadow: 0 0 11px rgba(84, 229, 154, .68); transform: rotate(45deg); }
.top-divider { color: #4f6054; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 220px; }
.best-badge { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: rgba(17, 30, 24, .72); border: 1px solid var(--line); border-radius: 4px; font: 9px/1 var(--mono); letter-spacing: .08em; color: var(--dim); }
.best-badge strong { color: var(--acid); font-size: 12px; letter-spacing: .03em; }
.home-link { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); transition: .18s ease; }
.home-link:hover { color: var(--acid); border-color: rgba(189, 255, 91, .42); background: rgba(189, 255, 91, .06); }
.home-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }

.game-main { min-height: 0; flex: 1; display: flex; justify-content: center; align-items: center; }
.game-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: min(76svh, 790px);
  min-height: 500px;
  overflow: hidden;
  background: #101b16;
  border: 1px solid rgba(179, 220, 174, .18);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .025);
  touch-action: none;
}
.game-stage::before {
  content: '';
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 1px solid rgba(219, 255, 190, .06);
  pointer-events: none;
}
#world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.screen-vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 12, 8, .25), transparent 23%, transparent 72%, rgba(3, 9, 8, .35)),
    radial-gradient(ellipse at center, transparent 52%, rgba(5, 10, 9, .27) 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .045) 3px 4px);
  opacity: .72;
  mix-blend-mode: multiply;
}
.hit-flash { position: absolute; z-index: 8; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 25%, rgba(255, 64, 52, .6) 100%); }
.game-stage.is-hit .hit-flash { animation: hit-flash .22s steps(3, end); }
@keyframes hit-flash { 0% { opacity: 0; } 25% { opacity: .95; } 100% { opacity: 0; } }

.game-hud { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.is-hidden { display: none !important; }
.hud-top-left, .hud-top-right { position: absolute; top: 15px; display: flex; align-items: flex-start; gap: 9px; }
.hud-top-left { left: 16px; }
.hud-top-right { right: 16px; align-items: stretch; }
.health-card, .world-chip, .score-card, .hud-button {
  background: rgba(9, 19, 15, .84);
  border: 1px solid rgba(199, 231, 193, .17);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  backdrop-filter: blur(8px);
}
.health-card { display: flex; flex-direction: column; gap: 5px; min-width: 103px; padding: 8px 11px 9px; border-radius: 4px; }
.hud-label { color: #95a696; font: 9px/1 var(--mono); letter-spacing: .13em; }
.hearts { display: flex; align-items: center; gap: 4px; line-height: 1; }
.heart { color: var(--coral); font: 18px/1 var(--mono); text-shadow: 0 0 9px rgba(255, 100, 89, .28); transform: translateY(-1px); }
.heart.empty { color: rgba(191, 201, 188, .24); text-shadow: none; }
.world-chip { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; height: 31px; padding: 0 10px; border-radius: 4px; color: #c0cebd; font: 9px/1 var(--mono); letter-spacing: .045em; white-space: nowrap; }
.sun-pixel { width: 11px; height: 11px; display: block; background: #ffcb67; box-shadow: 3px 0 #ffcb67, -3px 0 #ffcb67, 0 3px #ffcb67, 0 -3px #ffcb67, 0 0 10px rgba(255, 203, 103, .55); transform: scale(.65); }
.flight-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid rgba(189, 255, 91, .34); border-radius: 3px; color: var(--acid); background: rgba(32, 54, 25, .84); box-shadow: 0 0 12px rgba(189, 255, 91, .1); font: 8px/1 var(--mono); letter-spacing: .11em; }
.flight-chip span { font-size: 12px; }
.flight-chip[hidden] { display: none !important; }
.score-card { min-width: 118px; padding: 7px 10px 6px; border-radius: 4px; display: grid; gap: 3px; text-align: right; }
.score-card strong { color: var(--acid); font: 700 17px/1 var(--mono); letter-spacing: .04em; }
.score-best { color: #7f9284; font: 8px/1 var(--mono); letter-spacing: .06em; }
.hud-button { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; padding: 0; border-radius: 4px; color: #c9d6c7; cursor: pointer; pointer-events: auto; transition: .16s ease; }
.hud-button:hover { color: var(--acid); border-color: rgba(189, 255, 91, .5); transform: translateY(-1px); }
.look-button.locked { color: #14200f; border-color: var(--acid); background: var(--acid); box-shadow: 0 0 12px rgba(189, 255, 91, .25); }
.attack-button { color: #ffb69e; border-color: rgba(255, 134, 103, .32); }
.attack-button:hover { color: #fff0e9; border-color: rgba(255, 134, 103, .78); background: rgba(133, 54, 40, .42); }
.hud-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: square; stroke-linejoin: miter; }
.sound-button .sound-off { display: none; }
.sound-button.muted .sound-on { display: none; }
.sound-button.muted .sound-off { display: block; }
.toast { position: absolute; top: 81px; left: 50%; max-width: min(90%, 400px); padding: 8px 12px; color: #eaffcf; background: rgba(10, 24, 16, .86); border: 1px solid rgba(189, 255, 91, .34); border-radius: 3px; box-shadow: 0 5px 16px rgba(0, 0, 0, .25); font: 10px/1.2 var(--mono); letter-spacing: .055em; text-align: center; opacity: 0; transform: translate(-50%, -6px); transition: .18s ease; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { color: #ffcf7c; border-color: rgba(255, 197, 105, .36); }
.hotbar-wrap { position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%); text-align: center; pointer-events: auto; }
.hotbar { display: flex; align-items: stretch; gap: 2px; padding: 4px; border: 2px solid rgba(24, 24, 24, .92); border-radius: 3px; background: rgba(86, 86, 86, .86); box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 6px 22px rgba(0, 0, 0, .38); backdrop-filter: blur(4px); }
.hotbar-slot { position: relative; width: 49px; height: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px 3px; border: 2px solid rgba(31, 31, 31, .62); border-radius: 1px; color: #d2d2d2; background: rgba(116, 116, 116, .66); cursor: pointer; transition: background .12s, border-color .12s, transform .12s; }
.hotbar-slot:hover { background: rgba(163, 163, 163, .64); color: #fff; }
.hotbar-slot[aria-pressed="true"] { z-index: 1; color: #fff; background: rgba(169, 169, 169, .83); border-color: #dedede; box-shadow: 0 0 0 2px rgba(24, 24, 24, .7), 0 0 0 3px rgba(255, 255, 255, .75), inset 0 0 0 1px rgba(255, 255, 255, .4); transform: translateY(-2px); }
.block-icon { position: relative; width: 22px; height: 20px; display: block; filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .36)); }
.block-icon::before { content: ''; position: absolute; inset: 0 1px 4px; background: var(--block-top); clip-path: polygon(50% 0, 100% 27%, 50% 55%, 0 27%); }
.block-icon::after { content: ''; position: absolute; inset: 5px 1px 0; background: linear-gradient(150deg, var(--block-left) 0 49%, var(--block-right) 50% 100%); clip-path: polygon(0 0, 50% 25%, 100% 0, 100% 70%, 50% 100%, 0 70%); }
.block-icon i { position: absolute; z-index: 1; top: 6px; left: 10px; width: 2px; height: 2px; background: rgba(255, 255, 255, .44); }
.hotbar-name { max-width: 100%; overflow: hidden; font: 8px/1 var(--mono); letter-spacing: .015em; }
.hotbar-count { position: absolute; top: 2px; right: 3px; color: #f0f6e7; font: 9px/1 var(--mono); text-shadow: 1px 1px #09120f, -1px -1px #09120f; }
.hotbar-key { position: absolute; bottom: 2px; left: 4px; color: rgba(206, 222, 201, .49); font: 7px/1 var(--mono); }
.hotbar-tip { margin-top: 5px; color: rgba(205, 220, 201, .54); font: 8px/1 var(--mono); letter-spacing: .11em; }
.hotbar-tip span { color: rgba(205, 220, 201, .8); }
.reticle { position: absolute; z-index: 1; width: 12px; height: 12px; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .9; pointer-events: none; }
.reticle::before, .reticle::after { content: ''; position: absolute; display: block; background: #f5f5f5; box-shadow: 1px 0 #242424, -1px 0 #242424, 0 1px #242424, 0 -1px #242424; }
.reticle::before { width: 2px; height: 12px; left: 5px; top: 0; }
.reticle::after { width: 12px; height: 2px; left: 0; top: 5px; }
.heart.partial { color: transparent; background: linear-gradient(90deg, var(--coral) var(--heart-fill), rgba(191, 201, 188, .24) var(--heart-fill)); -webkit-background-clip: text; background-clip: text; text-shadow: none; }
.inventory-overlay { z-index: 12; padding: clamp(8px, 2vw, 25px); background: rgba(3, 10, 7, .78); }
.inventory-panel { width: min(100%, 940px); height: min(760px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.inventory-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 23px 15px; border-bottom: 1px solid rgba(198, 234, 187, .14); }
.inventory-heading h2 { margin: 5px 0 0; color: #f0f5e8; font: 700 28px/1 var(--display); letter-spacing: -.04em; }
.inventory-close { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(198, 234, 187, .2); border-radius: 3px; color: #c5d2c0; background: rgba(255, 255, 255, .035); font: 8px/1 var(--mono); letter-spacing: .09em; cursor: pointer; }
.inventory-close:hover { color: var(--acid); border-color: rgba(189, 255, 91, .5); }
.inventory-close span { font: 20px/0.7 var(--display); }
.inventory-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 248px; overflow: hidden; }
.inventory-main { min-height: 0; overflow-y: auto; padding: 16px 20px 18px; scrollbar-color: rgba(189, 255, 91, .32) rgba(0, 0, 0, .16); scrollbar-width: thin; }
.inventory-section + .inventory-section { margin-top: 20px; }
.inventory-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.inventory-section-heading h3 { margin: 0; color: #e0ecd9; font: 700 10px/1 var(--mono); letter-spacing: .12em; }
.inventory-section-heading > span { color: #829387; font: 7px/1.3 var(--mono); letter-spacing: .055em; text-align: right; }
.inventory-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.inventory-item-card { min-width: 0; min-height: 57px; position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 7px; border: 1px solid rgba(198, 234, 187, .12); border-radius: 3px; color: #dce8d7; background: rgba(5, 14, 10, .62); text-align: left; }
.block-item-card { cursor: pointer; }
.block-item-card:hover, .block-item-card.selected { border-color: rgba(189, 255, 91, .7); background: rgba(189, 255, 91, .09); }
.inventory-block-icon { position: relative; width: 27px; height: 24px; flex: 0 0 27px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.35)); }
.inventory-block-icon::before { content: ''; position: absolute; inset: 0 1px 6px; background: var(--block-top); clip-path: polygon(50% 0, 100% 28%, 50% 56%, 0 28%); }
.inventory-block-icon::after { content: ''; position: absolute; inset: 6px 1px 0; background: linear-gradient(150deg, var(--block-left) 0 49%, var(--block-right) 50%); clip-path: polygon(0 0, 50% 24%, 100% 0, 100% 72%, 50% 100%, 0 72%); }
.inventory-block-icon i { position: absolute; z-index: 1; top: 7px; left: 12px; width: 3px; height: 3px; background: rgba(255,255,255,.58); }
.inventory-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 15px; }
.inventory-item-copy strong { overflow: hidden; color: #eef5e7; font: 600 9px/1.1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.inventory-item-copy small { overflow: hidden; color: #819183; font: 6px/1.2 var(--mono); letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.inventory-stack { position: absolute; top: 5px; right: 6px; color: #f1f4e9; font: 9px/1 var(--mono); text-shadow: 1px 1px #080e0b; }
.gear-item-card { min-height: 68px; align-items: flex-start; padding-top: 11px; padding-bottom: 27px; }
.gear-item-card.empty { opacity: .68; }
.gear-item-card.equipped { border-color: rgba(189, 255, 91, .42); background: rgba(189, 255, 91, .065); }
.inventory-gear-icon, .craft-glyph, .equipment-glyph { color: var(--gear-tint); text-shadow: 0 0 7px rgba(189, 255, 91, .16); text-shadow: 0 0 9px color-mix(in srgb, var(--gear-tint), transparent 55%); }
.inventory-gear-icon { width: 26px; flex: 0 0 26px; font: 21px/1 var(--display); text-align: center; }
.gear-action { position: absolute; right: 6px; bottom: 5px; padding: 4px 7px; border: 1px solid rgba(189, 255, 91, .35); border-radius: 2px; color: var(--acid); background: rgba(189, 255, 91, .06); font: 6px/1 var(--mono); letter-spacing: .08em; cursor: pointer; }
.gear-action:disabled { color: #819183; border-color: rgba(198, 234, 187, .1); background: transparent; cursor: default; }
.equipment-panel { min-height: 0; overflow-y: auto; padding: 17px 14px; border-left: 1px solid rgba(198, 234, 187, .14); background: rgba(7, 16, 12, .46); }
.equipment-slots { display: grid; gap: 6px; }
.equipment-slot { min-height: 61px; display: grid; grid-template-columns: 31px minmax(0, 1fr) 23px; align-items: center; gap: 7px; padding: 7px; border: 1px solid rgba(198, 234, 187, .1); border-radius: 3px; background: rgba(255,255,255,.025); }
.equipment-slot.occupied { border-color: rgba(189, 255, 91, .24); background: rgba(189, 255, 91, .055); }
.equipment-glyph { display: grid; place-items: center; width: 29px; height: 36px; border: 1px solid rgba(198, 234, 187, .12); background: rgba(0,0,0,.16); font: 19px/1 var(--display); }
.equipment-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.equipment-copy small { color: #879889; font: 6px/1 var(--mono); letter-spacing: .1em; }
.equipment-copy strong { overflow: hidden; color: #e9f2e4; font: 600 9px/1.1 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.equipment-copy em { color: #a7b7a7; font: normal 6px/1.1 var(--mono); }
.equipment-remove { width: 23px; height: 23px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(198, 234, 187, .13); border-radius: 2px; color: #a6b3a2; background: rgba(0,0,0,.2); font: 15px/1 var(--display); cursor: pointer; }
.equipment-remove:disabled { opacity: .3; cursor: default; }
.armor-rating { margin-top: 10px; padding: 9px 7px; border: 1px solid rgba(198, 234, 187, .13); color: #829387; background: rgba(0,0,0,.14); font: 7px/1.3 var(--mono); letter-spacing: .08em; text-align: center; }
.armor-rating.protected { color: #c7ef7c; border-color: rgba(189, 255, 91, .32); background: rgba(189, 255, 91, .07); }
.equipment-note { margin: 9px 3px 0; color: #77877b; font: 8px/1.5 var(--display); }
.crafting-list { display: grid; gap: 5px; }
.craft-row { min-height: 45px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid rgba(198, 234, 187, .1); border-radius: 3px; background: rgba(5, 14, 10, .52); }
.craft-glyph { display: grid; place-items: center; font: 19px/1 var(--display); }
.craft-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.craft-copy strong { color: #e6f0e0; font: 600 9px/1.1 var(--display); }
.craft-copy small { overflow: hidden; color: #879889; font: 6px/1.2 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.craft-button { min-width: 67px; padding: 7px 6px; border: 1px solid rgba(189, 255, 91, .32); border-radius: 2px; color: var(--acid); background: rgba(189, 255, 91, .07); font: 6px/1 var(--mono); letter-spacing: .04em; cursor: pointer; }
.craft-button:hover:not(:disabled) { color: #111e14; background: var(--acid); }
.craft-button:disabled { color: #829084; border-color: rgba(198, 234, 187, .1); background: transparent; cursor: default; }
.inventory-footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 17px; border-top: 1px solid rgba(198, 234, 187, .14); color: #829084; font: 6px/1.3 var(--mono); letter-spacing: .07em; }
.inventory-footer kbd { margin-right: 2px; }
.touch-controls { display: none; }
.overlay { position: absolute; z-index: 10; inset: 0; display: none; place-items: center; overflow-y: auto; padding: 27px; background: rgba(4, 12, 9, .64); backdrop-filter: blur(3.5px); }
.overlay.active { display: grid; }
.screen-panel { width: min(100%, 930px); border: 1px solid rgba(198, 234, 187, .2); border-radius: 5px; background: linear-gradient(145deg, rgba(19, 33, 26, .985), rgba(13, 25, 20, .99)); box-shadow: 0 20px 70px rgba(0, 0, 0, .5), 5px 5px 0 rgba(4, 9, 7, .5), inset 0 1px rgba(255, 255, 255, .035); }
.start-panel { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(240px, .78fr); overflow: hidden; }
.start-main { padding: clamp(24px, 4vw, 43px) clamp(23px, 4vw, 46px) 25px; }
.eyebrow { color: #9eb29f; font: 9px/1.4 var(--mono); letter-spacing: .13em; }
.eyebrow-mark { display: inline-block; width: 7px; height: 7px; margin: 0 7px 0 0; background: var(--mint); box-shadow: 0 0 8px rgba(84, 229, 154, .46); transform: rotate(45deg); }
.start-main h1 { margin: 21px 0 8px; color: #f3f7ea; font: 700 clamp(45px, 7vw, 76px)/.89 var(--display); letter-spacing: -.095em; text-transform: uppercase; }
.start-main h1 span { color: var(--acid); }
.title-cursor { display: inline-block; width: 8px; height: .77em; margin-left: 7px; background: var(--mint); transform: translateY(.02em); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.start-copy { max-width: 440px; margin: 17px 0 23px; color: #a8b6a7; font-size: 14px; line-height: 1.5; }
.mode-picker { display: grid; gap: 9px; }
.mode-button { width: 100%; min-height: 65px; display: flex; align-items: center; gap: 13px; padding: 11px 13px; text-align: left; border: 1px solid rgba(203, 230, 195, .17); border-radius: 3px; color: var(--ink); background: rgba(255, 255, 255, .025); cursor: pointer; transition: .16s ease; }
.mode-button:hover { transform: translate(2px, -2px); box-shadow: -2px 2px 0 rgba(189, 255, 91, .15); }
.survival-choice:hover { border-color: rgba(255, 111, 98, .7); background: rgba(255, 111, 98, .055); }
.creative-choice:hover { border-color: rgba(189, 255, 91, .7); background: rgba(189, 255, 91, .055); }
.mode-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 3px; background: rgba(255, 255, 255, .055); font: 20px/1 var(--mono); }
.heart-icon { color: var(--coral); text-shadow: 0 0 12px rgba(255, 111, 98, .4); }
.build-icon { color: var(--acid); }
.mode-details { display: grid; gap: 5px; }
.mode-details strong { font: 700 12px/1 var(--mono); letter-spacing: .08em; }
.mode-details small { color: #8fa091; font: 8px/1.25 var(--mono); letter-spacing: .025em; }
.mode-arrow { margin-left: auto; color: #829582; font: 20px/1 var(--mono); transition: .15s; }
.mode-button:hover .mode-arrow { color: var(--acid); transform: translate(2px, -2px); }
.quick-tip { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; color: #8d9c8e; font: 10px/1.55 var(--mono); }
.tip-spark { color: var(--acid); }
kbd { padding: 2px 4px; color: #d5e3d1; border: 1px solid rgba(207, 228, 200, .2); border-radius: 2px; background: rgba(255, 255, 255, .04); font: 8px/1 var(--mono); box-shadow: 0 2px rgba(0, 0, 0, .25); }
.quick-tip strong { color: #c4d5bd; font-weight: 500; }
.scores-panel { display: flex; flex-direction: column; min-width: 0; padding: 27px 23px 19px; border-left: 1px solid rgba(194, 231, 189, .12); background: rgba(4, 13, 9, .2); }
.scores-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 15px; border-bottom: 1px solid rgba(194, 231, 189, .12); }
.scores-heading h2 { margin: 7px 0 0; color: #e5eddf; font: 600 19px/1 var(--display); letter-spacing: -.04em; }
.trophy { color: #baff58; font: 24px/1 var(--mono); transform: rotate(180deg); }
.score-list { flex: 1; min-height: 130px; }
.score-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 43px; border-bottom: 1px solid rgba(194, 231, 189, .075); }
.score-rank { color: #6e8173; font: 9px/1 var(--mono); }
.score-row:first-child .score-rank { color: var(--acid); }
.score-mode { display: block; color: #c5d3c3; font: 9px/1.2 var(--mono); letter-spacing: .03em; text-transform: uppercase; }
.score-date { display: block; margin-top: 4px; color: #6c8071; font: 8px/1 var(--mono); }
.score-value { color: var(--acid); font: 500 11px/1 var(--mono); }
.score-empty { display: grid; min-height: 128px; place-items: center; color: #738477; font: 10px/1.6 var(--mono); text-align: center; }
.scores-foot { margin: 14px 0 0; color: #65786b; font: 8px/1 var(--mono); letter-spacing: .13em; }
.overlay-foot { position: absolute; right: 25px; bottom: 17px; left: 25px; display: flex; justify-content: space-between; gap: 14px; color: rgba(218, 232, 211, .6); font: 8px/1.3 var(--mono); letter-spacing: .045em; pointer-events: none; }
.overlay-foot i, .desktop-hint i { color: #617469; font-style: normal; }

.pause-panel { width: min(100%, 420px); padding: 34px 39px 27px; text-align: center; }
.pause-icon { display: flex; justify-content: center; gap: 6px; margin: 0 auto 18px; }
.pause-icon span { width: 7px; height: 22px; background: var(--acid); box-shadow: 2px 2px 0 rgba(4, 9, 6, .5); }
.pause-panel h2, .gameover-panel h2 { margin: 8px 0 8px; color: #f0f5e8; font: 700 clamp(30px, 5vw, 43px)/1 var(--display); letter-spacing: -.07em; }
.pause-summary { margin: 0 0 24px; color: #93a395; font: 11px/1.55 var(--mono); }
.pause-summary strong { color: var(--acid); font-weight: 500; }
.screen-actions { display: grid; gap: 8px; }
.primary-button, .secondary-button, .text-button { min-height: 43px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font: 10px/1 var(--mono); letter-spacing: .09em; transition: .15s ease; }
.primary-button { display: flex; justify-content: space-between; align-items: center; padding: 0 15px; color: #14200f; border-color: #d5ff91; background: var(--acid); box-shadow: 3px 3px 0 rgba(0, 0, 0, .28); font-weight: 500; }
.primary-button span { font-size: 16px; }
.primary-button:hover { background: #d0ff82; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0, 0, 0, .28); }
.secondary-button { color: #d1ddcd; background: rgba(255, 255, 255, .035); border-color: rgba(207, 232, 202, .19); }
.secondary-button:hover { background: rgba(255, 255, 255, .075); border-color: rgba(207, 232, 202, .4); }
.text-button { min-height: 33px; color: #859787; background: transparent; font-size: 9px; }
.text-button:hover { color: var(--acid); }
.pause-foot { margin: 22px 0 0; color: #718375; font: 8px/1 var(--mono); letter-spacing: .06em; }
.pause-foot kbd { margin: 0 2px; }
.gameover-panel { width: min(100%, 770px); display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; }
.gameover-copy { padding: 32px clamp(24px, 4vw, 40px); }
.danger-eyebrow { color: #ff978c; }
.danger-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--coral); box-shadow: 0 0 9px rgba(255, 111, 98, .55); transform: rotate(45deg); }
.gameover-panel h2 { margin-top: 15px; }
.gameover-copy > p { max-width: 370px; margin: 10px 0 20px; color: #9eada0; font-size: 12px; line-height: 1.55; }
.run-score { display: grid; justify-items: start; gap: 5px; margin: 18px 0 22px; padding: 13px 15px; border-left: 2px solid var(--coral); background: rgba(255, 255, 255, .035); }
.run-score > span { color: #819183; font: 8px/1 var(--mono); letter-spacing: .12em; }
.run-score strong { color: var(--acid); font: 700 34px/1 var(--mono); letter-spacing: .03em; }
.run-score small { color: #849487; font: 8px/1.3 var(--mono); letter-spacing: .06em; }
.gameover-copy .screen-actions { grid-template-columns: 1fr 1fr; }
.gameover-copy .primary-button { grid-column: 1 / -1; }
.gameover-scores { padding: 25px 20px 18px; }
.gameover-scores .score-list { min-height: 175px; }

.page-footer { min-height: 23px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 2px; color: #94a395; font: 8px/1.2 var(--mono); letter-spacing: .09em; }
.footer-cube { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: var(--mint); transform: rotate(45deg); }
.footer-muted { color: #58695e; }
.page-footer a { color: #99aa9a; text-decoration: none; white-space: nowrap; }
.page-footer a:hover { color: var(--acid); }
.desktop-hint { color: #748376; text-align: center; }
.desktop-hint kbd { margin: 0 2px; }

@media (max-width: 700px), (pointer: coarse) {
  .inventory-overlay { padding: 5px; place-items: stretch center; }
  .inventory-panel { width: min(100%, 560px); height: 100%; max-height: 100%; }
  .inventory-heading { padding: 12px 14px; }
  .inventory-heading h2 { font-size: 22px; }
  .inventory-layout { display: flex; flex-direction: column; overflow-y: auto; }
  .inventory-main { order: 2; flex: 0 0 auto; overflow: visible; padding: 12px; }
  .equipment-panel { order: 1; flex: 0 0 auto; overflow: visible; padding: 12px; border-right: 0; border-bottom: 1px solid rgba(198, 234, 187, .14); border-left: 0; }
  .equipment-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-footer { padding: 8px 10px; font-size: 5px; }
}
@media (max-width: 430px) {
  .inventory-overlay { padding: 3px; }
  .inventory-heading { padding: 10px 11px; }
  .inventory-heading h2 { font-size: 20px; }
  .inventory-main, .equipment-panel { padding: 10px; }
  .equipment-slots { grid-template-columns: 1fr; }
  .inventory-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .inventory-item-card { gap: 5px; padding-left: 5px; }
  .inventory-item-copy strong { font-size: 8px; }
  .inventory-footer { display: none; }
}
@media (max-width: 900px) {
  .app { padding-right: 15px; padding-left: 15px; }
  .topbar { gap: 12px; }
  .brand, .topbar-right { min-width: 180px; }
  .topbar-center { font-size: 8px; gap: 6px; }
  .start-panel { grid-template-columns: minmax(0, 1fr) minmax(210px, .75fr); }
  .scores-panel { padding-right: 17px; padding-left: 17px; }
  .desktop-hint { font-size: 7px; }
}
@media (max-width: 700px), (pointer: coarse) {
  body { overscroll-behavior: none; }
  .app { min-height: 100svh; padding: max(6px, env(safe-area-inset-top)) 7px max(5px, env(safe-area-inset-bottom)); gap: 7px; }
  .topbar { height: 44px; flex-basis: 44px; gap: 7px; }
  .brand { min-width: 0; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 7px; }
  .topbar-center { gap: 5px; font-size: 7px; letter-spacing: .025em; }
  .topbar-center .online-dot { width: 5px; height: 5px; }
  .topbar-center .top-divider { display: none; }
  .topbar-center #header-mode { display: none; }
  .topbar-right { min-width: 0; gap: 5px; }
  .best-badge { gap: 5px; padding: 6px; font-size: 7px; }
  .best-badge strong { font-size: 9px; }
  .home-link { width: 29px; height: 29px; }
  .game-main { align-items: stretch; }
  .game-stage { height: calc(100svh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; flex: 1; border-radius: 6px; }
  .hud-top-left, .hud-top-right { top: 8px; gap: 5px; }
  .hud-top-left { left: 7px; flex-direction: column; align-items: flex-start; }
  .hud-top-right { right: 7px; }
  .health-card { min-width: 0; gap: 3px; padding: 6px 7px; }
  .hud-label { font-size: 7px; }
  .heart { font-size: 14px; }
  .hearts { gap: 2px; }
  .world-chip { height: 25px; padding: 0 7px; gap: 6px; font-size: 7px; }
  .sun-pixel { width: 8px; height: 8px; }
  .flight-chip { height: 22px; padding: 0 7px; gap: 4px; font-size: 7px; }
  .score-card { min-width: 78px; padding: 6px 6px 5px; gap: 2px; }
  .score-card strong { font-size: 13px; }
  .score-best { font-size: 6px; }
  .look-button, .attack-button { display: none; }
  .hud-button { width: 29px; height: 29px; flex-basis: 29px; }
  .hud-button svg { width: 14px; height: 14px; }
  .toast { top: 72px; padding: 7px 8px; font-size: 8px; }
  .hotbar-wrap { bottom: 8px; }
  .hotbar { gap: 2px; padding: 3px; }
  .hotbar-slot { width: clamp(28px, calc(10vw - 2px), 45px); height: 43px; gap: 1px; padding: 3px 1px 2px; }
  .block-icon { width: 19px; height: 17px; transform: scale(.88); }
  .hotbar-name { font-size: 6px; }
  .hotbar-count { top: 1px; right: 2px; font-size: 8px; }
  .hotbar-key { bottom: 1px; left: 2px; font-size: 6px; }
  .hotbar-tip { display: none; }
  .reticle { opacity: .78; }
  .touch-controls { position: absolute; right: 7px; bottom: 65px; left: 7px; display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
  .touch-pad { width: 106px; height: 104px; display: grid; grid-template: repeat(3, 33px) / repeat(3, 33px); gap: 3px; pointer-events: auto; }
  .dpad { display: grid; place-items: center; padding: 0; border: 1px solid rgba(192, 227, 185, .24); border-radius: 4px; color: #e3f0db; background: rgba(9, 19, 15, .84); box-shadow: 0 3px 9px rgba(0, 0, 0, .32); font: 11px/1 var(--mono); touch-action: none; -webkit-user-select: none; user-select: none; }
  .dpad:active, .dpad.held { color: #111e14; background: var(--acid); border-color: #d5ff92; }
  .dpad.up { grid-area: 1 / 2; }
  .dpad.left { grid-area: 2 / 1; }
  .dpad.right { grid-area: 2 / 3; }
  .dpad.down { grid-area: 3 / 2; }
  .touch-actions { display: grid; gap: 5px; pointer-events: auto; }
  .touch-action { width: 60px; height: 38px; display: flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0 6px; border: 1px solid rgba(192, 227, 185, .25); border-radius: 4px; color: #dbe8d5; background: rgba(9, 19, 15, .87); box-shadow: 0 3px 9px rgba(0, 0, 0, .3); font: 7px/1 var(--mono); letter-spacing: .025em; touch-action: none; -webkit-user-select: none; user-select: none; }
  .touch-action:active, .touch-action.held { border-color: var(--acid); background: rgba(189, 255, 91, .2); color: #f1ffdf; }
  .action-glyph { min-width: 13px; color: var(--acid); font-size: 12px; text-align: center; }
  .action-attack .action-glyph { color: #ff998c; }
  .page-footer { display: none; }
  .overlay { padding: 10px; }
  .start-panel { width: min(100%, 520px); grid-template-columns: 1fr; max-height: calc(100% - 18px); overflow-y: auto; }
  .start-main { padding: 22px 20px 18px; }
  .start-main h1 { margin-top: 13px; font-size: clamp(43px, 13vw, 60px); }
  .start-copy { margin: 11px 0 16px; font-size: 12px; }
  .mode-picker { grid-template-columns: 1fr 1fr; gap: 7px; }
  .mode-button { min-height: 82px; display: grid; grid-template-columns: 29px 1fr; align-content: center; gap: 3px 7px; padding: 8px; }
  .mode-icon { width: 28px; height: 28px; grid-row: 1 / span 2; font-size: 16px; }
  .mode-details { gap: 5px; }
  .mode-details strong { font-size: 10px; }
  .mode-details small { font-size: 7px; line-height: 1.35; }
  .mode-arrow { display: none; }
  .quick-tip { margin-top: 13px; font-size: 8px; }
  .scores-panel { padding: 13px 18px 13px; border-top: 1px solid rgba(194, 231, 189, .12); border-left: 0; }
  .scores-heading { padding-bottom: 8px; }
  .scores-heading h2 { margin-top: 4px; font-size: 15px; }
  .scores-heading .eyebrow { font-size: 7px; }
  .trophy { font-size: 18px; }
  .score-list { min-height: 0; }
  .score-row { min-height: 31px; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; }
  .score-mode { font-size: 8px; }
  .score-date { display: none; }
  .score-value { font-size: 9px; }
  .score-empty { min-height: 42px; font-size: 8px; }
  .scores-foot { margin-top: 7px; font-size: 7px; }
  .overlay-foot { display: none; }
  .pause-panel { max-width: 390px; padding: 25px 25px 21px; }
  .pause-icon { margin-bottom: 13px; }
  .pause-panel h2 { font-size: 36px; }
  .pause-summary { margin-bottom: 17px; }
  .pause-foot { margin-top: 15px; }
  .gameover-panel { max-height: calc(100% - 8px); overflow-y: auto; grid-template-columns: 1fr; width: min(100%, 440px); }
  .gameover-copy { padding: 22px 20px 18px; }
  .gameover-panel h2 { margin-top: 9px; font-size: 34px; }
  .gameover-copy > p { margin: 7px 0 12px; font-size: 11px; }
  .run-score { margin: 12px 0 15px; padding: 10px 12px; }
  .run-score strong { font-size: 27px; }
  .gameover-scores { padding: 13px 18px 12px; }
  .gameover-scores .score-list { min-height: 0; }
  .gameover-scores .score-row:nth-child(n+4) { display: none; }
  .gameover-copy .screen-actions { grid-template-columns: 1fr 1fr; }
  .gameover-copy .primary-button { min-height: 39px; }
  .secondary-button, .text-button { min-height: 38px; }
}
@media (max-width: 370px) {
  .hotbar-slot { width: clamp(25px, calc(11.111vw - 4.667px), 33px); }
  .hud-top-right { right: 5px; gap: 3px; }
  .score-card { min-width: 64px; padding-right: 4px; padding-left: 4px; }
  .score-card strong { font-size: 11px; }
  .hud-button { width: 26px; height: 26px; flex-basis: 26px; }
  .health-card { padding-right: 5px; padding-left: 5px; }
  .hearts { gap: 1px; }
  .heart { font-size: 12px; }
  .topbar-center { display: none; }
  .mode-picker { grid-template-columns: 1fr; }
  .mode-button { min-height: 56px; display: flex; padding: 7px 9px; }
  .mode-icon { width: 29px; height: 29px; }
  .mode-arrow { display: block; }
  .start-main { padding: 18px 15px 13px; }
  .start-main h1 { margin-top: 10px; }
  .start-copy { margin: 8px 0 12px; }
  .quick-tip { margin-top: 10px; }
  .scores-panel { padding: 10px 14px; }
  .touch-pad { transform: scale(.9); transform-origin: left bottom; }
  .touch-action { width: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
