/* Animal Relic Hunters - CSS Stylesheet */
:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-dark: #0a0e17;
  --bg-panel: rgba(18, 25, 41, 0.85);
  --border-gold: rgba(212, 175, 55, 0.45);
  --text-gold: #d4af37;
  --color-weapon: #f97316;
  --color-armor: #06b6d4;
  --color-boots: #10b981;
}

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

body {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: var(--font-family);
  overflow-x: hidden;
}

.relic-app {
  min-height: calc(100vh - 60px);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: radial-gradient(circle at center, #101c2c 0%, #05080c 100%);
}

.panel {
  width: 100%;
  max-width: 1100px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  padding: 24px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   START MENU PANEL
   ========================================================================== */
.menu-layout {
  display: flex;
  gap: 30px;
}

.menu-main {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.menu-cover-box {
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 20px rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  margin-bottom: 20px;
}

.menu-cover-box .cover {
  width: 100%;
  height: auto;
  display: block;
}

.menu-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.menu-hint {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
  max-width: 600px;
}

.goals-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  margin-bottom: 24px;
}

.goals-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-gold);
  margin-bottom: 6px;
}

.goals-card p {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.primary-btn {
  background: linear-gradient(135deg, #d4af37 0%, #aa841c 100%);
  color: #0c0e17;
  border: none;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 40px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.primary-btn:active {
  transform: translateY(0);
}

/* Shop Menu */
.menu-shop {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.menu-shop h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
}

.shop-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-badge span {
  font-size: 1.3rem;
}

.shop-badge strong {
  font-size: 1.4rem;
  color: #38bdf8;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.shop-item-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s;
  width: 100%;
}

.shop-item-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}

.shop-item-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 180px;
}

.shop-item-meta strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-gold);
}

.shop-item-meta small {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.3;
}

.shop-cost-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.12);
  padding: 6px 10px;
  border-radius: 6px;
  color: #38bdf8;
}

.shop-status-text {
  font-size: 0.75rem;
  color: #10b981;
  text-align: center;
  margin-top: 8px;
}

/* ==========================================================================
   GAMEPLAY SCREEN / CANVAS VIEWPORT
   ========================================================================== */
.game-layout {
  display: flex;
  gap: 20px;
  width: 100%;
}

.arena-viewport {
  flex: 3;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
}

.arena-hud {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-meta, .exp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #94a3b8;
}

.health-meta strong {
  color: #ef4444;
}

.exp-meta strong {
  color: #10b981;
}

.bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.2s ease;
}

.bar-fill.health {
  background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
}

.bar-fill.exp {
  background: linear-gradient(90deg, #10b981 0%, #047857 100%);
}

.hud-meta-row {
  display: flex;
  gap: 15px;
}

.meta-badge {
  font-size: 0.85rem;
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ui-icon {
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.ui-icon--small {
  width: 22px;
  height: 22px;
}

.ui-icon--tiny {
  width: 18px;
  height: 18px;
}

.canvas-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
  aspect-ratio: 8/5;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Virtual Joystick */
.joystick-container {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  touch-action: none;
  z-index: 10;
}

.joystick-knob {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Inventory Sidebar Slots */
.inventory-sidebar {
  flex: 1.1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.inventory-sidebar h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px;
}

.gear-slots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gear-slot-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gear-slot-card[data-slot="weapon"]:hover {
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
  border-color: rgba(249, 115, 22, 0.4);
}

.gear-slot-card[data-slot="armor"]:hover {
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  border-color: rgba(6, 182, 212, 0.4);
}

.gear-slot-card[data-slot="boots"]:hover {
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.4);
}

.slot-header {
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.slot-body {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.slot-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.16);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.slot-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  flex-grow: 1;
}

.item-effect {
  font-size: 0.75rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
}

.stats-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-list h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-gold);
  margin-bottom: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row span {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-row strong {
  color: #fff;
}

.backpack-panel {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
}

.backpack-panel h3 {
  color: var(--text-gold);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.backpack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.backpack-empty {
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.35;
}

.backpack-item {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.backpack-item:hover,
.backpack-item.is-equipped {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
}

.backpack-item img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.24);
}

.backpack-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.backpack-copy strong,
.backpack-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backpack-copy strong {
  color: #fff;
  font-size: 0.82rem;
}

.backpack-copy small {
  color: #9ee7c4;
  font-size: 0.72rem;
}

.backpack-item b {
  color: #fde68a;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ==========================================================================
   RELIC DRAFT OVERLAY (LEVEL UP SCREEN)
   ========================================================================== */
.draft-overlay, .loot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 12, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.draft-card-box {
  width: 100%;
  max-width: 680px;
  text-align: center;
  padding: 20px;
}

.draft-card-box h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.draft-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 24px;
}

.draft-cards-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.draft-item-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 180px;
  padding: 20px 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.draft-item-btn:hover {
  transform: translateY(-5px);
  border-color: var(--border-gold);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
  background: rgba(255,255,255,0.06);
}

.draft-item-icon {
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: inset 0 0 12px rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.32);
}

.draft-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.draft-item-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.draft-item-desc {
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.3;
}

.draft-reroll-btn {
  margin-top: 18px;
  min-height: 42px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.08);
  color: #fef3c7;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  cursor: pointer;
}

.draft-reroll-btn:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.6);
}

.draft-reroll-btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.draft-reroll-btn b {
  color: #38bdf8;
  font-size: 0.95rem;
}

.draft-reroll-status {
  min-height: 18px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 0.78rem;
}

/* ==========================================================================
   LOOT OVERLAY
   ========================================================================== */
.loot-box {
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 30px rgba(212, 175, 55, 0.2);
}

.loot-box h2 {
  font-size: 1.3rem;
  color: var(--text-gold);
  margin-bottom: 16px;
}

.loot-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.loot-card-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.32);
  box-shadow: inset 0 0 16px rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.35);
}

.loot-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loot-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.loot-card p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.loot-card strong {
  font-size: 0.85rem;
  color: #10b981;
}

/* ==========================================================================
   RESULT PANEL / SCREEN
   ========================================================================== */
.result-panel {
  display: flex;
  justify-content: center;
}

.result-card {
  width: 100%;
  max-width: 500px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#resultTitle {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-gold);
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.result-score-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.result-score-box span {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.result-score-box strong {
  font-size: 3rem;
  color: #fff;
}

.result-flavor {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 14px;
  line-height: 1.4;
}

.result-summary {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.result-summary-row {
  display: grid;
  grid-template-columns: minmax(95px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.result-summary-row span {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-summary-row strong {
  color: #f8fafc;
  font-size: 0.9rem;
  line-height: 1.25;
}

.skills-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.skills-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.skill-meter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.skill-meter span {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.skill-meter .stars {
  font-size: 1rem;
}

.skills-report-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 10px;
  line-height: 1.4;
  border-top: 1px dashed rgba(255,255,255,0.06);
  padding-top: 8px;
}

.result-btn-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 30px;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.disclaimer {
  font-size: 0.75rem;
  color: #64748b;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 900px) {
  .menu-layout {
    flex-direction: column;
  }
  
  .game-layout {
    flex-direction: column;
  }

  .canvas-container {
    aspect-ratio: auto;
    height: 380px;
  }

  .joystick-container {
    display: block; /* show joystick on smaller viewports */
  }
}
