/* === Root Variables === */
:root {
  --col1: rgba(30, 32, 34, 1);
  /* Primary background */
  --col1-l: rgba(30, 32, 34, 0.75);
  /* Transparent variant */
  --col2: rgba(255, 202, 212, 1);
  /* Accent (pink) */
  --col2-l: rgba(255, 202, 212, 0.5);
  /* Accent (pink) */
  --col5: rgba(236, 231, 224, 1);
  /* Light background */

  --green: rgba(180, 245, 200, 1),
}

/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Quicksand", sans-serif;
}

/* === Base Layout === */
html,
body {
  background-color: var(--col1);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* === Alert Box === */
/* Shared styles for both alerts */
#fishAlert,
#fishInspect {
  color: var(--col2);
  position: absolute;
  padding: 1em;
  border: 2px solid var(--col2);
  border-radius: 12px;
  font-weight: bold;
  width: fit-content;
  height: fit-content;
  text-align: center;
  transition: left 0.3s ease-in-out, bottom 0.3s ease-in-out, color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

/* fishAlert specific styles */
#fishAlert {
  top: 1em;
  left: -25em;
  /* hidden by default */
}

#fishAlert.show {
  left: 1em;
}

#fishAlert.hide {
  left: -25em;
}

/* fishInspect specific styles */
#fishInspect {
  left: 1em;
  bottom: -7em;
  /* hidden by default */
  top: unset;
}

#fishInspect.show {
  bottom: 1em;
}

#fishInspect.hide {
  bottom: -7em;
}

/* === Side Menu Panel === */
#menu {
  position: absolute;
  top: 1em;
  right: 1em;
  bottom: 1em;
  width: 25em;
  border: 2px solid var(--col2-l);
  border-radius: 12px;
  padding: 1em;
  background-color: var(--col1-l);
  color: var(--col2);
  text-align: center;
  transition: right 0.3s ease-in-out, width 0.3s ease-in-out;
}

#menu.show {
  right: 1em;
}

#menu.wide {
  width: 50em;
}

#menu.hide {
  right: -25em;
  width: 25em;
}

/* === Fullscreen Canvas === */
#game,
#glCanvas {
  width: 100vw;
  height: 100vh;
}

/* === Hold Bar === */
#holdBarContainer {
  position: absolute;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 12px;
  border: 2px solid var(--col2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: none;
}

#holdBar {
  height: 100%;
  width: 0%;
  background: var(--col2);
}

/* === Divider Style === */
hr {
  border-color: var(--col2);
}

/* === Upgrade Panel Layout === */
.upgrade_container {
  display: flex;
  flex-direction: column;
  margin-top: 1em;
}

/* === Button Styles === */
.upgrade_row button,
.menu_block button,
#settings button,
#pond_select button,
.inv_header button,
.compendium_header button,
a {
  font-size: 1rem;
  margin-bottom: 1em;
  padding: 0.75em;
  font-weight: bold;
  background-color: var(--col1-l);
  border: 2px solid var(--col2);
  border-radius: 12px;
  color: var(--col2);
}

a {
  text-decoration: none;
}

.upgrade_row button:hover,
.menu_block button:hover,
#settings button:hover,
#pond_select button:hover,
.inv_header button:hover,
.compendium_header button:hover,
a:hover {
  background-color: var(--col2-l);
}

/* === Upgrade Labels === */
.right_col span,
.price_col span {
  font-size: 1rem;
  margin-bottom: 1em;
  padding: 0.75em;
  color: var(--col2);
  font-weight: bold;
}

.upgrade_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin: 0.5em 0;
}

.upgrade_row span {
  flex: 1;
  font-size: 1rem;
  font-weight: bold;
  color: var(--col2);
  text-align: center;
}

.upgrade_row button {
  margin: 0;
  flex: 0 0 9em;
  /* fixed width */
}

.upgrade_row button:hover {
  background-color: var(--btn-hover-bg, rgba(255, 255, 255, 0.1));
}


/* === Hidden by Default === */
#upgrades {
  display: none;
}

/* === Quotes Text === */
#quotes {
  position: absolute;
  top: 1em;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  font-weight: 600;
  font-style: italic;
  color: var(--col2);
  transition: opacity 0.6s ease-in-out;
  width: fit-content;
  white-space: nowrap;
  opacity: 0.5;
}

#quotes.hide {
  opacity: 0;
}

/* === Decorative Overlay === */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 202, 212, 1) 1px, transparent 2px);
  background-size: 100px 100px;
  transform: translate(-25%, 0);
  animation: grid 15s linear infinite;
  opacity: 0.2;
  rotate: 20deg;
  width: 175%;
  height: 175%;
}

@keyframes grid {
  0% {
    background-position: 0 0;
    opacity: 0.2;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    background-position: 100px 100px;
    opacity: 0.2;
  }
}

/* === Canvas Visual Effect === */
canvas {
  filter: drop-shadow(5px 30px 4px rgba(255, 202, 212, 0.4));
}

/* === General UI Panel === */
.ui-panel {
  z-index: 9;
  padding: 1rem;
  border-radius: 1rem;
  backdrop-filter: blur(10px) brightness(1.2);
}

/* === Section Containers (hidden initially) === */
#settings,
#market,
#inventory,
#compendium {
  display: none;
  flex-direction: column;
  justify-content: center;
}

/* === Bottom Menu Buttons === */
.menu_block {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 0 1em;
  width: 100%;
  text-align: right;
  display: flex;
  justify-content: flex-end;
}

.menu_block button {
  margin-left: 0.5em;
  text-align: center;
}

/* === Settings Button === */
#settings_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings_btn img {
  height: 1.5rem;
}

/* === Settings Button Block === */
.settings_block {
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.settings_block button,
.settings_block a {
  margin: 0 0.25em;
  margin-bottom: 1em;
}

/* === Utility Class === */
.no-m {
  margin-left: 0em;
}

.inventory_container {
  display: flex;
  width: 100%;
}

.left_inv,
.right_inv {
  width: 50%;
  border-bottom: 2px solid var(--col2);
}

.left_inv {
  width: 60%;
}

.right_inv {
  width: 40%;
}

.left_inv {
  border-right: 1px solid var(--col2);
}

.right_inv {
  border-left: 1px solid var(--col2);
}

.inventory-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  height: 70vh;
  overflow-y: scroll;
}

.inventory-item:first-child {
  margin-top: 1em;
}

.inventory-item:last-child {
  margin-bottom: 1em;
}

.inventory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.125rem;
  background-color: var(--col1);
}

#inventory_fish_content .inventory-item {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

#inventory_item_content .inventory-item {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.item-name {
  font-weight: bold;
}

.item-amount {
  margin-left: 0.5rem;
  color: var(--col2);
}

.item-actions {
  margin-left: auto;
  margin-right: 0.4rem;
}

.item-rarity {
  font-size: 0.9em;
  font-weight: bold;
}

.item-actions button {
  margin-left: 0.4rem;
  background: var(--col1-l);
  color: var(--col2);
  border: 2px solid var(--col2);
  padding: 0.5em;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
}

.button-hover {
  border: 2px solid var(--btn-color);
  color: var(--btn-color);
  transition: background-color 0.3s ease;
}

.button-hover:hover {
  background-color: var(--btn-hover-bg);
}

#pond_select {
  position: absolute;
  left: -15em;
  top: 50%;
  transform: translate(0, -50%);
  height: fit-content;
  width: fit-content;
  display: flex;
  border: 2px solid var(--col2-l);
  flex-direction: column;
  gap: 0.5em;
  transition: left 0.3s ease-in-out;
  padding: 0.5em;
}

#pond_select.show {
  left: 1em;
}

#pond_select.hide {
  left: -15em;
}

#pond_select button {
  margin: 0;
  border: 2px solid var(--btn-color);
  color: var(--btn-color);
}

#pond_select button:hover {
  background-color: var(--btn-hover-bg);

}

#pond_select .hide {
  display: none;
}

#pond_select .show {
  display: block;
}

.inv_header, .compendium_header {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 0.5em;
}

.inv_header button, .compendium_header button {
  margin: 0;
  margin-right: 1em;
  height: 100%;
  text-align: center;
  padding: 0.25em 1em;
}

.inv_header h2 {
  flex-grow: 1;
}

.hotkeys {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 0;
}

.hotkey_container {
  margin-top: 1em;
}

.hotkey_row span {
  font-weight: bold;
}

.hotkey_row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#compendium_content {
  overflow: scroll;
  display: grid;
  height: 78vh;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 10px;
  border-bottom: 2px solid var(--col2);

}

.compendium_header {
  justify-content: center;
  align-items: center;
  padding: 0;
}

.compendium_header button {
  position: absolute;
  left: 0;
}

.fish-entry {
  padding: 12px;
  border-radius: 12px;
  contain: layout style paint;
  will-change: transform, opacity;
}

.fish-name {
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 4px;
  margin-top: 0;
}

.fish-caught {
  margin: 0;
  font-size: 0.95em;
  color: #555;
}

.fish-entry div {
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  margin-right: auto;
}

.fish-entry div * {
  text-align: left;
  font-weight: bold;
}

.fish-entry img {
  filter: drop-shadow(0px 0px 8px rgba(0, 0, 0, 0.6));
}

#blur-menu-container {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  color: var(--col2);
  transition: backdrop-filter 0.5s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}

#blur-menu-container.no-blur {
  backdrop-filter: none;
  background-color: transparent;
}

#lore_container, #tutorial {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  background-color: var(--col1);
  padding: 2em;
  border-radius: 12px;
  border: 2px solid var(--col2-l);
  font-weight: bold;
  text-align: left;
  max-width: 60%;
  line-height: 1.5em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#tutorial {
  display: none;
  opacity: 1;
  text-align: center;
}

/* === Start Button === */
.start, #lore_container button {
  margin-top: 1.5em;
  padding: 0.75em;
  border: 2px solid var(--col2);
  border-radius: 12px;
  background-color: var(--col1-l);
  color: var(--col2);
  font-weight: bold;
}

.start:hover, #lore_container button:hover {
  background-color: var(--col2-l);
}


#fishAlert img, #fishInspect img {
height:32px; width: 32px; flex-shrink: 0; image-rendering: pixelated;
}