/* ============================================================================
   SORT IT — SPORTS EDITION | Main Stylesheet (Mobile-First Stadium Aesthetic)
   Designed for 375px Android viewports up to Desktop screens
   ============================================================================ */

:root {
  --bg-deep: #070d1f;
  --bg-stadium: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);

  --turf-green: #10b981;
  --turf-dark: #059669;
  --court-orange: #f97316;
  --gold-accent: #facc15;
  --sky-blue: #38bdf8;
  --danger-red: #ef4444;
  --purple-pro: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.45);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg-deep) 75%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

/* App Shell Container (Phone Frame on Desktop, Fullscreen on Mobile) */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(16, 185, 129, 0.14), transparent 60%),
    linear-gradient(180deg, #0b132b 0%, #090f24 100%);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* ==================== GLOBAL HEADER ==================== */
.global-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-light);
  z-index: 10;
  gap: 8px;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.profile-pill:hover, .profile-pill:active {
  transform: scale(0.98);
  border-color: var(--turf-green);
}

.avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--turf-green), var(--sky-blue));
  display: grid;
  place-items: center;
  font-size: 16px;
}

.profile-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.profile-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--turf-green);
  font-weight: 800;
}

.profile-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-light);
}

.stat-pill .stat-icon {
  font-size: 15px;
}

.stat-pill .stat-label {
  display: block;
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.stat-pill .stat-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-accent);
}

/* ==================== SCREENS ==================== */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px;
  position: relative;
}

.screen.active {
  display: flex;
}

/* ==================== MAIN MENU ==================== */
#screen-menu {
  justify-content: space-between;
  gap: 14px;
}

.hero-card {
  position: relative;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.22) 0%, rgba(15, 23, 42, 0.95) 65%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.edition-ribbon {
  display: inline-block;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: var(--gold-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  margin: 4px 0 8px;
}

.title-main {
  font-size: clamp(36px, 9vw, 48px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 20%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.title-sub {
  margin-top: 4px;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--court-orange);
}

.hero-tagline {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.hero-showcase {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.floating-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

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

/* ==================== BUTTONS ==================== */
.btn {
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  color: var(--text-main);
  padding: 12px 16px;
  font-size: 14px;
}

.btn:active {
  transform: translateY(2px) scale(0.985);
}

.btn-primary {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow: 0 5px 0 #065f46, 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 4px 0 #9a3412, 0 6px 16px rgba(249, 115, 22, 0.3);
}

.btn-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.btn-xl {
  flex-direction: column;
  padding: 14px 18px;
  gap: 2px;
}

.btn-main-text {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.btn-sub-text {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}

.btn-lg {
  padding: 13px 16px;
  font-size: 15px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.menu-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menu-grid-2 .btn {
  flex-direction: column;
  padding: 12px 10px;
  gap: 4px;
}

.btn-icon {
  font-size: 20px;
}

.badge-mini {
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--gold-accent);
}

.menu-bottom-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-top: 4px;
}

.btn-icon-round {
  width: 68px;
  height: 54px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 17px;
}

.btn-icon-round small {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
}

/* ==================== LEVEL SELECT & SUBSCREENS ==================== */
.screen-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  font-size: 12px;
}

.screen-title-group h2 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.screen-title-group p {
  font-size: 11px;
  color: var(--text-muted);
}

.star-counter-badge {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--gold-accent);
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}

.world-tabs-5 {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.world-tab-pill {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.world-tab-pill.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--world-color, var(--turf-green));
  color: var(--text-main);
}

.world-tab-pill .wt-icon {
  font-size: 14px;
}

.world-tab-pill .wt-name {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-main);
}

.world-tab-pill .wt-range {
  font-size: 9px;
  font-weight: 700;
  color: var(--world-color, var(--gold-accent));
}

.world-theme-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(15, 23, 42, 0.92));
  border: 1px solid var(--world-color, var(--turf-green));
  border-radius: var(--radius-md);
  padding: 9px 12px;
  margin-bottom: 10px;
}

.wtb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 3px;
}

.wtb-tag {
  font-size: 9px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: var(--gold-accent);
}

.wtb-focus {
  font-size: 10.5px;
  color: #cbd5e1;
  line-height: 1.3;
}

.meta-tag.meta-special {
  background: rgba(250, 204, 21, 0.16);
  color: var(--gold-accent);
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.level-teaser-line {
  margin-top: 4px;
  font-size: 10px;
  color: var(--sky-blue);
  font-weight: 700;
}

.hud-special-banner {
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.2;
}

.sport-item.golden-item {
  border-color: var(--gold-accent);
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.25) 0%, #0f172a 100%);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.38);
}

.sport-item.mystery-item {
  border-style: dashed;
  border-color: rgba(250, 204, 21, 0.65);
  background: linear-gradient(160deg, #1e1b4b 0%, #0f172a 100%);
}

.sport-item.vip-item {
  border-color: var(--sky-blue);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.item-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 5px;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.badge-golden {
  background: var(--gold-accent);
  color: #422006;
}

.badge-mystery {
  background: #a855f7;
  color: #fff;
}

.badge-vip {
  background: var(--sky-blue);
  color: #082f49;
}

.category-bin.bin-vault-locked {
  opacity: 0.65;
  border-style: dashed;
  filter: grayscale(0.4);
}

.victory-teaser-box {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 14px;
  text-align: left;
}

.teaser-badge {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 900;
  background: var(--sky-blue);
  color: #082f49;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
}

#victory-teaser-text {
  font-size: 11px;
  font-weight: 700;
  color: #e0f2fe;
  line-height: 1.25;
}

.levels-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.level-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 12px;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.level-card.unlocked {
  cursor: pointer;
}

.level-card.unlocked:hover {
  border-color: var(--turf-green);
}

.level-card.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.level-num-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--turf-green), #047857);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 17px;
  flex-shrink: 0;
}

.level-card.locked .level-num-badge {
  background: #334155;
}

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

.level-info h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

.level-info p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-meta-tags {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
}

.level-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.level-stars {
  font-size: 13px;
  letter-spacing: 1px;
}

.level-best {
  font-size: 10px;
  color: var(--gold-accent);
  font-weight: 700;
}

/* ==================== ACHIEVEMENTS ==================== */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}

.achievement-card.unlocked {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.12), var(--bg-card));
}

.ach-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.ach-info {
  flex: 1;
}

.ach-info h4 {
  font-size: 14px;
  font-weight: 800;
}

.ach-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.ach-status {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}

.ach-status.done {
  background: rgba(16, 185, 129, 0.2);
  color: var(--turf-green);
}

.ach-status.todo {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* ==================== CORE GAMEPLAY SCREEN ==================== */
#screen-game {
  padding: 8px 10px 10px;
  gap: 8px;
  overflow: hidden;
}

.game-hud {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.btn-hud-icon, .btn-hud-action {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 10px;
  height: 34px;
  padding: 0 10px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-hud-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hud-level-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.hud-level-num {
  font-size: 10px;
  font-weight: 900;
  color: var(--turf-green);
  letter-spacing: 0.1em;
}

.hud-level-name {
  font-size: 13px;
  font-weight: 800;
}

.hud-Action-group {
  display: flex;
  gap: 6px;
}

.hud-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.hud-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 6px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.metric-val {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
}

.hud-metric.warning .metric-val {
  color: var(--danger-red);
}

.hud-objective-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #e2e8f0;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 4px 8px;
  border-radius: 8px;
}

.objective-tag {
  background: var(--turf-green);
  color: #052e16;
  font-weight: 900;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

#hud-objective-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-pill {
  background: linear-gradient(90deg, #f97316, #facc15);
  color: #0f172a;
  font-weight: 900;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ==================== ARENA: TRAY & BINS ==================== */
.arena-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.coin-badge-icon, .inline-coin-svg {
  display: inline-flex;
  vertical-align: middle;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 2px;
}

.section-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.hint-text {
  font-size: 10px;
  color: var(--sky-blue);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.items-tray {
  flex: 1;
  background:
    radial-gradient(circle at center, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.92));
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(76px, 98px);
  gap: 8px;
  overflow-y: auto;
  align-content: center;
}

/* Sports Item Card */
.sport-item {
  position: relative;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.sport-item:hover {
  border-color: rgba(255, 255, 255, 0.38);
}

.sport-item.selected {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.35), 0 8px 16px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px) scale(1.03);
}

.sport-item.dragging-source {
  opacity: 0.3;
  transform: scale(0.92);
}

.item-svg-wrap {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.item-svg-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.item-label {
  font-size: 10px;
  font-weight: 800;
  color: #f1f5f9;
  text-align: center;
  line-height: 1.05;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Sorting Bins */
.bins-section {
  flex-shrink: 0;
}

.bins-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.bins-container.bins-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.bins-container.bins-4 {
  grid-template-columns: repeat(2, 1fr);
}

.category-bin {
  position: relative;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid var(--bin-color, var(--turf-green));
  border-radius: var(--radius-md);
  padding: 8px 8px 6px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.bins-container.bins-3 .category-bin {
  padding: 6px 6px 5px;
}

.bins-container.bins-3 .bin-header {
  flex-wrap: wrap;
  gap: 2px;
}

.bins-container.bins-3 .bin-icon {
  font-size: 13px;
}

.bins-container.bins-3 .bin-title {
  font-size: 10px;
  line-height: 1.05;
}

.bins-container.bins-3 .bin-count {
  font-size: 9px;
  padding: 1px 5px;
}

.bins-container.bins-3 .bin-sub {
  font-size: 8.5px;
  line-height: 1.15;
}

.category-bin.bin-highlight {
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.45), 0 8px 20px rgba(0, 0, 0, 0.5);
  background: rgba(30, 58, 138, 0.45);
}

.bin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.bin-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.bin-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.bin-title {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.bin-count {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-accent);
  flex-shrink: 0;
}

.bin-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

.bin-collected-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  margin-top: 4px;
  padding: 2px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  overflow-x: auto;
}

.bin-mini-item {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bin-mini-item svg {
  width: 100%;
  height: 100%;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 13, 31, 0.82);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: var(--sky-blue);
  margin-bottom: 6px;
}

.badge-gold {
  background: rgba(250, 204, 21, 0.2);
  color: var(--gold-accent);
}

.badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.modal-card h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.victory-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 34px;
  margin: 10px 0 14px;
}

.star-slot.earned {
  filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.8));
}

.star-slot.empty {
  opacity: 0.22;
  filter: grayscale(1);
}

.victory-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.v-stat {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v-stat span {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
}

.v-stat strong {
  font-size: 15px;
  font-weight: 900;
}

.v-stat.reward-highlight strong {
  color: var(--gold-accent);
}

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

.modal-grid-2, .settings-row-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* Settings Form */
.form-group {
  text-align: left;
  margin: 12px 0;
}

.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.06em;
}

.input-row {
  display: flex;
  gap: 6px;
}

.input-row input {
  flex: 1;
  background: #090f24;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.avatar-opt {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  font-size: 20px;
  cursor: pointer;
}

.avatar-opt.selected {
  border-color: var(--turf-green);
  background: rgba(16, 185, 129, 0.25);
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.toggle-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.btn-toggle {
  min-width: 60px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  font-weight: 900;
  font-size: 11px;
  cursor: pointer;
}

.btn-toggle.on {
  background: var(--turf-green);
  color: #052e16;
}

.btn-toggle.off {
  background: #334155;
  color: #cbd5e1;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 14px 0;
}

.hidden {
  display: none !important;
}

/* ==================== DRAG GHOST & TOAST ==================== */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 72px;
  height: 72px;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(30, 41, 59, 0.95);
  border: 2px solid var(--gold-accent);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}

.toast-container {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: 90%;
  max-width: 340px;
}

.toast {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--turf-green);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* Small 375px height/width adjustments */
@media (max-width: 390px) {
  .items-tray {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px;
  }
  .item-svg-wrap {
    width: 38px;
    height: 38px;
  }
  .item-label {
    font-size: 9.5px;
  }
  .category-bin {
    min-height: 74px;
    padding: 6px;
  }
}
