/* Styling for the updated Crumpet Capitalist layout. The page is divided
 * into three main panels: a narrow left-hand column with the scoreboard
 * and clickable crumpet, a central play area showing graphical
 * representations of your purchased equipment, and a right-hand column
 * housing the upgrade store. Colours and textures nod to the original
 * Cookie Clicker aesthetic while retaining the warm palette of a British
 * tea room.
 */

html, body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 100%;
  overflow: hidden;
}

/* Top bar with the game title */
#top-bar {
  width: 100%;
  background-color: #4f2a2a; /* dark brown */
  color: #f9f5f0;           /* near-white for contrast */
  text-align: center;
  padding: 10px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#top-bar h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

/* Container for the three panels */
#game-row {
  display: flex;
  height: calc(100vh - 50px);
  /* account for top bar height */
  background-color: #f6f1e3; /* overall beige background */
}

/* Left panel: scoreboard and big crumpet */
#left-panel {
  width: 28%;
  min-width: 240px;
  background-color: #f0e5d0;
  border-right: 2px solid #cbb198;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Scoreboard shows current crumpets and crumpets per second */
#scoreboard {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
  color: #4a2e2e;
}

/* Emphasise the numbers within the scoreboard */
#crumpet-count, #cps {
  font-weight: bold;
  font-size: 1.6rem;
}

/* Big clickable crumpet */
#crumpet-area {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#big-crumpet {
  width: 256px;
  height: 256px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

#big-crumpet:active {
  transform: scale(0.95);
}

/* Layer on top of the crumpet to hold cursor icons */
#cursor-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 256px;
  height: 256px;
  pointer-events: none;
}

.cursor-icon {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transform-origin: center center;
  filter: invert(1) drop-shadow(0 0 1px rgba(0,0,0,0.6));
  animation: orbitFloat 5s ease-in-out infinite;
}

/* Centre panel: graphic representation of equipment */
#center-panel {
  flex-grow: 1;
  background-color: #d4e1f2; /* soft blue */
  background-image: repeating-linear-gradient(0deg,
    rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 4px,
    rgba(0,0,0,0.02) 4px, rgba(0,0,0,0.02) 8px);
  overflow-y: auto;
  border-right: 2px solid #cbb198;
  padding: 20px;
  box-sizing: border-box;
}

#equipment-area {
  max-width: 100%;
}

/* New layout for lanes to resemble Cookie Clicker walkway */
.lane {
  position: relative;
  height: 48px;
  margin-bottom: 6px;
  border-top: 2px solid #b58863;
  border-bottom: 2px solid #b58863;
  background-color: #c6d3e7;
  display: flex;
  align-items: center;
  padding-left: 6px;
  overflow: hidden;
}

.lane-icons {
  display: flex;
  align-items: center;
}

.lane-icon {
  width: 32px;
  height: 32px;
  margin-right: 4px;
  image-rendering: pixelated;
}

.lane-count {
  margin-left: 6px;
  font-weight: bold;
  color: #4a2e2e;
}

/* Each row representing a type of equipment */
.equipment-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.equipment-label {
  width: 90px;
  font-weight: bold;
  margin-right: 10px;
  color: #3a2a1e;
}

.equipment-icons {
  display: flex;
  flex-wrap: wrap;
}

.equip-icon {
  margin: 2px;
  font-size: 22px;
  line-height: 1;
}

/* Multiplier indicator shown when there are many pieces of a given equipment */
.equip-count {
  margin-left: 6px;
  font-weight: bold;
  font-size: 1.2rem;
  align-self: center;
}

/* Right panel: upgrade store */
#right-panel {
  width: 28%;
  min-width: 240px;
  background-color: #f5f5dc; /* light cream */
  padding: 20px 10px;
  box-sizing: border-box;
  overflow-y: auto;
}

#right-panel h2 {
  text-align: center;
  margin-top: 0;
  font-size: 1.5rem;
  color: #4a2e2e;
}

/* Individual upgrade rows */
.upgrade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.9rem;
}

.upgrade:hover {
  background-color: #f0e6d2;
}

.upgrade.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upgrade-name {
  font-weight: bold;
}

.upgrade-cost, .upgrade-quantity {
  margin-left: 8px;
  white-space: nowrap;
}

/* Cursor floating animation keyframes */
@keyframes orbitFloat {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-5px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(5px); }
}
