/* ==============================================================================
   FLORR.YUYI - PURE STANDALONE IMMERSIVE STYLES (ZERO-ECOSYSTEM BLOAT)
   ============================================================================== */

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #1e3a1e;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #18181b;
}

#game-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
}

/* ================= TOP RIGHT ACCOUNT STATUS ================= */
.account-bar {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-pill {
  background: rgba(255, 255, 255, 0.95);
  border: 2.5px solid #18181b;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 2px 2px 0px #18181b;
  color: #18181b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.account-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #18181b;
}

/* ================= START MENU OVERLAY ================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: opacity 0.25s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-card {
  width: 90%;
  max-width: 440px;
  background: #ffffff;
  border: 3.5px solid #18181b;
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 8px 8px 0px #18181b;
  text-align: center;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-icon {
  font-size: 38px;
  animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #18181b;
}

.logo-tag {
  display: inline-block;
  background: #fef08a;
  border: 2px solid #18181b;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 20px;
  box-shadow: 1.5px 1.5px 0px #18181b;
}

.input-group {
  margin-bottom: 16px;
  text-align: left;
}

.input-label {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 6px;
  display: block;
}

.nickname-input {
  width: 100%;
  padding: 12px 16px;
  border: 2.5px solid #18181b;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  background: #f8fafc;
  outline: none;
  box-shadow: 2px 2px 0px #18181b;
  transition: all 0.15s;
}

.nickname-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 3px 3px 0px #3b82f6;
}

.start-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.logged-user-banner {
  background: #fefce8;
  border: 2.5px solid #ca8a04;
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: left;
}

.logged-user-badge {
  display: inline-block;
  background: #eab308;
  color: #18181b;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.logged-user-name {
  font-size: 16px;
  font-weight: 900;
  color: #854d0e;
}

.logged-user-desc {
  font-size: 11px;
  font-weight: 700;
  color: #a16207;
}

.btn-passport {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  border: 3px solid #18181b;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  color: #18181b;
  box-shadow: 4px 4px 0px #18181b;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-passport:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #18181b;
}

.btn-passport:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #18181b;
}

.btn-play-guest {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border: 3px solid #18181b;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 4px 4px 0px #18181b;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-play-guest:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #18181b;
}

.btn-play-guest:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #18181b;
}

.controls-hint {
  margin-top: 20px;
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  line-height: 1.6;
}

/* ================= IN-GAME HUD ================= */
.hud-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

/* Top-Left: Player Vitals */
.vitals-box {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid #18181b;
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 3px 3px 0px #18181b;
  min-width: 210px;
}

.player-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-name-display {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.player-level-badge {
  background: #dbeafe;
  border: 1.5px solid #1e3a8a;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 900;
  border-radius: 6px;
  padding: 1px 6px;
}

.bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}

.progress-track {
  height: 9px;
  background: #e2e8f0;
  border: 1.5px solid #18181b;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.15s ease-out;
}

.fill-hp { background: #ef4444; }
.fill-nectar { background: #f59e0b; }
.fill-xp { background: #38bdf8; }

/* Bottom-Center: Petal Loadout */
.petals-dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #18181b;
  border-radius: 22px;
  padding: 10px 14px;
  box-shadow: 4px 4px 0px #18181b;
}

.petal-slot {
  width: 54px;
  height: 54px;
  background: #f8fafc;
  border: 2.5px solid #18181b;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.15);
}

.petal-slot-icon {
  font-size: 24px;
}

.petal-slot-num {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
}

.petal-cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  transition: height 0.1s linear;
}

/* Top-Right: Leaderboard & Minimap */
.side-hud {
  position: absolute;
  top: 60px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.leaderboard-box {
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid #18181b;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 3px 3px 0px #18181b;
  width: 175px;
}

.lb-title {
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  color: #18181b;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 4px;
}

.lb-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 3px;
}

.lb-row.self {
  color: #2563eb;
  font-weight: 900;
}

.minimap-radar {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid #18181b;
  border-radius: 18px;
  box-shadow: 3px 3px 0px #18181b;
  position: relative;
  overflow: hidden;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Announcement Top Banner */
.announcement-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #18181b;
  color: #ffffff;
  border: 2px solid #facc15;
  border-radius: 9999px;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.announcement-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}

/* Zone Indicator Alert */
.zone-pill {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 9999px;
  border: 2px solid #18181b;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 2px 2px 0px #18181b;
  background: #dcfce7;
  color: #166534;
}

.zone-pill.yellow {
  background: #fef08a;
  color: #854d0e;
}

.zone-pill.red {
  background: #fee2e2;
  color: #991b1b;
  border-color: #dc2626;
  animation: pulseRed 1.2s infinite;
}

@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
