:root {
  --bg: #090b1a;
  --bg-deep: #050714;
  --card: #11162a;
  --card-2: #171d36;
  --panel: #0f1428;

  --primary: #5db6ff;
  --primary-strong: #4b8dff;
  --secondary: #9b6bff;
  --secondary-strong: #7c4dff;

  --accent: linear-gradient(135deg, #5db6ff 0%, #9b6bff 100%);
  --accent-soft: linear-gradient(135deg, rgba(93, 182, 255, 0.18) 0%, rgba(155, 107, 255, 0.18) 100%);
  --button-hover: linear-gradient(135deg, #4b8dff 0%, #7c4dff 100%);

  --text: #ffffff;
  --text-soft: #d7def7;
  --muted: #97a3c6;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --success: #35d49a;
  --danger: #ff5c7a;
  --warning: #ffcc66;
  --shadow: 0 10px 28px rgba(0,0,0,0.28);
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(91, 124, 250, 0.16), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(155, 107, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #0b1124, var(--bg));
  color: var(--text);
  overflow: hidden;
}

body.booting {
  background:
    radial-gradient(circle at top, #1e293b 0%, #0f172a 55%, #020617 100%);
}

.hidden {
  display: none !important;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  background: var(--bg);
}

.auth-card {
  background: var(--card);
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  text-align: center;
  width: 300px;
  border: 1px solid rgba(255,255,255,0.05);
}

.auth-card-tabs {
  width: 360px;
  max-width: calc(100vw - 32px);
}

.auth-tabs {
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(93, 182, 255, 0.28);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.auth-tab:hover {
  color: var(--text-soft);
}

.auth-tab.active {
  color: var(--primary);
}

.auth-tab-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50%;
  height: 4px;
  background: var(--accent);
  transition: transform 0.25s ease;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.logo-icon {
  width: 250px;
  height: auto;
  max-width: 100%;
}

.auth-card input {
  width: 100%;
  max-width: 280px;
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  background: var(--panel);
  color: var(--text);
}

.auth-card button {
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.auth-card button:hover {
  background: var(--button-hover);
}

.auth-card button.secondary {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.muted {
  font-size: 0.85em;
  color: var(--muted);
  margin-top: 12px;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(93, 182, 255, 0.10), transparent 24%),
    radial-gradient(circle at 100% 10%, rgba(155, 107, 255, 0.10), transparent 22%),
    var(--bg);
}

.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 16px;
  padding: 16px;
}

.sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #0a1022 0%, #070b18 100%);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.26);
}

.sidebar-top {
  margin-bottom: 18px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  margin-bottom: 10px;
}

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2b344b, #1a2236);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-avatar.avatar-fallback::before {
  content: "BL";
  font-size: 14px;
  font-weight: 800;
  color: #dbe7ff;
}

.player-info {
  min-width: 0;
}

.player-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.player-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.sidebar-quick-actions {
  position: relative;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.sidebar-coins {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.menu-content {
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding: 5px 14px 5px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: rgba(255,255,255,0.02);
}

.sidebar-footer-logo img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(93, 182, 255, 0.18));
}

.sidebar-footer-beta {
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 204, 102, 0.14);
  border: 1px solid rgba(255, 204, 102, 0.28);
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-footer-version {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.sidebar-footer-note {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.menu-static-btn {
  justify-content: center;
}

.menu-static-btn .skill-label {
  position: absolute;
  top: 50%;
  left: 56px;
  transform: translateY(-50%);
  font-size: 14px;
}

.sidebar h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 8px;
  color: var(--text);
}

.sidebar button {
  width: 100%;
  height: 50px;
  padding: 12px 10px 12px 56px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b233d 0%, #141b31 100%);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  box-sizing: border-box;
}

.sidebar-quick-actions .quick-action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  flex: 0 0 40px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.sidebar-quick-actions .quick-action-btn:hover {
  background: rgba(93, 182, 255, 0.14);
  border-color: rgba(155, 107, 255, 0.30);
  transform: translateY(-1px);
  filter: none;
}

.sidebar-quick-actions .quick-action-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

.sidebar-quick-actions .logout-quick-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.06);
}

.sidebar-quick-actions .logout-quick-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

#notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 16px;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px rgba(9, 18, 37, 0.9);
  pointer-events: none;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-height: 430px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.98), rgba(10, 16, 30, 0.98));
  border: 1px solid rgba(93, 182, 255, 0.20);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  z-index: 3000;
  backdrop-filter: blur(8px);
}

.notifications-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.notifications-panel-title-wrap {
  min-width: 0;
}

.notifications-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fbff;
}

.notifications-panel-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.notifications-close-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.04) !important;
  color: #dbeafe !important;
  font-size: 18px;
  line-height: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.notifications-close-btn:hover {
  background: rgba(255,255,255,0.1) !important;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notifications-empty {
  display: none;
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.notifications-empty.show {
  display: block;
}

.notification-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(23, 29, 54, 0.92);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}

.notification-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.notification-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.notification-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.notification-item-coins {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.notification-claim-btn,
.notifications-claim-all-btn {
  align-self: flex-start;
  min-height: auto !important;
  width: auto !important;
  padding: 9px 14px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(93, 182, 255, 0.25) !important;
  background: var(--accent) !important;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.notification-claim-btn:hover,
.notifications-claim-all-btn:hover {
  background: var(--button-hover) !important;
}

.notification-claim-btn:disabled,
.notifications-claim-all-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.notifications-panel-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.sidebar button:hover {
  background: var(--accent-soft);
  border-color: rgba(93, 182, 255, 0.35);
}

.menu-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  opacity: 0.9;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.skill-label {
  position: absolute;
  top: 8px;
  left: 56px;
  font-size: 14px;
  font-weight: 600;
}

.skill-level {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  font-weight: bold;
  color: #f3f4f6;
  background: rgba(255,255,255,0.14);
  padding: 2px 7px;
  border-radius: 999px;
}

.skill-xp-bar-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  margin-top: 20px;
}

.skill-xp-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5db6ff, #9b6bff);
  border-radius: 4px;
  transition: width 0.2s linear;
}

.xp-tooltip {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(8px, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
}

.sidebar button:hover .menu-icon,
.sidebar button.active .menu-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1.08);
}

.character-btn .skill-label {
  position: absolute;
  top: 50%;
  left: 56px;
  transform: translateY(-50%);
  font-size: 14px;
}

.content-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.task-panel {
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 20px;
  background: linear-gradient(180deg, #11162a 0%, #0d1224 100%);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.task-panel h2 {
  color: var(--primary);
  margin-top: 0;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #141a33, #0d1327);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  min-width: 0;
}

.action-bar h2 {
  margin: 0;
  font-size: 18px;
  color: #f9fafb;
  flex: 1 1 auto;
  min-width: 0;
}

.action-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.action-controls.hidden {
  display: none;
}

.current-section-title {
  margin: 0 0 14px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  line-height: 1;
  text-align: center;
}

.task-progress-container {
  height: 25px;
  background-color: rgba(255,255,255,0.10);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  width: min(500px, 100%);
  max-width: 100%;
  flex: 1 1 320px;
  min-width: 140px;
}

.task-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5db6ff, #9b6bff);
  border-radius: 6px;
  transition: width 0.1s linear;
  position: absolute;
  top: 0;
  left: 0;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

#stop-action-btn {
  padding: 4px 10px;
  font-size: 14px;
  line-height: 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-left: 12px;
}

#stop-action-btn:hover {
  background: #dc2626;
}

.market-create-order-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.market-create-order-btn:hover {
  background: var(--button-hover);
}

.market-create-order-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#task-display {
  background-color: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  min-height: 220px;
}

.wood-options,
.mining-options,
.crafting-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  justify-content: flex-start;
}

.wood-btn,
.mining-btn,
.crafting-btn {
  flex: 0 1 160px;
  width: 160px;
  max-width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: linear-gradient(180deg, #171d36 0%, #11162a 100%);
  color: white;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.wood-btn:hover,
.mining-btn:hover,
.crafting-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.wood-btn img.wood-icon,
.mining-btn img.mining-icon,
.crafting-btn img.crafting-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}

.wood-btn span,
.mining-btn span,
.crafting-btn span {
  font-size: 16px;
  text-align: center;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
}

.modal-content h3 {
  margin-top: 0;
  color: var(--primary);
}

.modal-content p {
  margin: 8px 0;
}

.modal-content input {
  width: 60px;
  margin-left: 6px;
}

.modal-content button {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.modal-content button:hover {
  background: var(--button-hover);
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background-color: rgba(15, 23, 42, 0.95);
  color: #dbeafe;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: bold;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#resources-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  padding: 0;
  justify-items: center;
}

.resource-item {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-item:hover {
  transform: scale(1.08);
}

.resource-item.selected .resource-icon {
  border-color: var(--primary);
  box-shadow: 0 0 8px 3px rgba(93, 182, 255, 0.35), 0 0 20px rgba(155, 107, 255, 0.14) inset;
  background: linear-gradient(145deg, rgba(50, 50, 50, 0.6), rgba(30, 30, 30, 0.2));
  transition: all 0.2s ease;
}

.resource-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resource-amount {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

@keyframes resourceGain {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.resource-gain {
  position: absolute;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  animation: resourceGain 1s ease-out forwards;
  pointer-events: none;
}

.sell-all-btn {
  background: var(--accent);
  border: 1px solid rgba(93, 182, 255, 0.25);
  transition: 0.2s;
}

.sell-all-btn:hover {
  background: var(--button-hover);
}

.sell-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  text-align: center;
}

.sell-input {
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #f8fafc;
  color: #0f172a;
}

.sell-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.sell-panel {
  position: absolute;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

  .sell-panel input {
    width: 125px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #888;
    text-align: left;
    font-size: 14px;
    box-sizing: border-box;
  }

  .sell-btn {
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 4px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    width: 100%;
  }

  .sell-btn:hover {
    background: var(--button-hover);
  }

  #coin-display {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
  }

  .coin-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
  }

  .section-banner {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 32px;
    min-height: 80px;
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #121a33, #22163d);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }

  .section-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, rgba(7, 15, 28, 0.6) 0%, rgba(7, 15, 28, 0.35) 35%, rgba(7, 15, 28, 0.1) 100%);
    z-index: 1;
  }

  .section-banner > * {
    position: relative;
    z-index: 2;
  }

  .section-banner-avatar {
    width: 210px;
    min-width: 210px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .section-banner-avatar img {
    width: 195px;
    height: 195px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
    transform: translateY(10px) scale(1.4);
  }

  .section-banner-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .section-banner-name {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.04em;
  }

  .section-banner-quote {
    font-size: 28px;
    font-weight: 700;
    font-style: italic;
    line-height: 1.25;
    color: #ffffff;
    max-width: 900px;
    overflow-wrap: anywhere;
  }

  .section-banner-btn {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
    backdrop-filter: blur(4px);
  }

  .section-banner-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .banner-character {
    background:
      linear-gradient(135deg, rgba(13, 19, 38, 0.94), rgba(63, 88, 173, 0.74)),
      url("assets/banners/character-banner.png") center/cover no-repeat;
  }

  .banner-market {
    background:
      linear-gradient(135deg, rgba(14, 20, 42, 0.94), rgba(116, 84, 194, 0.74)),
      url("assets/banners/market-banner.png") center/cover no-repeat;
  }

  .banner-woodcutting {
    background:
      linear-gradient(135deg, rgba(11, 18, 38, 0.94), rgba(69, 126, 212, 0.70)),
      url("assets/banners/woodcutting-banner.png") center/cover no-repeat;
  }

  .banner-mining {
    background:
      linear-gradient(135deg, rgba(14, 20, 44, 0.94), rgba(95, 93, 210, 0.72)),
      url("assets/banners/mining-banner.png") center/cover no-repeat;
  }

  .banner-crafting {
    background:
      linear-gradient(135deg, rgba(16, 20, 44, 0.94), rgba(145, 89, 213, 0.72)),
      url("assets/banners/crafting-banner.png") center/cover no-repeat;
  }

/* =========================
   CHARACTER SCREEN
========================= */

.character-page-layout {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.character-stats-panel,
.character-hero-panel,
.character-inventory-side {
  background:
    linear-gradient(180deg, rgba(17, 22, 42, 0.98) 0%, rgba(10, 15, 31, 0.98) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow:
    0 14px 34px rgba(0,0,0,0.26),
    inset 0 1px 0 rgba(255,255,255,0.03);
  min-height: 540px;
}

.character-stats-panel,
.character-inventory-side {
  padding: 18px;
}

.character-hero-panel {
  padding: 18px 22px 22px;
}

.character-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 8px;
}

.character-panel-header-center {
  justify-content: center;
  align-items: flex-start;
  text-align: center;
}

.character-panel-eyebrow {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
}

.character-panel-title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.character-panel-header > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.character-panel-header-center > div {
  align-items: center;
}

.character-stats-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.character-stats-controls-inline {
  margin-bottom: 12px;
}

.stat-mode-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(93, 182, 255, 0.25);
  border-radius: 999px;
  padding: 2px;
  height: 28px;
  width: 64px;
}

.stat-mode-slider {
  position: absolute;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #5db6ff, #4b8dff);
  box-shadow:
    0 0 12px rgba(93, 182, 255, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.18s ease;
  z-index: 1;
}

.stat-mode-slider.is-x10 {
  transform: translateX(100%);
}

.stat-mode-option {
  position: relative;
  z-index: 2;
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.15s ease;
}

.stat-mode-option.active {
  color: #ffffff;
}

.character-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
}

.stat-card {
  padding: 12px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-bar {
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(93, 182, 255, 0.14), rgba(155, 107, 255, 0.10));
  border: 1px solid rgba(93, 182, 255, 0.18);
}

.stat-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.stat-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.stat-cost-inline {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.stat-bar-track {
  position: relative;
  width: 100%;
  height: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
}

.stat-value-inside {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.stat-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #5db6ff, #9b6bff);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(93, 182, 255, 0.35);
  transition: width 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-tier,
.stat-cost {
  white-space: nowrap;
}

.stat-plus {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  border: 1px solid rgba(93, 182, 255, 0.22);
  background: rgba(93, 182, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.stat-plus img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.stat-plus:hover {
  background: rgba(93, 182, 255, 0.22);
  border-color: rgba(93, 182, 255, 0.34);
  transform: scale(1.05);
}

.stat-plus:active {
  transform: scale(0.96);
}

.stat-plus:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

.character-equipment-layout {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr) 112px;
  align-items: start;
  justify-items: center;
  gap: 22px;
  min-height: 460px;
  padding-top: 8px;
}

.equipment-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.equipment-slot {
  width: 100%;
  min-height: 88px;
  border-radius: 16px;
  padding: 12px 10px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.equipment-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(93, 182, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(93, 182, 255, 0.08), rgba(155, 107, 255, 0.06));
}

.character-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  width: 100%;
}

.character-portrait-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-portrait-glow {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(93, 182, 255, 0.20) 0%, rgba(155, 107, 255, 0.12) 38%, rgba(0,0,0,0) 72%);
  filter: blur(10px);
  pointer-events: none;
}

.character-avatar {
  position: relative;
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  z-index: 1;
  filter: drop-shadow(0 16px 30px rgba(0,0,0,0.42));
}

.character-inventory-side {
  display: flex;
  flex-direction: column;
}

.character-inventory-side #character-inventory-mount {
  padding-top: 0px;
}

.character-inventory-content {
  background: transparent;
  padding: 0;
  border: none;
}

.character-inventory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 12px;
  align-items: start;
}

.character-inventory-list li {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.character-inventory-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: 32px 12px;
}

@media (max-width: 1200px) {
  .character-page-layout {
    grid-template-columns: 280px minmax(360px, 1fr);
  }

  .character-inventory-side {
    grid-column: 1 / -1;
    min-height: 320px;
  }
}

@media (max-width: 860px) {
  .character-page-layout {
    grid-template-columns: 1fr;
  }

  .character-stats-panel,
  .character-hero-panel,
  .character-inventory-side {
    min-height: auto;
  }

.character-equipment-layout {
  grid-template-columns: 92px minmax(180px, 1fr) 92px;
  gap: 14px;
  min-height: 360px;
  padding-top: 8px;
  align-items: start;
}

  .equipment-slot {
    min-height: 76px;
    font-size: 11px;
  }

  .character-avatar {
    width: 180px;
  }
}

.boot-screen {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at top, #1e293b 0%, #0f172a 55%, #020617 100%);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: bootFade 0.4s ease;
}

.boot-logo {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(93, 182, 255, 0.25));
}

.loader {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top: 3px solid var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bootFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#app-shell {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#app-shell.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1400px) {
  .main-layout {
    gap: 12px;
    padding: 12px;
  }

  .sidebar {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    padding: 14px;
  }

  .sidebar-quick-actions {
    gap: 8px;
    justify-content: space-between;
  }

  .sidebar-quick-actions .quick-action-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex: 0 0 32px;
  }

  .sidebar-quick-actions .quick-action-btn img {
    width: 15px;
    height: 15px;
  }

  .character-page-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .character-main-panel {
    gap: 22px;
  }

  .character-equipment-layout {
    grid-template-columns: 90px 180px 90px;
    gap: 24px;
    min-height: auto;
  }

  .equipment-slot {
    width: 82px;
    height: 76px;
    font-size: 11px;
  }

  .character-avatar {
    width: 130px;
  }

  .character-stats-grid {
    max-width: 100%;
    gap: 12px 14px;
  }

  .section-banner {
    gap: 24px;
    padding: 12px 14px;
  }

  .section-banner-avatar {
    width: 150px;
    min-width: 150px;
  }

  .section-banner-avatar img {
    width: 140px;
    height: 140px;
    transform: translateY(4px) scale(1.15);
  }

  .section-banner-quote {
    font-size: 22px;
  }
}

@media (max-width: 1200px) {
  .main-layout {
    gap: 12px;
    padding: 12px;
  }

  .sidebar {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    padding: 14px;
  }

  .action-bar {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .action-bar h2 {
    width: 100%;
  }

  .action-controls {
    width: 100%;
    justify-content: space-between;
  }

  .task-progress-container {
    flex: 1 1 100%;
    width: 100%;
  }

  .section-banner {
    gap: 20px;
    padding: 12px 14px;
  }

  .section-banner-avatar {
    width: 130px;
    min-width: 130px;
  }

  .section-banner-avatar img {
    width: 120px;
    height: 120px;
    transform: translateY(4px) scale(1.08);
  }

  .section-banner-quote {
    font-size: 20px;
  }
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
  }

  .sidebar {
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: auto;
    overflow: visible;
    padding: 14px;
  }

  .sidebar-top {
    margin-bottom: 14px;
  }

  .sidebar-quick-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .menu-content {
    flex: unset;
  }

  .sidebar-footer {
    margin-top: 16px;
  }

  .content-area {
    gap: 12px;
    overflow: visible;
  }

  .task-panel {
    overflow: visible;
    min-height: auto;
    padding: 16px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .action-bar h2 {
    font-size: 16px;
    min-width: 0;
    width: 100%;
  }

  .action-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .task-progress-container {
    max-width: none;
    width: 100%;
    min-width: 0;
  }

  #stop-action-btn {
    margin-left: 0;
    width: 100%;
  }

  .current-section-title {
    font-size: 22px;
    margin: 0 0 12px 0;
  }

  .section-banner {
    min-height: 132px;
    padding: 16px;
    gap: 16px;
  }

  .section-banner-quote {
    font-size: 18px;
  }

  .section-banner-avatar {
    width: 110px;
    min-width: 110px;
  }

  .section-banner-avatar img {
    width: 102px;
    height: 102px;
    transform: translateY(2px);
  }

  .notifications-panel {
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 48px));
  }

  .character-page-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .character-equipment-layout {
    grid-template-columns: 80px 1fr 80px;
    gap: 16px;
    min-height: auto;
  }

  .character-avatar {
    width: 110px;
  }

  .character-stats-header {
    max-width: 100%;
    justify-content: flex-start;
  }

  .character-stats-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .character-stats-grid {
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .main-layout {
    gap: 10px;
    padding: 10px;
  }

  .sidebar {
    padding: 12px;
    border-radius: 12px;
  }

  .player-card {
    padding: 10px;
    gap: 10px;
  }

  .player-avatar {
    width: 44px;
    height: 44px;
  }

  .player-name {
    font-size: 15px;
  }

  .player-meta {
    font-size: 12px;
  }

  .sidebar-coins {
    font-size: 14px;
    padding: 8px 10px;
  }

  .coin-icon {
    width: 24px;
    height: 24px;
  }

  .sidebar button {
    height: 48px;
    padding: 10px 10px 10px 52px;
  }

  .menu-icon {
    left: 12px;
    width: 22px;
    height: 22px;
  }

  .skill-label {
    left: 52px;
    font-size: 13px;
  }

  .skill-level {
    top: 7px;
    right: 8px;
    font-size: 11px;
    padding: 2px 6px;
  }

  .skill-xp-bar-container {
    margin-top: 18px;
  }

  .task-panel {
    padding: 14px;
    border-radius: 12px;
  }

  .action-bar {
    padding: 10px;
    border-radius: 12px;
  }

  .action-bar h2 {
    font-size: 15px;
  }

  .current-section-title {
    font-size: 18px;
  }

  .wood-options,
  .mining-options,
  .crafting-options {
    gap: 10px;
  }

  .wood-btn,
  .mining-btn,
  .crafting-btn {
    flex: 1 1 calc(50% - 10px);
    width: auto;
    min-width: 130px;
    height: 140px;
    padding: 10px;
  }

  .wood-btn img.wood-icon,
  .mining-btn img.mining-icon,
  .crafting-btn img.crafting-icon {
    width: 88px;
    height: 88px;
    margin-bottom: 6px;
  }

  .wood-btn span,
  .mining-btn span,
  .crafting-btn span {
    font-size: 14px;
  }

  .section-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: auto;
    padding: 14px;
  }

  .section-banner-avatar {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    align-items: center;
  }

  .section-banner-avatar img {
    width: 84px;
    height: 84px;
    transform: none;
  }

  .section-banner-name {
    font-size: 12px;
  }

  .section-banner-quote {
    font-size: 16px;
    max-width: none;
  }

  .section-banner-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .modal-content {
    width: calc(100vw - 24px);
    max-width: none;
    padding: 18px;
  }

  .modal-content button {
    width: 100%;
  }

  #toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .toast {
    width: auto;
  }

  .notifications-panel {
    width: calc(100vw - 32px);
    max-width: none;
  }

  .character-equipment-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }

  .equipment-column {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .equipment-slot {
    width: 76px;
    height: 70px;
    font-size: 11px;
  }

  .character-avatar {
    width: 96px;
  }
}