/* Aegis of Athens v2 — full-viewport isometric canvas, touch-first. */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  overflow: hidden;
  background: #14202e;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
#game { display: block; width: 100vw; height: 100vh; touch-action: none; }

/* ---- Hire / repair dock (bottom-right) ---- */
#hire-dock {
  position: fixed;
  bottom: 14px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 20;
}
.hbtn {
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #2a1c0a;
  background: linear-gradient(180deg, #f3e6c4, #e0cd9c);
  border: 2px solid #b8912f;
  border-radius: 13px;
  padding: 9px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
  transition: transform 0.06s, filter 0.1s;
}
.hbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.hbtn .cost { font-size: 12px; font-weight: 800; color: #7a5a12; }
.hbtn.afford { border-color: #2f7a2f; }
.hbtn.afford .cost { color: #2f7a2f; }
.hbtn.poor { filter: grayscale(0.5) brightness(0.92); opacity: 0.8; }
.hbtn.poor .cost { color: #a3543a; }

/* ---- End-game modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 18, 0.72);
  backdrop-filter: blur(3px);
}
.modal.show { display: flex; }
.card {
  width: min(480px, 92vw);
  background: linear-gradient(180deg, #f3e6c4, #e3cf9e);
  border: 4px solid #b8912f;
  border-radius: 18px;
  padding: 26px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  font-family: system-ui, sans-serif;
}
.card h1 { font-family: Georgia, serif; font-size: 30px; color: #7a3b12; margin-bottom: 10px; }
.card h1.win { color: #2f7a2f; }
.card h1.lose { color: #a33327; }
.card p { color: #4a3418; font-size: 15px; line-height: 1.5; margin-bottom: 18px; }
.hbtn.primary {
  display: inline-flex; flex-direction: row;
  font-size: 17px; padding: 12px 24px;
  background: linear-gradient(180deg, #f0c04a, #d29a24);
}

/* ---- Upgrade shop panel ---- */
#shop {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(390px, 90vw);
  background: rgba(30, 22, 12, 0.94);
  border-left: 4px solid #b8912f;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
  z-index: 50; display: flex; flex-direction: column;
  font-family: system-ui, sans-serif;
}
#shop.show { transform: translateX(0); }
.shop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; color: #e8c86a; font-weight: 800; font-size: 17px;
  border-bottom: 2px solid rgba(232,200,106,0.3);
}
#close-shop { background: none; border: none; color: #e3d6b0; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.shop-body { overflow-y: auto; padding: 8px 12px 24px; -webkit-overflow-scrolling: touch; }
.shop-sec { color: #e8c86a; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 14px 4px 8px; opacity: 0.85; }
.shop-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; font-family: inherit;
  background: linear-gradient(180deg, #4a3a20, rgba(53,40,21,0.25));
  border: 2px solid rgba(232,200,106,0.3); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; color: #f0e6cc; cursor: pointer;
  transition: transform 0.06s, border-color 0.1s;
}
.shop-item:active { transform: scale(0.98); }
.si-main { display: flex; flex-direction: column; gap: 2px; }
.si-name { font-weight: 800; font-size: 15px; }
.si-lv { color: #e8c86a; font-size: 12px; }
.si-desc { font-size: 12px; opacity: 0.72; }
.si-cost { flex-shrink: 0; font-weight: 800; font-size: 14px; padding: 5px 10px; border-radius: 10px; background: rgba(0,0,0,0.3); color: #e8c86a; }
.shop-item.afford { border-color: #6fbf73; }
.shop-item.afford .si-cost { background: #2f6a30; color: #d8ffd0; }
.shop-item.poor { opacity: 0.72; }
.shop-item.maxed { opacity: 0.5; }
.shop-item.maxed .si-cost { background: #444; color: #ccc; }
