html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f0e2a8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #3a2a14;
  user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: default;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  background: rgba(255, 248, 220, 0.85);
  border: 1px solid rgba(110, 78, 40, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 14px rgba(80, 50, 20, 0.18);
  min-width: 200px;
  max-width: 260px;
  backdrop-filter: blur(4px);
}

#hud .row.tight-sub {
  padding: 1px 0;
  font-size: 12px;
}

#hud .row.contents {
  display: block;
  padding-top: 4px;
}

#hud .value.small {
  font-size: 12px;
  font-weight: 600;
  color: #6e4e28;
}

#hud .value.wrap {
  display: block;
  white-space: normal;
  line-height: 1.35;
  color: #3a2a14;
  font-weight: 600;
  font-size: 12px;
}

#hud .value.cap-warn {
  color: #c79b1c;
}
#hud .value.cap-full {
  color: #c44030;
}

.vigor-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 2px;
}

.vigor-bar {
  position: relative;
  height: 14px;
  background: rgba(110, 78, 40, 0.18);
  border: 1px solid rgba(110, 78, 40, 0.35);
  border-radius: 7px;
  overflow: hidden;
}

.vigor-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #d05a3a, #e6a248 70%, #f0c060);
  width: 100%;
  transition: width 0.25s ease, background 0.4s ease;
}

.vigor-fill.low {
  background: linear-gradient(90deg, #b04830, #d07a3a);
}
.vigor-fill.crit {
  background: linear-gradient(90deg, #802018, #b03a20);
}
.vigor-fill.boost {
  background: linear-gradient(90deg, #4ab088, #80d8a8 70%, #b8f0c8);
}

.vigor-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff8dc;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

.food-priority {
  display: block;
  width: 100%;
  background: rgba(255, 248, 220, 0.7);
  border: 1px solid rgba(110, 78, 40, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6e4e28;
  cursor: pointer;
  letter-spacing: 0.4px;
  font-family: inherit;
}

.food-priority:hover {
  background: rgba(255, 248, 220, 0.95);
  border-color: rgba(110, 78, 40, 0.55);
}

#depositPopup {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(255, 248, 220, 0.92);
  border: 1px solid rgba(110, 78, 40, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 14px rgba(80, 50, 20, 0.22);
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  transition: opacity 0.2s linear;
  backdrop-filter: blur(4px);
}

#depositPopup .dp-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(110, 78, 40, 0.7);
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(110, 78, 40, 0.18);
  padding-bottom: 2px;
}

#depositPopup .dp-row {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#hud .section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(110, 78, 40, 0.7);
  margin: 6px 0 2px;
  border-bottom: 1px solid rgba(110, 78, 40, 0.18);
  padding-bottom: 2px;
}

#hud .section-label:first-child {
  margin-top: 0;
}

#hud .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

#hud .row.tight {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(110, 78, 40, 0.18);
}

#hud .label {
  color: #6e4e28;
  font-weight: 500;
}

#hud .value {
  color: #3a2a14;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

#hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-size: 13px;
  color: #3a2a14;
  text-shadow: 0 1px 0 rgba(255, 248, 220, 0.5);
  pointer-events: none;
  transition: opacity 0.6s ease;
  background: rgba(255, 248, 220, 0.85);
  border: 1px solid rgba(110, 78, 40, 0.3);
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 4px 14px rgba(80, 50, 20, 0.18);
  backdrop-filter: blur(4px);
}

#hint.fade {
  opacity: 0.35;
}

.side-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: rgba(255, 248, 220, 0.95);
  border: 1px solid rgba(110, 78, 40, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(80, 50, 20, 0.28);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.side-panel .panel-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #3a2a14;
  margin-bottom: 2px;
}

.side-panel .panel-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(110, 78, 40, 0.7);
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(110, 78, 40, 0.18);
  padding-bottom: 6px;
}

.stat-row, .shop-row {
  border: 1px solid rgba(110, 78, 40, 0.18);
  background: rgba(255, 248, 220, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.stat-row .stat-head, .shop-row .shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: #3a2a14;
}

.stat-row .stat-lv, .shop-row .shop-lv {
  background: #6e4e28;
  color: #fff8dc;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0.4px;
}

.stat-row .stat-line, .shop-row .shop-line {
  font-size: 12px;
  color: #6e4e28;
  margin-top: 2px;
  font-weight: 500;
}

.stat-row .stat-line .label, .shop-row .shop-line .label {
  color: rgba(110, 78, 40, 0.85);
  font-weight: 600;
  margin-right: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.shop-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.shop-row .shop-info {
  flex: 1;
  min-width: 0;
}

.shop-row .shop-cost {
  font-size: 12px;
  margin-top: 4px;
  color: #6e4e28;
  font-weight: 600;
}

.shop-row .shop-cost .cost-item {
  display: inline-block;
  margin-right: 6px;
}

.shop-row .shop-cost .cost-item.short {
  color: #b04030;
}

.shop-row .shop-buy {
  align-self: center;
  background: #6e4e28;
  color: #fff8dc;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  min-width: 56px;
}

.shop-row .shop-buy:hover:not(:disabled) {
  background: #8a6238;
}

.shop-row .shop-buy:disabled {
  background: rgba(110, 78, 40, 0.3);
  color: rgba(60, 40, 20, 0.5);
  cursor: not-allowed;
}
