:root {
  --bg-dark: #0f172a;
  --card-bg: rgba(15, 23, 42, 0.94);
  --card-border: #38bdf8;
  --primary: #4f46e5;
  --primary-hover: #6366f1;
  --accent-gold: #facc15;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --text-light: #f8fafc;
  --text-muted: #cbd5e1;
}

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

body, html {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #1e1b4b, #090d16);
  color: var(--text-light);
  font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
  overflow: hidden;
}

#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  max-width: 1280px;
  max-height: 720px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  background: #38bdf8;
  display: block;
}

.hidden {
  display: none !important;
}

/* ==================== HUD LYGIO METU ==================== */
#game-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(96vw, 1240px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 15;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-hero-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #facc15;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.mini-photo-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.mini-photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-center {
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.98rem;
}

.hud-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.coin-pill { border-color: #facc15; color: #fde047; }
.crystal-pill { border-color: #38bdf8; color: #7dd3fc; }
.set-pill {
  background: linear-gradient(135deg, #f97316, #eab308);
  border-color: #fef08a;
  color: #0f172a;
}
.inv-hud-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: #a5b4fc;
}
.combo-pill {
  background: linear-gradient(135deg, #ea580c, #dc2626);
  border-color: #fde047;
  color: #fff;
  animation: pulseScale 0.8s infinite alternate;
}

@keyframes pulseScale {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

.hud-btn, .icon-btn {
  background: #334155;
  color: #fff;
  border: 2px solid #64748b;
  padding: 7px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* ==================== TOUCH CONTROLS ==================== */
#touch-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 1200px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 16;
}

.touch-dpad, .touch-actions {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.touch-btn {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

.crouch-btn {
  width: 82px;
  background: rgba(59, 130, 246, 0.78);
  font-size: 1.25rem;
}

.shoot-btn {
  width: 112px;
  height: 68px;
  border-radius: 999px;
  font-size: 1.1rem;
  background: rgba(245, 158, 11, 0.88);
  border-color: #fef08a;
  color: #0f172a;
}

.jump-btn {
  width: 140px;
  font-size: 1.15rem;
  background: rgba(34, 197, 94, 0.82);
}

/* ==================== EKRANAI IR LINO / LUKO KORTELĖS ==================== */
.overlay-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 25;
  background: radial-gradient(circle at center, rgba(30, 27, 75, 0.84), rgba(9, 13, 22, 0.94));
  backdrop-filter: blur(6px);
}

.modal-backdrop {
  z-index: 35;
  background: rgba(9, 13, 22, 0.85);
}

.panel-card {
  background: var(--card-bg);
  border: 3px solid var(--card-border);
  border-radius: 24px;
  padding: 22px 26px;
  width: min(95vw, 680px);
  max-height: 93vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

.wide-card { width: min(96vw, 960px); }
.map-card { width: min(96vw, 1120px); }

.brand-header {
  text-align: center;
  margin-bottom: 16px;
}

.crown-badge {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 4px;
}

h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(90deg, #fde047, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-top: 4px;
}

.named-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin: 18px 0;
}

.hero-profile-card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 3px solid #38bdf8;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s, border-color 0.18s;
}

.hero-profile-card:hover {
  transform: translateY(-4px);
  border-color: #fde047;
}

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-hero-canvas, .mini-hero-canvas {
  background: #0f172a;
  border: 3px solid #fde047;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.hero-card-info h2 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fde047;
  letter-spacing: 0.5px;
}

.fixed-grade-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 2px solid #22c55e;
  color: #86efac;
  font-weight: 900;
  font-size: 0.9rem;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: #3b82f6;
  border: 3px solid #fde047;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls-hint {
  font-size: 0.82rem;
  color: #93c5fd;
  margin-top: 3px;
}

.badge-pill {
  display: inline-block;
  background: #4f46e5;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-left: 6px;
}

.slot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.slot-actions {
  display: flex;
  gap: 10px;
}

/* ==================== BUTTONS ==================== */
.primary-btn, .secondary-btn, .danger-btn {
  padding: 10px 16px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  border: none;
  transition: transform 0.14s, filter 0.14s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}

.glow-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.secondary-btn {
  background: #334155;
  color: #f8fafc;
  border: 2px solid #64748b;
}

.danger-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 2px solid #ef4444;
  padding: 10px 12px;
}

.primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled), .danger-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.primary-btn:disabled, .secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.save-tools-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#transfer-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #475569;
  background: #0f172a;
  color: #fff;
  font-family: inherit;
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

/* ==================== ŽEMĖLAPIS ==================== */
.top-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-bar {
  display: flex;
  gap: 10px;
}

.currency-chip {
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.08rem;
  background: #1e293b;
  border: 2px solid #475569;
}

.coin-chip { border-color: #facc15; color: #fde047; }
.crystal-chip { border-color: #38bdf8; color: #7dd3fc; }

.daily-banner {
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.35), rgba(234, 88, 12, 0.35));
  border: 2px solid #818cf8;
  border-radius: 14px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.small-claim-btn {
  background: #facc15;
  color: #0f172a;
  font-weight: 900;
  border: none;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.small-claim-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.world-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
}

.world-tab-btn {
  flex: 1;
  min-width: 150px;
  background: #1e293b;
  border: 2px solid #475569;
  color: #e2e8f0;
  padding: 9px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.world-tab-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  color: #fff;
}

.world-showcase {
  background: rgba(30, 41, 59, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
}

.world-header {
  text-align: center;
  margin-bottom: 12px;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.level-node {
  background: #1e293b;
  border: 3px solid #38bdf8;
  border-radius: 16px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
}

.level-node.boss-node {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.18);
}

.level-node.locked {
  opacity: 0.45;
  border-color: #475569;
  cursor: not-allowed;
}

.level-num {
  font-size: 1.15rem;
  font-weight: 900;
  display: block;
}

/* ==================== INVENTORIUS (DRAG & DROP), POPIERINĖ LĖLĖ IR KUPRINĖ ==================== */
.shop-wide-card {
  width: min(97vw, 1180px);
  padding: 16px 20px;
}

.inventory-dashboard {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 14px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid #6366f1;
  border-radius: 18px;
  padding: 12px 14px;
}

.hero-paperdoll-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(30, 41, 59, 0.78);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 10px 12px;
}

.paperdoll-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.hero-live-stats {
  background: #0f172a;
  border: 1.5px solid #fde047;
  color: #fde047;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.85rem;
}

.paperdoll-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.equip-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equip-slot {
  width: 78px;
  height: 56px;
  background: #0f172a;
  border: 2px dashed #64748b;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  padding: 3px;
  text-align: center;
}

.equip-slot.filled {
  border-style: solid;
  border-color: #38bdf8;
  background: rgba(30, 58, 138, 0.35);
}

.equip-slot.set-piece {
  border-color: #f97316;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.35);
}

.equip-slot:hover, .equip-slot.drag-over, .backpack-slot.drag-over {
  border-color: #fde047;
  background: rgba(250, 204, 21, 0.22);
  transform: scale(1.05);
}

.equip-slot .slot-icon {
  font-size: 1.35rem;
  line-height: 1.1;
}

.equip-slot .slot-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #cbd5e1;
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at center, #1e293b, #0f172a);
  border: 2.5px solid #38bdf8;
  border-radius: 18px;
  padding: 4px 8px;
}

.set-bonus-banner {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid #475569;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #cbd5e1;
  text-align: center;
}

.set-bonus-banner.active-set {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.35), rgba(250, 204, 21, 0.28));
  border-color: #fde047;
  color: #fef08a;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.3);
}

.mini-customizer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cust-inline {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
}

.color-swatches, .emblem-swatches {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform 0.12s;
}

.swatch-btn.active {
  transform: scale(1.22);
  box-shadow: 0 0 8px #fde047;
  border-color: #fde047;
}

.emblem-btn {
  background: #0f172a;
  border: 1.5px solid #475569;
  color: #fff;
  padding: 2px 7px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.emblem-btn.active {
  border-color: #fde047;
  background: rgba(250, 204, 21, 0.2);
}

/* Dešinė pusė: 15 Kuprinės Vietų + Kalvio Supirktuvė */
.backpack-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: rgba(30, 41, 59, 0.78);
  border: 2px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  padding: 10px 12px;
}

.backpack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inv-help-text {
  font-size: 0.78rem;
  color: #93c5fd;
}

.blacksmith-sell-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.35), rgba(220, 38, 38, 0.3));
  border: 2px dashed #f59e0b;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.blacksmith-sell-slot:hover, .blacksmith-sell-slot.drag-over {
  border-style: solid;
  border-color: #fde047;
  background: rgba(245, 158, 11, 0.4);
  transform: scale(1.03);
}

.sell-icon {
  font-size: 1.5rem;
}

.blacksmith-sell-slot strong {
  display: block;
  font-size: 0.82rem;
  color: #fde047;
}

.blacksmith-sell-slot small {
  font-size: 0.72rem;
  color: #fed7aa;
}

.inv-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inv-tab {
  background: #0f172a;
  border: 1.5px solid #475569;
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.inv-tab.active {
  background: #4f46e5;
  border-color: #818cf8;
  color: #fff;
}

.backpack-slot.filtered-dim {
  opacity: 0.22;
  filter: grayscale(85%);
}

.section-divider-banner {
  grid-column: 1 / -1;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.86rem;
  color: #e0f2fe;
}

.backpack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.backpack-slot {
  height: 54px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  padding: 3px;
  transition: transform 0.12s, border-color 0.12s;
}

.backpack-slot.empty {
  cursor: default;
  opacity: 0.55;
  border-style: dashed;
}

.backpack-slot.has-item:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.backpack-slot.selected-slot, .equip-slot.selected-slot {
  border-color: #fde047 !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.65);
  background: rgba(250, 204, 21, 0.18);
}

.backpack-slot .bp-icon {
  font-size: 1.35rem;
  line-height: 1.1;
}

.backpack-slot .bp-name {
  font-size: 0.66rem;
  font-weight: 800;
  color: #e2e8f0;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backpack-slot .bp-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #fde047;
}

.selected-item-bar {
  background: #0f172a;
  border: 1.5px solid #475569;
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  font-size: 0.82rem;
}

.selected-item-actions {
  display: flex;
  gap: 6px;
}

.small-action-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 9px;
}

.risk-warning-banner {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.35), rgba(234, 88, 12, 0.35));
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: #fecaca;
  text-align: center;
  font-size: 0.92rem;
}

.chain-progress-banner {
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.65), rgba(79, 70, 229, 0.55));
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 900;
  color: #e0f2fe;
}

.chain-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 1.15rem;
}

.magic-square-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, 52px);
  gap: 6px;
  background: #0f172a;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid #38bdf8;
}

.magic-cell {
  width: 52px;
  height: 46px;
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: #f8fafc;
}

.magic-cell.mystery {
  background: #f59e0b;
  border-color: #fde047;
  color: #0f172a;
}

.emoji-aid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.emoji-aid-card {
  font-size: 2.1rem;
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 14px;
  padding: 6px 12px;
}

.exclusive-sets-section {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9), rgba(15, 23, 42, 0.95));
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 4px;
}

.exclusive-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.exclusive-set-card {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #475569;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 0.82rem;
}

.shop-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.shop-tab {
  background: #1e293b;
  border: 2px solid #475569;
  color: #cbd5e1;
  padding: 9px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.shop-tab.active {
  background: #4f46e5;
  border-color: #818cf8;
  color: #fff;
}

.shop-content-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 12px;
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-item-card {
  background: rgba(30, 41, 59, 0.92);
  border: 2px solid #475569;
  border-radius: 16px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.shop-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-item-icon {
  font-size: 1.9rem;
  width: 46px;
  height: 46px;
  background: #0f172a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tier-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  background: #334155;
  color: #fde047;
}

.level-bar-bg {
  width: 100%;
  height: 9px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}

.level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

/* ==================== MATEMATINĖS DVIKOVOS VAIZDINIAI ELEMENTAI ==================== */
.math-duel-card {
  border-color: #facc15;
  width: min(95vw, 680px);
}

.duel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.duel-opponent {
  display: flex;
  align-items: center;
  gap: 12px;
}

.enemy-big-icon { font-size: 2.5rem; }

.combo-badge {
  background: #ea580c;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
}

.helper-btn {
  background: #4f46e5;
  color: #fff;
  border: 2px solid #818cf8;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.question-box {
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.math-subtitle {
  color: #93c5fd;
  font-weight: 800;
  margin-bottom: 6px;
}

.math-prompt {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 900;
  color: #fef08a;
}

.math-visual-aid {
  margin-top: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 14px;
  border: 2px dashed #38bdf8;
}

/* Svarstyklių vizualizacija */
.scales-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scales-beam {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  border-bottom: 5px solid #facc15;
  padding-bottom: 8px;
  min-width: 260px;
}

.scale-pan {
  background: #334155;
  border: 2px solid #94a3b8;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 900;
  color: #fff;
  display: flex;
  gap: 6px;
  align-items: center;
}

.mystery-box {
  background: #f59e0b;
  color: #0f172a;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid #fde047;
  font-weight: 900;
}

/* Monetų ir grąžos vizualizacija */
.coins-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.euro-coin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef08a, #ca8a04);
  border: 3px solid #fde047;
  color: #0f172a;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Skaičių sekos traukinukas */
.seq-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seq-node {
  background: #334155;
  border: 2px solid #38bdf8;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 900;
}

.seq-node.mystery {
  background: #f59e0b;
  border-color: #fde047;
  color: #0f172a;
}

/* Stačiakampio perimetro brėžinys */
.rect-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rect-box {
  width: 160px;
  height: 76px;
  border: 4px solid #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #86efac;
}

.math-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.math-option-btn {
  background: #334155;
  border: 3px solid #64748b;
  color: #fff;
  padding: 14px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
}

.math-option-btn:hover:not(:disabled) {
  background: #4f46e5;
  border-color: #a5b4fc;
}

.math-option-btn.wrong-choice {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  opacity: 0.55;
}

.keypad-toggle-row {
  text-align: center;
  margin-top: 10px;
}

.link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

.math-keypad { margin-top: 10px; }
.keypad-display-row { display: flex; gap: 8px; margin-bottom: 8px; }
#keypad-input {
  flex: 1;
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 8px 14px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
}
.keypad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.key-btn {
  background: #334155;
  border: 2px solid #64748b;
  color: #fff;
  padding: 10px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}
.submit-key { grid-column: span 2; background: #22c55e; border-color: #86efac; }

.hint-box {
  margin-top: 12px;
  background: rgba(245, 158, 11, 0.18);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 10px 14px;
  color: #fef08a;
  font-weight: 700;
  text-align: center;
}

/* ==================== PERGALĖS EKRANAS ==================== */
.result-card { text-align: center; }
.stars-row { font-size: 2.5rem; margin: 10px 0; }
.result-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat-box {
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-box strong { font-size: 1.3rem; color: #fde047; }
.feedback-banner {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  font-weight: 800;
  text-align: center;
  background: rgba(34, 197, 94, 0.2);
  border: 2px solid #22c55e;
}
.file-label { cursor: pointer; }

@media (max-width: 920px) {
  .inventory-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .named-profiles-grid, .levels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== TĖVŲ KONTROLĖ IR DIENOS LAIKO LIMITAS ==================== */
.playtime-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #38bdf8;
  color: #e0f2fe;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.playtime-pill:hover {
  transform: scale(1.04);
  border-color: #fde047;
}

/* Kai lieka mažiau nei 5 minutės (< 300 s) – raudonas ir pulsuojantis laikmatis */
.playtime-pill.low-time {
  border-color: #ef4444 !important;
  background: rgba(127, 29, 29, 0.92) !important;
  color: #fecaca !important;
  animation: pulseLowTime 1s infinite ease-in-out;
}

@keyframes pulseLowTime {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
    color: #ef4444;
  }
}

.time-limit-backdrop {
  z-index: 9999 !important;
  background: rgba(2, 6, 23, 0.92) !important;
}

.time-limit-card {
  border-color: #f59e0b !important;
  max-width: 540px !important;
}

.parent-override-box {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(148, 163, 184, 0.35);
  text-align: left;
}

.parent-override-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 8px;
}

.parent-override-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-password-input {
  flex: 1;
  min-width: 150px;
  background: #0f172a;
  border: 1.5px solid #475569;
  border-radius: 10px;
  padding: 8px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.parent-password-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.parent-extend-btn {
  padding: 8px 14px !important;
  font-size: 0.86rem !important;
}

.parent-feedback {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
}

.parent-feedback.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.parent-feedback.success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #86efac;
}
