/* ==========================================================================
   SIAM ARC - MODERN GLASSMORPHIC MOBILE STYLESHEET
   Clean high-contrast theme, responsive layout & sharp typography
   ========================================================================== */

:root {
  --primary-emerald: #00e676;
  --primary-cyan: #00e5ff;
  --accent-magenta: #e040fb;
  --accent-purple: #7c4dff;
  --gold-highlight: #ffd700;
  
  --bg-dark: #080c16;
  --panel-bg: rgba(14, 22, 42, 0.92);
  --panel-border: rgba(0, 230, 118, 0.35);
  
  --text-main: #ffffff;
  --text-muted: #b0cbe8;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
}

body {
  background: url('bg.jpg') center/cover no-repeat fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: center;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(8, 12, 22, 0.4) 0%, rgba(4, 6, 12, 0.82) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Main Viewport Container */
#app-viewport {
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 880px;
  background: rgba(10, 16, 32, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* ==========================================================================
   GLASSMORPHIC REUSABLE COMPONENTS
   ========================================================================== */

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.glass-card {
  background: rgba(16, 25, 48, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 230, 118, 0.35);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Header Bar */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  min-height: 56px;
  background: rgba(12, 20, 38, 0.96);
  border-bottom: 1px solid rgba(0, 230, 118, 0.25);
  z-index: 20;
}

.user-stats-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.18);
  border: 1px solid rgba(0, 230, 118, 0.5);
  padding: 5px 12px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.92rem;
  color: #00e676;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 2.5px;
  color: #ffffff;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.8), 0 2px 4px rgba(0,0,0,0.8);
}

.icon-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
}

.icon-action-btn:active {
  transform: scale(0.92);
  background: rgba(0, 230, 118, 0.3);
}

/* ==========================================================================
   SCREENS BASE
   ========================================================================== */

#screens-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: calc(100% - 56px);
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  opacity: 0;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* ==========================================================================
   1. WELCOME SCREEN
   ========================================================================== */

#screen-welcome {
  justify-content: center;
  align-items: center;
}

.welcome-card {
  width: 100%;
  padding: 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-wrapper {
  width: 96px;
  height: 96px;
  margin-bottom: 12px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-emerald), var(--accent-magenta));
}

.welcome-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(0, 230, 118, 0.8);
  margin-bottom: 4px;
}

.hero-subtitle {
  color: #c0daf8;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.welcome-guide {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
  text-align: left;
}

.guide-emoji {
  font-size: 1.3rem;
}

.guide-item p {
  font-size: 0.85rem;
  color: #e6f1ff;
  font-weight: 600;
}

/* ==========================================================================
   2. HOME SCREEN
   ========================================================================== */

#screen-home {
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 16px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.logo-badge-container {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-emerald), var(--primary-cyan), var(--accent-magenta));
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
  margin-bottom: 8px;
}

.home-orb-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.home-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 0 14px rgba(0, 230, 118, 0.8);
}

.stats-overview-card {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(16, 25, 48, 0.95);
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.8px;
  color: #9ab4d0;
  font-weight: 800;
}

.stat-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.15rem;
  color: #00e676;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
}

.menu-button-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ==========================================================================
   BUTTONS STYLES
   ========================================================================== */

.btn-primary {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #050b14;
  border: none;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-tag {
  position: absolute;
  right: 14px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 13px 16px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: rgba(0, 230, 118, 0.2);
  border-color: var(--primary-emerald);
}

/* ==========================================================================
   3. GAME SCREEN & CANVAS
   ========================================================================== */

#screen-game {
  padding: 8px 10px 12px 10px;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  height: 48px;
  background: rgba(16, 25, 48, 0.95);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #9ab4d0;
  letter-spacing: 1px;
}

.hud-val {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  color: var(--primary-cyan);
}

#canvas-container {
  flex: 1;
  position: relative;
  background: rgba(4, 7, 14, 0.92);
  border-radius: 14px;
  border: 1px solid rgba(0, 230, 118, 0.35);
  overflow: hidden;
}

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

.aim-hint-text {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary-emerald);
  pointer-events: none;
  border: 1px solid rgba(0, 230, 118, 0.4);
}

/* Modals */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  padding: 22px 18px;
  text-align: center;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 14px;
  letter-spacing: 1.5px;
}

.result-win {
  color: var(--primary-emerald);
  text-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
}

.result-lose {
  color: #ff5252;
  text-shadow: 0 0 15px rgba(255, 82, 82, 0.5);
}

.stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.result-details {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.88rem;
  color: #b0cbe8;
}

.result-row strong {
  color: #ffffff;
  font-family: var(--font-heading);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   4. LEVELS SCREEN
   ========================================================================== */

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: rgba(16, 25, 48, 0.95);
}

.header-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.header-spacer {
  width: 36px;
}

.levels-scrollable-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.level-card {
  background: rgba(20, 30, 56, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.level-card.unlocked {
  border-color: rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.12);
}

.level-card.current {
  border: 2px solid var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.level-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.2rem;
  color: #ffffff;
}

.level-stars-mini {
  font-size: 0.65rem;
  letter-spacing: -2px;
  margin-top: 2px;
}

/* ==========================================================================
   5. ACHIEVEMENTS SCREEN
   ========================================================================== */

.achievements-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(16, 25, 48, 0.95);
}

.achievement-icon {
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.08);
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-info {
  flex: 1;
  min-width: 0;
}

.achievement-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
}

.achievement-desc {
  font-size: 0.75rem;
  color: #9ab4d0;
  margin-top: 2px;
}

.achievement-reward {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--primary-emerald);
}

/* ==========================================================================
   6. SKINS SHOP SCREEN
   ========================================================================== */

.shop-currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.2);
  border: 1px solid rgba(0, 230, 118, 0.5);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--primary-emerald);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(16, 25, 48, 0.95);
  text-align: center;
  gap: 6px;
}

.skin-preview-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.skin-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}

.skin-price {
  font-size: 0.75rem;
  color: #9ab4d0;
  font-weight: 700;
}

.btn-shop-action {
  width: 100%;
  padding: 7px 0;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.78rem;
  border: none;
  cursor: pointer;
}

.btn-shop-action.equipped {
  background: rgba(0, 230, 118, 0.2);
  color: var(--primary-emerald);
  border: 1px solid var(--primary-emerald);
}

.btn-shop-action.equip {
  background: var(--primary-cyan);
  color: #060b13;
}

.btn-shop-action.buy {
  background: linear-gradient(135deg, var(--primary-emerald), var(--primary-cyan));
  color: #060b13;
}
