:root {
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.4);
  --panel-border: rgba(148, 163, 184, 0.08);
  --text: #e2e8f0;
  --muted: rgba(226, 232, 240, 0.55);
  --accent: #0ea5e9;
  --danger: #f97316;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #111827 0%, #020617 70%);
  color: var(--text);
  min-height: 100vh;
}

/* container */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 2.3rem;
}

/* top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: flex;
  gap: .8rem;
  align-items: center;
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(circle at 10px 10px, #38bdf8, #1d4ed8);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}
.brand-text h1 {
  margin: 0;
  font-size: 1.05rem;
}
.brand-text p {
  margin: .1rem 0 0;
  font-size: .68rem;
  color: var(--muted);
}

.user-meta {
  display: flex;
  gap: .35rem;
  align-items: center;
  font-size: .68rem;
}
.id-label {
  color: var(--muted);
}
.id-value {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: .2rem .5rem;
  border-radius: 6px;
}

.lang-btn {
  background: rgba(14,165,233,0.15);
  border: 1px solid rgba(14,165,233,0.3);
  color: #e2e8f0;
  font-size: .65rem;
  border-radius: 6px;
  padding: .3rem .5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn:hover {
  background: rgba(14,165,233,0.25);
}

/* layout */
.main-grid {
  display: grid;
  grid-template-columns: 0.55fr 0.45fr;
  gap: 1.1rem;
  margin-top: 1.1rem;
}
@media (max-width: 950px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 30px rgba(0,0,0,0.25);
}

.panel-left {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* blocks */
.block {
  background: rgba(2,6,23,0.06);
  border: 1px solid rgba(15,23,42,0);
  border-radius: 10px;
  padding: .6rem .6rem .65rem;
}
.block-title {
  font-size: .78rem;
  margin: 0 0 .35rem;
}
.text-muted {
  font-size: .65rem;
  color: var(--muted);
  margin-bottom: .5rem;
}
.note {
  font-size: .6rem;
  color: var(--muted);
  margin-top: .5rem;
}
.danger {
  background: rgba(249, 115, 22, 0.03);
  border: 1px solid rgba(249, 115, 22, 0.12);
}

/* stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .35rem;
}
.stat-label {
  font-size: .63rem;
  color: var(--muted);
}
.stat-value {
  font-size: .78rem;
  font-weight: 600;
}

.energy-track {
  height: 10px;
  background: rgba(148, 163, 184, 0.10);
  border-radius: 999px;
  overflow: hidden;
  margin-top: .25rem;
}
#energy-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width .2s ease;
}

/* buttons */
.btn {
  border: none;
  border-radius: 7px;
  padding: .45rem .65rem;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  color: #020617;
}
.btn-secondary {
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}
.btn-light {
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid rgba(148, 163, 184, 0.05);
  color: #e2e8f0;
}
.btn-danger {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #020617;
}
.btn:active {
  transform: translateY(1px);
}

/* 🎣 big fishing button + motion */
#btn-fish {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  color: #0f172a;
  border: none;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 1.1rem 0;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px rgba(14,165,233,0.3);
  transition: all 0.15s ease;
  margin-bottom: .35rem;
}

#btn-fish:hover {
  box-shadow: 0 10px 25px rgba(14,165,233,0.45);
  transform: translateY(-2px);
}

#btn-fish:active {
  transform: scale(0.97);
}

/* motion class (JS ใส่ให้) */
#btn-fish.fish-hit {
  animation: fish-bump 220ms ease-out;
}

@keyframes fish-bump {
  0%   { transform: scale(1) translateY(0); }
  30%  { transform: scale(0.96) translateY(1px); }
  60%  { transform: scale(1.06) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}

/* inventory */
.inv-row {
  font-size: .65rem;
  margin-bottom: .15rem;
}

.feedback {
  font-size: .6rem;
  color: var(--muted);
  margin-top: .4rem;
  word-break: break-word;
}

/* right panel store */
.panel-right h2 {
  margin-top: 0;
  font-size: .78rem;
}
.store-grid {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-top: .6rem;
}
.store-item {
  background: rgba(2, 6, 23, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: 10px;
  padding: .6rem .6rem;
  display: flex;
  justify-content: space-between;
  gap: .8rem;
}
.store-item-left strong {
  font-size: .7rem;
}
.store-item-left small {
  display: block;
  font-size: .6rem;
  color: var(--muted);
}
.store-item button {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 7px;
  color: #e2e8f0;
  font-size: .62rem;
  padding: .35rem .6rem;
  cursor: pointer;
  height: fit-content;
}
.store-item button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* responsive tweaks */
@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  #btn-fish {
    font-size: 1rem;
  }
}
