:root {
  --bg-discord-darkest: #111214;
  --bg-discord-darker: #1e1f22;
  --bg-discord-main: #2b2d31;
  --bg-discord-light: #313338;
  --bg-discord-hover: #35373c;
  --accent-blurple: #5865F2;
  --accent-blurple-hover: #4752C4;
  --accent-green: #23a55a;
  --accent-gold: #f1c40f;
  --accent-ruby: #e74c3c;
  --accent-cyan: #00d2d3;
  --text-primary: #f2f3f5;
  --text-muted: #949ba4;
  --text-dim: #80848e;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-discord-darkest);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.discord-frame {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg-discord-darker);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* TOPBAR */
.discord-topbar {
  height: 56px;
  background: var(--bg-discord-darkest);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.discord-channel-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-badge {
  background: rgba(88, 101, 242, 0.15);
  color: #7289da;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.channel-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.discord-topbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-discord-main);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.energy-timer-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
}

.energy-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.energy-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00d2d3, #23a55a);
  transition: width 0.3s ease;
}

.energy-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

/* USER PROFILE WIDGET & DROPDOWN (TOP RIGHT) */
.discord-topbar-right {
  display: flex;
  align-items: center;
  position: relative;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-discord-main);
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: background 0.2s, border-color 0.2s;
}

.user-profile-widget:hover {
  background: var(--bg-discord-light);
  border-color: rgba(255,255,255,0.2);
}

.user-top-pfp {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}

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

.dropdown-chevron {
  font-size: 10px;
  color: var(--text-muted);
}

/* DROPDOWN MENU */
.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  width: 240px;
  background: var(--bg-discord-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.8);
  overflow: hidden;
  z-index: 1000;
  animation: modal-pop 0.15s ease;
}

.user-dropdown-menu.active {
  display: block;
}

.dropdown-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-name {
  font-size: 14px;
  font-weight: 700;
}

.dropdown-id {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-items-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #dbdee1;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--accent-blurple);
  color: #fff;
}

/* TERMS OF SERVICE MODAL */
.tos-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tos-modal-overlay.active {
  display: flex;
}

.tos-card-box {
  background: var(--bg-discord-darker);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9);
  animation: modal-pop 0.25s ease;
}

.tos-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.tos-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.tos-version-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.tos-body-scroll {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
}

.tos-section-block {
  background: rgba(0,0,0,0.2);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--accent-blurple);
}

.tos-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.tos-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.accept-tos-btn {
  background: var(--accent-blurple);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.accept-tos-btn:hover {
  background: var(--accent-blurple-hover);
  transform: translateY(-2px);
}

/* SETTINGS MODAL */
.settings-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.settings-modal-overlay.active {
  display: flex;
}

.settings-box {
  background: var(--bg-discord-main);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
}

.settings-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-label {
  font-size: 14px;
  font-weight: 600;
}

.setting-sublabel {
  font-size: 11px;
  color: var(--text-muted);
}

@keyframes modal-pop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
