/* ==========================================================================
   style.css — HUD, toolbar, panels. Classic tycoon-ish dark UI.
   ========================================================================== */

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: "Lucida Grande", Verdana, sans-serif;
  font-size: 13px;
  background: #2a3340;
  user-select: none;
}

#game { display: block; cursor: crosshair; }

/* ---------- Top HUD ---------- */

#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px;
  background: linear-gradient(#3b4554, #2e3845);
  border-bottom: 2px solid #1d242e;
  color: #e8e8e8;
  flex-wrap: wrap;
  z-index: 10;
}

.hud-item {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 10px;
  font-weight: bold;
  white-space: nowrap;
}

.hud-label { opacity: 0.9; }
.hud-objective { font-weight: normal; font-size: 12px; color: #ffd34d; }

#hud-cash { transition: color 0.15s; }
.flash-green { color: #7ed87e !important; }
.flash-red { color: #e87e7e !important; }

.hud-btn {
  background: #4a5668; color: #fff; border: 1px solid #1d242e;
  border-radius: 3px; padding: 2px 9px; cursor: pointer; font-size: 13px;
}
.hud-btn:hover { background: #5a6a80; }

/* ---------- Left toolbar ---------- */

#toolbar {
  position: fixed; left: 8px; top: 56px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 10;
}

.tool-btn {
  width: 46px; height: 46px;
  font-size: 22px;
  background: linear-gradient(#465263, #353f4d);
  border: 2px solid #1d242e;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
}
.tool-btn:hover { background: #56647a; }
.tool-btn.active { border-color: #ffd34d; background: #5a6a85; }

/* ---------- Building palette ---------- */

#palette {
  position: fixed; left: 62px; top: 56px;
  width: 188px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  background: rgba(38, 46, 58, 0.95);
  border: 2px solid #1d242e;
  border-radius: 6px;
  padding: 8px;
  z-index: 9;
}

.palette-title {
  color: #ffd34d; font-weight: bold; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  margin: 6px 0 4px;
}

.palette-row { display: flex; flex-direction: column; gap: 3px; }

.palette-btn {
  display: flex; align-items: center; gap: 6px;
  background: #3b4554; color: #e8e8e8;
  border: 1px solid #28303c; border-radius: 4px;
  padding: 5px 7px; cursor: pointer; text-align: left;
  font-size: 12px;
}
.palette-btn:hover { background: #4a5668; }
.palette-btn.active { border-color: #ffd34d; background: #50607a; }
.p-icon { font-size: 15px; }
.p-name { flex: 1; }
.p-cost { color: #7ed87e; font-weight: bold; }

/* ---------- Coaster panel ---------- */

#coaster-panel {
  position: fixed; right: 8px; top: 56px;
  width: 230px;
  background: rgba(38, 46, 58, 0.96);
  border: 2px solid #1d242e;
  border-radius: 6px;
  padding: 10px;
  color: #e8e8e8;
  display: none;
  z-index: 10;
}
#coaster-panel h3 { font-size: 14px; margin-bottom: 6px; color: #ffd34d; }
#coaster-status { font-size: 12px; line-height: 1.45; margin-bottom: 8px; min-height: 32px; }

.cp-row { display: flex; gap: 4px; margin-bottom: 4px; }
.cp-row button, #coaster-open {
  flex: 1; padding: 7px 4px;
  background: #4a5668; color: #fff;
  border: 1px solid #28303c; border-radius: 4px;
  cursor: pointer; font-size: 12px;
}
.cp-row button:hover { background: #5a6a80; }
.cp-row button.danger { background: #7a4040; }
.cp-row button.danger:hover { background: #955050; }

#coaster-open { width: 100%; display: none; margin-top: 4px; }
.confirm { background: #3f7a4a !important; font-weight: bold; }
.confirm:hover { background: #4c955a !important; }

/* ---------- Inspector ---------- */

#inspector {
  position: fixed; right: 8px; bottom: 40px;
  width: 230px;
  background: rgba(38, 46, 58, 0.96);
  border: 2px solid #1d242e;
  border-radius: 6px;
  padding: 10px;
  color: #e8e8e8;
  display: none;
  z-index: 10;
}
#inspector h3 { font-size: 13px; margin-bottom: 6px; color: #ffd34d; }
#inspector-close {
  position: absolute; right: 6px; top: 6px;
  background: none; border: none; color: #aaa; cursor: pointer; font-size: 13px;
}
#inspector-close:hover { color: #fff; }

.thought { font-style: italic; color: #b8c4d4; font-size: 12px; margin-bottom: 7px; }
.irow { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12px; }
.irow span:last-child { font-weight: bold; }

.price-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.price-ctrl b { min-width: 30px; text-align: center; color: #7ed87e; }
.price-ctrl button {
  width: 20px; height: 20px;
  background: #4a5668; color: #fff;
  border: 1px solid #28303c; border-radius: 3px;
  cursor: pointer; font-size: 13px; line-height: 1;
  padding: 0;
}
.price-ctrl button:hover { background: #5a6a80; }
.price-hint { font-size: 10px; color: #9aa6b6; margin: 1px 0 3px; text-align: right; }

.ibar-label { font-size: 10px; color: #9aa6b6; margin-top: 4px; }
.ibar {
  height: 7px; background: #222a34;
  border-radius: 3px; overflow: hidden;
}
.ibar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  z-index: 20; pointer-events: none;
}
.toast {
  background: rgba(30, 38, 48, 0.94);
  border: 1px solid #ffd34d;
  color: #fff; padding: 6px 16px;
  border-radius: 16px; font-size: 12px;
  transition: opacity 0.7s;
}
.toast.warn { border-color: #e85d4e; color: #ffb0a8; }
.toast.fade { opacity: 0; }

/* ---------- End screen ---------- */

#end-screen {
  position: fixed; inset: 0;
  background: rgba(10, 14, 20, 0.75);
  display: none; align-items: center; justify-content: center;
  z-index: 30;
}
#end-box {
  background: #2e3845; border: 3px solid #ffd34d; border-radius: 10px;
  padding: 28px 36px; max-width: 440px; text-align: center; color: #fff;
}
#end-box h2 { margin-bottom: 12px; }
#end-box p { line-height: 1.5; margin-bottom: 18px; color: #cfd8e4; }
#end-box button {
  padding: 9px 22px; margin: 0 5px;
  background: #4a5668; color: #fff;
  border: 1px solid #28303c; border-radius: 5px;
  cursor: pointer; font-size: 13px;
}
#end-box button:hover { background: #5a6a80; }

/* ---------- Main menu & in-game menu ---------- */

#menu-screen, #game-menu {
  position: fixed; inset: 0;
  background: rgba(15, 20, 28, 0.88);
  display: none; align-items: center; justify-content: center;
  z-index: 40;
}
#menu-screen { display: flex; }

#menu-box, #game-menu-box {
  background: #2e3845;
  border: 3px solid #ffd34d;
  border-radius: 10px;
  padding: 26px 34px;
  width: 380px;
  color: #fff;
  text-align: center;
}
#menu-box h1 { font-size: 22px; margin-bottom: 18px; color: #ffd34d; }
#game-menu-box h2 { margin-bottom: 14px; color: #ffd34d; }
#menu-box h3, #game-menu-box h3 { font-size: 14px; margin-bottom: 10px; color: #ffd34d; }

.menu-btn {
  display: block; width: 100%;
  margin: 6px 0; padding: 11px;
  background: #4a5668; color: #fff;
  border: 1px solid #28303c; border-radius: 5px;
  cursor: pointer; font-size: 14px;
}
.menu-btn:hover { background: #5a6a80; }
.menu-btn:disabled { opacity: 0.4; cursor: default; }

#menu-newgame label { display: block; font-size: 12px; color: #9aa6b6; margin-bottom: 6px; }
#park-name-input {
  width: 100%; padding: 9px 10px; margin-bottom: 8px;
  background: #222a34; color: #fff;
  border: 1px solid #4a5668; border-radius: 5px;
  font-size: 14px; text-align: center;
}
#park-name-input:focus { outline: none; border-color: #ffd34d; }

#menu-objective { margin-top: 16px; font-size: 11px; color: #9aa6b6; line-height: 1.5; }

.slot-row {
  display: block; width: 100%;
  margin: 5px 0; padding: 8px 12px;
  background: #3b4554; color: #e8e8e8;
  border: 1px solid #28303c; border-radius: 5px;
  cursor: pointer; text-align: left; font-size: 12px;
}
.slot-row:hover { background: #4a5668; }
.slot-row.slot-empty { color: #7a8595; font-style: italic; }
.slot-name { display: block; font-weight: bold; font-size: 13px; color: #ffd34d; }
.slot-empty .slot-name { color: #7a8595; }
.slot-info { display: block; margin-top: 2px; }
.slot-time { display: block; margin-top: 2px; font-size: 10px; color: #9aa6b6; }

/* ---------- Help hint ---------- */

#help-hint {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55); font-size: 11px;
  background: rgba(0, 0, 0, 0.3); padding: 4px 14px; border-radius: 12px;
  pointer-events: none; z-index: 5;
}
