@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #0a3d62 0%, #031926 100%);
  font-family: 'Fredoka', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Container */
#gameApp {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  max-height: 800px;
  aspect-ratio: 480 / 800;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  background: #001220;
  border-radius: 12px;
  overflow: hidden;
}

/* Canvas Viewport */
#canvasContainer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  touch-action: none;
  cursor: pointer;
}

/* Floating Utility Buttons */
.floating-controls {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.icon-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid #f1c40f;
  color: #ffffff;
  font-size: 17px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
  background: rgba(44, 62, 80, 0.95);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* Modal Overlay */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 14, 28, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 12px;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

/* Scoreboard Wooden Frame */
.scoreboard-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.banner-wrapper {
  position: relative;
  z-index: 10;
  margin-bottom: -32px;
}

.title-banner-img {
  width: 250px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

.scoreboard-board {
  position: relative;
  width: 100%;
  background: url('../public/img/scoreboard.png') no-repeat center center;
  background-size: 100% 100%;
  padding: 44px 28px 36px 28px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.7));
}

.scoreboard-inner-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #3e2723; /* Dark brown ink */
}

/* Summary Header */
.summary-header {
  display: flex;
  justify-content: space-between;
  background: rgba(245, 235, 215, 0.65);
  border: 1px solid #c7a775;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 15px;
  margin-bottom: 12px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.badge-label {
  font-size: 11px;
  font-weight: 700;
  color: #5d4037;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-value {
  font-size: 16px;
  font-weight: 800;
  color: #2e1d11;
}

.badge-value.highlight {
  color: #d84315;
}

.badge-value.coins-val {
  color: #b26a00;
}

/* Caught Fish Section */
.caught-section {
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #4e342e;
  text-align: center;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed #bcaaa4;
  padding-bottom: 4px;
}

.caught-fish-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 115px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 6px;
}

.fish-item-card {
  background: rgba(255, 253, 240, 0.85);
  border: 1px solid #d7ccc8;
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fish-thumb-container {
  width: 52px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fish-crop-canvas {
  max-width: 100%;
  max-height: 100%;
}

.fish-info {
  text-align: center;
  width: 100%;
}

.fish-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #3e2723;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fish-pts {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #e65100;
}

.no-catch-msg {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255, 243, 224, 0.7);
  border-radius: 6px;
  font-size: 14px;
  color: #d84315;
  font-weight: 700;
}

.no-catch-msg small {
  display: block;
  font-size: 12px;
  color: #5d4037;
  font-weight: 500;
  margin-top: 4px;
}

/* Upgrades Section */
.upgrades-section {
  margin-bottom: 12px;
}

.upgrade-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upgrade-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #d7ccc8;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.upgrade-icon {
  font-size: 24px;
  margin-right: 8px;
}

.upgrade-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.upgrade-title {
  font-size: 13px;
  font-weight: 700;
  color: #2e1d11;
}

.upgrade-desc {
  font-size: 11px;
  color: #5d4037;
}

.upgrade-action-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
  line-height: 1.2;
}

.upgrade-action-btn.affordable {
  background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
  color: #ffffff;
  border: 1px solid #1b5e20;
  box-shadow: 0 2px 4px rgba(46, 125, 50, 0.4);
}

.upgrade-action-btn.affordable:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.upgrade-action-btn.locked {
  background: #bdbdbd;
  color: #616161;
  border: 1px solid #9e9e9e;
  cursor: not-allowed;
  opacity: 0.75;
}

/* Play Again Button */
.start-btn-container {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 4px;
}

.play-again-btn {
  width: 170px;
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.15s ease;
}

.play-again-btn:hover {
  transform: scale(1.08);
}

.play-again-btn:active {
  transform: scale(0.95);
}

/* Help Modal Styling */
.help-card {
  background: rgba(15, 32, 67, 0.96);
  border: 3px solid #ffca28;
  border-radius: 14px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  animation: popIn 0.3s ease;
}

.help-title {
  color: #ffd54f;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.help-body {
  font-size: 13px;
  line-height: 1.6;
  color: #e0f2fe;
}

.help-step {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
}

.help-step strong {
  color: #ffeb3b;
  display: block;
  margin-bottom: 2px;
}

.close-help-btn {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(180deg, #ffb300 0%, #f57f17 100%);
  border: 2px solid #ff6f00;
  color: #212121;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}


