/* SERVBG Tools Portal - Green Terminal Theme v2 */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-console: #0a0c10;
  --border-color: #30363d;
  --border-hover: #484f58;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #3fb950;
  --accent-hover: #56d364;
  --accent-dim: rgba(63, 185, 80, 0.15);
  --accent-border: rgba(63, 185, 80, 0.4);
  --warning: #d29922;
  --warning-dim: rgba(210, 153, 34, 0.15);
  --error: #f85149;
  --error-dim: rgba(248, 81, 73, 0.1);
  --info: #58a6ff;
  --info-dim: rgba(88, 166, 255, 0.1);
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: var(--font-ui);
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.app {
  display: grid;
  grid-template-rows: 48px 1fr 36px;
  grid-template-columns: 260px 1fr 320px;
  grid-template-areas:
    "header header header"
    "tools console news"
    "footer footer footer";
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .app {
    grid-template-columns: 240px 1fr 280px;
  }
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 220px 1fr 240px;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      "header"
      "console"
      "tools"
      "footer";
  }
  .news-panel { display: none; }
}

/* === HEADER === */
.header {
  grid-area: header;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.logo-icon { font-size: 16px; }

.visitor-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.visitor-info::-webkit-scrollbar { height: 0; }

.v-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.v-tag svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.v-tag .val {
  color: var(--text-primary);
  font-weight: 500;
}

/* === TOOLS PANEL (Left) === */
.tools-panel {
  grid-area: tools;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 8px;
}

.tool-section {
  margin-bottom: 12px;
}

.tool-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.tool-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 4px;
  transition: border-color 0.15s;
}

.tool-row:hover {
  border-color: var(--border-hover);
}

.tool-row:focus-within {
  border-color: var(--accent);
}

.tool-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.tool-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  width: 100%;
  min-width: 0;
}

.tool-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tool-input::placeholder {
  color: var(--text-muted);
  font-size: 10px;
}

.go-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--accent);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.go-btn:hover {
  background: var(--accent);
  color: #000;
}

/* Tool with two inputs */
.tool-row.split {
  grid-template-columns: 70px 1fr 50px auto;
}

.tool-input.small {
  width: 50px;
  text-align: center;
}

/* Tool with options row */
.tool-with-opts {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 4px;
}

.tool-with-opts .tool-main {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
}

.tool-opts {
  display: flex;
  gap: 8px;
  padding: 4px 6px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.tool-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.tool-opt input[type="checkbox"] {
  accent-color: var(--accent);
  width: 12px;
  height: 12px;
}

.tool-opt input[type="number"] {
  width: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 10px;
  text-align: center;
}

/* Special buttons */
.tool-btn-special {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--accent-dim);
  border: 1px dashed var(--accent-border);
  border-radius: 4px;
  color: var(--accent);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.tool-btn-special:hover {
  background: var(--accent);
  border-style: solid;
  color: #000;
}

.tool-btn-special svg {
  width: 14px;
  height: 14px;
}

/* === CONSOLE (Middle) === */
.console-panel {
  grid-area: console;
  background: var(--bg-console);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.console-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.console-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.console-actions {
  display: flex;
  gap: 4px;
}

.console-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 5px 10px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.console-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.console-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--font-ui);
}

.console-entry {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.console-entry:last-child {
  border-bottom: none;
}

.console-timestamp {
  color: var(--text-muted);
  font-size: 10px;
  margin-bottom: 2px;
}

.console-command {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 11px;
}

.console-command::before {
  content: '❯ ';
  opacity: 0.7;
}

.console-output {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
}

.console-output.success { border-color: var(--accent-border); }
.console-output.error { border-color: rgba(248, 81, 73, 0.4); color: var(--error); }

.console-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 11px;
}

.console-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* Console Tables */
.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.console-table th {
  text-align: left;
  padding: 5px 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}

.console-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-color);
}

.console-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: var(--accent-dim); color: var(--accent); }
.badge-error { background: var(--error-dim); color: var(--error); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info { background: var(--info-dim); color: var(--info); }

/* === NEWS PANEL (Right) === */
.news-panel {
  grid-area: news;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-header svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.news-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.news-item {
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}

.news-item:hover {
  border-color: var(--accent-border);
}

.news-source {
  color: var(--accent);
  font-size: 10px;
  margin-bottom: 4px;
  font-weight: 600;
}

.news-text {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-text a {
  color: var(--info);
  text-decoration: none;
}

.news-text a:hover {
  text-decoration: underline;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

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

/* === FOOTER === */
.footer {
  grid-area: footer;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  overflow-x: auto;
}

.footer::-webkit-scrollbar { height: 0; }

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-link {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 4px 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.footer-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === COOKIE BANNER === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--accent-border);
  padding: 16px 20px;
  z-index: 2000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  min-width: 280px;
}

.cookie-text strong {
  color: var(--accent);
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.cookie-text p {
  color: var(--text-secondary);
  font-size: 11px;
  margin: 0;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent);
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.cookie-btn.accept {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
}

.cookie-btn.accept:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.cookie-btn.reject {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.cookie-btn.reject:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stat-label {
  color: var(--text-muted);
}

.stat-val {
  color: var(--accent);
  font-weight: 600;
}

.stat-sep {
  color: var(--border-color);
  margin: 0 4px;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

/* Wider modal for profile page */
.modal.wide {
  max-width: 680px;
}

.modal.profile-modal {
  max-width: 600px;
  width: 90%;
  max-height: fit-content;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(90vh - 50px);
}

/* Profile modal specific scrolling */
.modal.profile-modal .modal-body {
  overflow-y: auto;
  padding: 12px;
  max-height: 80vh;
}

/* Stats modal - no scroll */
.modal-body.stats-body {
  overflow: hidden;
  padding: 0;
}

.modal-body iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 4px;
}

/* Full-screen modal for tools */
.modal-fullscreen {
  width: 98vw;
  max-width: 800px;
  height: 90vh;
  max-height: 90vh;
}

.modal-body-fullscreen {
  padding: 0;
  height: calc(90vh - 45px);
  overflow: hidden;
}

.modal-body-fullscreen iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

/* === UTILITIES === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

.hidden { display: none !important; }
.text-success { color: var(--accent); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* === PAGE CONTENT STYLES === */
.page-content {
  padding: 10px 0;
}

/* About Page */
.about-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.about-avatar {
  width: 80px;
  height: 80px;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 12px;
}

.about-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.about-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

/* Contact Form */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-submit {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 12px;
  color: #000;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.form-submit:hover {
  background: var(--accent-hover);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-success {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 13px;
  text-align: center;
}

.form-error {
  margin-top: 16px;
  padding: 12px;
  background: var(--error-dim);
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-size: 13px;
  text-align: center;
}

/* Links Page */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  transition: all 0.15s;
}

.link-item:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.link-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.link-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Quiz */
.quiz-content {
  min-height: 300px;
}

.quiz-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quiz-cat-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px 12px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.quiz-cat-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.quiz-cat-btn.random {
  grid-column: span 2;
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.quiz-cat-btn.random:hover {
  background: var(--accent);
  color: #000;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.quiz-question {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
}

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

.quiz-answer {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.quiz-answer:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-primary);
}

.quiz-answer:disabled {
  cursor: not-allowed;
}

.quiz-answer.correct {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.quiz-answer.wrong {
  background: var(--error-dim);
  border-color: var(--error);
  color: var(--error);
}

.quiz-feedback {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.quiz-correct { color: var(--accent); }
.quiz-wrong { color: var(--error); }

.quiz-final-score {
  text-align: center;
  padding: 30px 0;
}

.quiz-grade {
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.quiz-result-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.quiz-score-details {
  text-align: left;
}

.quiz-pct {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.quiz-level-badge {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.level-nightmare {
  color: #f85149;
  font-weight: 600;
}

.level-standard {
  color: var(--text-secondary);
}

.quiz-time {
  font-size: 12px;
  color: var(--text-muted);
}

.quiz-final-score {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.quiz-msg {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 12px 0;
  text-align: center;
}

.quiz-weak-area {
  font-size: 12px;
  color: var(--warning);
  background: var(--warning-dim);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
  text-align: center;
}

.quiz-player-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

.quiz-status {
  font-size: 11px;
  color: var(--info);
  margin-top: 4px;
  text-align: center;
}

.wrong-answers-container {
  display: none;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
}

.wrong-highlight {
  color: var(--error);
}

.correct-highlight {
  color: var(--accent);
}

.quiz-restart {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 14px;
  color: #000;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 20px;
}

.quiz-restart:hover {
  background: var(--accent-hover);
}

/* === UPDATED QUIZ STYLES === */
.quiz-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-level-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.quiz-level-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.quiz-level-btn .level-icon {
  font-size: 28px;
}

.quiz-level-btn .level-name {
  font-size: 16px;
  font-weight: 600;
  display: block;
}

.quiz-level-btn .level-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.quiz-level-btn.basic:hover { border-color: #56d364; }
.quiz-level-btn.moderate:hover { border-color: #d29922; }
.quiz-level-btn.advanced:hover { border-color: #f85149; }

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.quiz-progress, .quiz-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

#quizLevel {
  color: var(--text-primary);
  font-weight: 600;
}

#quizTimer {
  font-family: var(--font-ui);
  color: var(--accent);
}

.quiz-level-badge {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.quiz-time {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0;
}

.quiz-email-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.quiz-email-form .form-input {
  font-size: 12px;
  padding: 10px 12px;
}

.quiz-email-btn {
  width: 100%;
  background: var(--info);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s;
}

.quiz-email-btn:hover {
  background: #79c0ff;
}

/* === NIGHTMARE MODE STYLES === */
.quiz-level-btn.nightmare {
  background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 100%);
  border: 2px solid #f85149;
  position: relative;
  overflow: hidden;
}

.quiz-level-btn.nightmare::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(248,81,73,0.1) 0%, transparent 60%);
  animation: nightmareGlow 3s ease-in-out infinite;
}

.quiz-level-btn.nightmare:hover {
  border-color: #ff6b6b;
  box-shadow: 0 0 20px rgba(248,81,73,0.4);
  transform: scale(1.02);
}

.quiz-level-btn.nightmare .level-name {
  color: #f85149;
  text-shadow: 0 0 10px rgba(248,81,73,0.5);
  letter-spacing: 2px;
}

.quiz-level-btn.nightmare .level-icon {
  animation: skullBounce 1s ease-in-out infinite;
}

@keyframes nightmareGlow {
  0%, 100% { opacity: 0.3; transform: rotate(0deg); }
  50% { opacity: 0.6; transform: rotate(180deg); }
}

@keyframes skullBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#quizTimer.nightmare-warning {
  color: #f85149 !important;
  animation: pulse 0.5s infinite;
  font-weight: bold;
}

/* === LEADERBOARD & NIGHTMARE PROMPT === */
.quiz-leaderboard-btn {
  width: 100%;
  background: linear-gradient(135deg, #1a1a0a 0%, #2d2d10 100%);
  border: 1px solid #d29922;
  border-radius: 6px;
  padding: 12px;
  color: #d29922;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.15s;
}

.quiz-leaderboard-btn:hover {
  background: #d29922;
  color: #000;
}

.nightmare-prompt-box {
  background: linear-gradient(135deg, #1a0a0a 0%, #2d1010 100%);
  border: 2px solid #f85149;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.nightmare-start-btn {
  flex: 1;
  background: #f85149;
  border: none;
  border-radius: 4px;
  padding: 12px 20px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.nightmare-start-btn:hover {
  background: #ff6b6b;
  box-shadow: 0 0 20px rgba(248,81,73,0.4);
}

.nightmare-cancel-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px 20px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.nightmare-cancel-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.leaderboard-table th {
  text-align: left;
  padding: 10px 8px;
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.leaderboard-table tr.top-three td {
  color: var(--text-primary);
}

.leaderboard-table tr.top-three:first-child td {
  color: #ffd700;
}

.leaderboard-table tr.top-three:nth-child(2) td {
  color: #c0c0c0;
}

.leaderboard-table tr.top-three:nth-child(3) td {
  color: #cd7f32;
}

/* === WRONG ANSWERS LIST === */
.quiz-show-wrong-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.15s;
  display: block;
  width: 100%;
}

.quiz-show-wrong-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-card);
}

.wrong-answer-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 11px;
}

.wrong-q {
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 500;
}

.wrong-your, .wrong-correct {
  color: var(--text-muted);
  font-size: 10px;
}

/* === SURVIVAL MODE STYLES === */
.quiz-level-btn.survival {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a4d2e 0%, #22543d 100%);
  border-color: #2d6a4f;
}

.quiz-level-btn.survival .level-name,
.quiz-level-btn.survival .level-desc,
.quiz-level-btn.survival .level-icon {
  color: #7ee8a0;
}

.quiz-level-btn.survival .level-desc {
  color: #52c77e;
}

.quiz-level-btn.survival::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(126, 232, 160, 0.15), transparent);
  animation: survivalShine 3s infinite;
}

@keyframes survivalShine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.quiz-level-btn.survival:hover {
  border-color: #40916c;
  box-shadow: 0 0 20px rgba(63, 185, 80, 0.3);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #22543d 0%, #2d6a4f 100%);
}

/* Survival Hub Tabs */
.survival-hub {
  max-width: 100%;
}

.survival-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.survival-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s;
}

.survival-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.survival-tab.active {
  color: #3fb950;
  background: var(--bg-secondary);
  border-bottom: 2px solid #3fb950;
}

.survival-tab-content {
  min-height: 300px;
  overflow: hidden;
}

/* Survival Game UI */
.survival-game-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.survival-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  border-radius: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.survival-timer-display {
  text-align: center;
}

.timer-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(#3fb950 var(--progress, 100%), var(--bg-primary) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 8px;
}

.timer-circle::before {
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  background: var(--bg-primary);
  border-radius: 50%;
}

#survivalTimerText {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 700;
  color: #3fb950;
  font-family: var(--font-ui);
}

.timer-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.survival-live-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-item {
  text-align: center;
  min-width: 60px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-ui);
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.survival-question-area {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
}

.survival-category {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: var(--bg-primary);
  border-radius: 20px;
  display: inline-block;
}

.survival-question {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.5;
}

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

.survival-answer-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.survival-answer-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(88, 166, 255, 0.1);
}

.survival-answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.survival-answer-btn.correct {
  background: rgba(63, 185, 80, 0.2);
  border-color: #3fb950;
  color: #3fb950;
}

.survival-answer-btn.wrong {
  background: rgba(248, 81, 73, 0.2);
  border-color: #f85149;
  color: #f85149;
}

.survival-feedback {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  display: none;
}

.survival-feedback.show {
  display: block;
}

.survival-feedback.correct {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.survival-feedback.wrong {
  background: rgba(248, 81, 73, 0.1);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.survival-footer {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.survival-pause-btn {
  background: #238636;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.survival-pause-btn:hover:not(:disabled) {
  background: #2ea043;
}

.survival-pause-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.survival-end-btn {
  background: transparent;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.survival-end-btn:hover {
  background: rgba(248, 81, 73, 0.1);
}

/* Survival Result */
.survival-result-container {
  text-align: center;
}

.survival-final-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.survival-final-stat {
  text-align: center;
}

.final-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #3fb950;
  font-family: var(--font-ui);
}

.final-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.survival-achievements-earned {
  margin-top: 16px;
}

.achievement-unlocked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.2) 0%, rgba(210, 153, 34, 0.1) 100%);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  margin: 4px;
  font-size: 12px;
  color: #d29922;
}

.achievement-unlocked .achievement-icon {
  font-size: 16px;
}

/* Challenge Cards */
.challenge-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.challenge-card.daily {
  border-left: 3px solid #58a6ff;
}

.challenge-card.weekly {
  border-left: 3px solid #d29922;
}

.challenge-card.completed {
  opacity: 0.6;
  background: rgba(63, 185, 80, 0.05);
  border-left-color: #3fb950;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.challenge-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.challenge-reward {
  font-size: 11px;
  color: #d29922;
  background: rgba(210, 153, 34, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.challenge-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.challenge-progress {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.challenge-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #238636, #3fb950);
  border-radius: 2px;
  transition: width 0.3s;
}

/* Achievement Grid */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.15s;
}

.achievement-badge.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement-badge.unlocked {
  border-color: #d29922;
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.1) 0%, transparent 100%);
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* Stats History */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.overview-stat {
  text-align: center;
}

.overview-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-ui);
}

.overview-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.run-history {
  font-size: 12px;
}

.run-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
}

.run-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.run-score {
  font-weight: 600;
  color: #3fb950;
  font-family: var(--font-ui);
}

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

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

/* Timer danger states */
.timer-circle.warning {
  background: conic-gradient(#d29922 var(--progress, 100%), var(--bg-primary) 0%);
}

.timer-circle.danger {
  background: conic-gradient(#f85149 var(--progress, 100%), var(--bg-primary) 0%);
  animation: pulse 0.5s infinite;
}

.timer-circle.warning #survivalTimerText,
.timer-circle.danger #survivalTimerText {
  color: inherit;
}

.timer-circle.warning #survivalTimerText { color: #d29922; }
.timer-circle.danger #survivalTimerText { color: #f85149; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* === STATS PAGE STYLES - WIDE LAYOUT === */

/* Make modal wider for stats */
.modal:has(.stats-wide) {
  max-width: 95vw;
  width: 1400px;
}

.stats-wide {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: auto;
}

.stats-header-bar {
  background: var(--bg-console);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-title {
  color: var(--accent);
  font-weight: 600;
}

.stats-meta {
  color: var(--text-muted);
}

.stats-grid-wide {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 1px;
  background: var(--border-color);
  flex: 1;
  overflow: hidden;
}

.stats-column {
  background: var(--bg-primary);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.stats-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.section-header {
  background: var(--bg-console);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.5px;
}

.stats-table {
  padding: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-key {
  color: var(--text-muted);
}

.stat-val {
  color: var(--text-primary);
  font-weight: 500;
}

.stat-val.accent { color: var(--accent); }
.stat-val.error { color: var(--error); }
.stat-val.gold { color: #ffd700; }
.stat-val.fire { color: #ff6b35; }

/* Compact Leaderboard */
.leaderboard-compact {
  padding: 4px;
}

.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr 70px 40px 40px 50px;
  gap: 6px;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 11px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row.top3 {
  background: rgba(63, 185, 80, 0.05);
}

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

.lb-row.top3:nth-child(1) .lb-rank { color: #ffd700; }
.lb-row.top3:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-row.top3:nth-child(3) .lb-rank { color: #cd7f32; }

.lb-name {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: var(--accent);
  text-align: right;
  font-weight: 600;
}

.lb-detail {
  color: var(--text-muted);
  text-align: right;
  font-size: 10px;
}

.lb-detail.fire {
  color: #ff6b35;
}

/* Compact Graveyard */
.graveyard-section {
  flex: 1;
}

.graveyard-compact {
  padding: 4px;
  overflow: hidden;
}

.grave-row {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-ui);
}

.grave-row:last-child {
  border-bottom: none;
}

.grave-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.grave-tomb {
  font-size: 14px;
}

.grave-nick {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 12px;
  flex: 1;
}

.grave-pts {
  color: var(--error);
  font-size: 11px;
}

.grave-epitaph {
  color: var(--text-secondary);
  font-size: 10px;
  font-style: italic;
  margin-bottom: 2px;
  padding-left: 22px;
}

.grave-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  padding-left: 22px;
}

.grave-cause {
  color: var(--text-muted);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category Stats */
.category-stats {
  padding: 8px;
}

.cat-row {
  display: grid;
  grid-template-columns: 80px 1fr 35px;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-family: var(--font-ui);
  font-size: 10px;
}

.cat-row.total {
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  padding-top: 6px;
}

.cat-name {
  color: var(--text-muted);
  text-transform: uppercase;
}

.cat-row.total .cat-name {
  color: var(--accent);
  font-weight: 600;
}

.cat-bar {
  height: 4px;
  background: var(--bg-console);
  border-radius: 2px;
  overflow: hidden;
}

.cat-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.cat-count {
  color: var(--text-primary);
  text-align: right;
}

/* Geeky Tooltips */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-console);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--accent);
  z-index: 101;
  margin-bottom: -6px;
}

/* Graveyard compact row with tooltip */
.grave-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-ui);
  transition: background 0.15s;
}

.grave-row:hover {
  background: rgba(248, 81, 73, 0.05);
}

.grave-row:last-child {
  border-bottom: none;
}

.grave-tomb {
  font-size: 14px;
  flex-shrink: 0;
}

.grave-nick {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 11px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grave-stats {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

/* Death entry with tooltip */
.death-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-ui);
  font-size: 10px;
  transition: background 0.15s;
}

.death-entry:hover {
  background: rgba(248, 81, 73, 0.05);
}

.death-entry:last-child {
  border-bottom: none;
}

/* Leaderboard row hover */
.lb-row {
  transition: background 0.15s;
}

.lb-row:hover {
  background: rgba(63, 185, 80, 0.08);
}

.empty-state {
  background: var(--bg-console);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  text-align: center;
}

.stats-play-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.15s;
}

.stats-play-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
}

/* Responsive for stats */
@media (max-width: 1000px) {
  .stats-grid-wide {
    grid-template-columns: 1fr 1fr;
  }
  .stats-column:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .stats-grid-wide {
    grid-template-columns: 1fr;
  }
}

/* Old stats styles (kept for compatibility) */
.stats-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.stats-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s;
}

.stats-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.stats-tab.active {
  color: var(--accent);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent);
}

.global-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.global-stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.15s;
}

.global-stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.global-stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.global-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-ui);
}

.global-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.top-players-list {
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
}

.top-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.top-player-item:last-child {
  border-bottom: none;
}

.player-rank {
  font-size: 16px;
  min-width: 30px;
}

.player-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.player-score {
  font-family: var(--font-ui);
  color: #3fb950;
  font-weight: 600;
}

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

.stats-cta-btn {
  background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.stats-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
}

/* Graveyard Styles */
.graveyard-header {
  text-align: center;
  margin-bottom: 20px;
}

.graveyard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.grave-stone {
  background: linear-gradient(180deg, #1c1c1c 0%, #0d0d0d 100%);
  border: 1px solid #333;
  border-radius: 12px 12px 0 0;
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: all 0.2s;
}

.grave-stone::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #444, transparent);
}

.grave-stone:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: #555;
}

.grave-icon {
  font-size: 36px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.grave-name {
  font-size: 14px;
  font-weight: 700;
  color: #ccc;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.grave-score {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
}

.grave-epitaph {
  font-size: 10px;
  color: #f85149;
  font-family: var(--font-ui);
  background: rgba(248, 81, 73, 0.1);
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  word-break: break-word;
}

.grave-cause {
  font-size: 10px;
  color: #666;
  font-style: italic;
  margin-bottom: 8px;
}

.grave-date {
  font-size: 10px;
  color: #444;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .graveyard-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .global-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .top-player-item {
    flex-wrap: wrap;
  }
  
  .player-details {
    width: 100%;
    margin-top: 4px;
  }
}

/* Death Feed */
.death-feed {
  padding: 4px;
}

.death-nick {
  color: var(--text-primary);
  font-weight: 500;
}

.death-score {
  color: var(--error);
}

/* ============================================
   USER PROFILE STYLES
   ============================================ */

.profile-content {
  padding: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.profile-login {
  text-align: center;
  padding: 40px 20px;
}

.profile-header-text {
  margin-bottom: 24px;
}

.profile-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.profile-header-text h3 {
  color: var(--accent);
  margin-bottom: 8px;
}

.profile-header-text p {
  color: var(--text-secondary);
  font-size: 13px;
}

.profile-note {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  margin-top: 8px !important;
}

.profile-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.profile-input {
  flex: 1;
  background: var(--bg-console);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
}

.profile-input:focus {
  outline: none;
  border-color: var(--accent);
}

.profile-btn {
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  padding: 10px 20px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s;
}

.profile-btn:hover {
  opacity: 0.9;
}

/* Profile Locked State */
.profile-locked {
  text-align: center;
  padding: 60px 20px;
}

.lock-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.profile-locked h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
}

.profile-locked p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-stats-hint {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-family: var(--font-ui);
  margin-bottom: 20px !important;
}

/* Full Profile View - Compact Version */
.profile-full {
  font-family: var(--font-ui);
  max-width: 100%;
  margin: 0 auto;
}

/* Compact Profile Header - Responsive Layout */
.profile-header-compact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 12px;
}

.profile-header-top {
  display: flex;
  gap: 16px;
  align-items: center;
  grid-column: 1 / -1;
}

.profile-stats-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  grid-column: 1 / -1;
  margin-top: 8px;
}

.profile-avatar-section {
  flex-shrink: 0;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-console);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.avatar-placeholder {
  font-size: 24px;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 16px;
}

.profile-avatar:hover .avatar-overlay {
  opacity: 1;
}

/* Compact Profile Info */
.profile-info-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-nickname-input-compact {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent);
  padding: 6px 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
}

.profile-motto-input-compact {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-style: italic;
  width: 100%;
}

.profile-nickname-input-compact:focus,
.profile-motto-input-compact:focus {
  outline: none;
  border-color: var(--accent);
}

.profile-actions-compact {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.profile-action-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-action-btn:hover {
  background: var(--accent);
  color: #000;
}

/* Compact Stats - Grid Layout */
.stat-item-compact {
  text-align: center;
  padding: 8px;
  background: var(--bg-console);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-item-compact.nightmare .stat-value { color: #f85149; }
.stat-item-compact.survival .stat-value { color: var(--accent); }
.stat-item-compact.overall .stat-value { color: #58a6ff; }

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

/* Quick Actions - Styled like Advanced Port Scanner */
.profile-quick-actions-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-btn {
  background: var(--accent-dim);
  border: 1px dashed var(--accent-border);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.quick-btn:hover {
  background: var(--accent);
  border-style: solid;
  color: #000;
}

/* Compact Knowledge Matrix */
.profile-knowledge-compact {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
}

.profile-knowledge-compact h4 {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
}

.knowledge-note-compact {
  color: var(--text-muted);
  font-size: 11px;
  margin: 0 0 10px 0;
}

.knowledge-bars-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.knowledge-row-compact {
  display: grid;
  grid-template-columns: 120px 1fr 45px;
  gap: 8px;
  align-items: center;
}

.knowledge-cat-compact {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.knowledge-bar-compact {
  background: var(--bg-console);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  height: 12px;
  overflow: hidden;
}

.knowledge-fill-compact {
  height: 100%;
  transition: width 0.3s ease;
}

.knowledge-fill-compact.expert { background: var(--accent); }
.knowledge-fill-compact.proficient { background: #58a6ff; }
.knowledge-fill-compact.learning { background: #d29922; }
.knowledge-fill-compact.beginner { background: #6e7681; }

.knowledge-pct-compact {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}
.claim-banner {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.15), rgba(63, 185, 80, 0.05));
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: slideIn 0.3s ease-out;
}

.claim-banner.loading {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.05));
  border-color: rgba(88, 166, 255, 0.3);
  justify-content: center;
  padding: 12px;
}

.claim-banner.success {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.2), rgba(63, 185, 80, 0.1));
  border-color: rgba(63, 185, 80, 0.5);
}

.claim-banner.error {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.15), rgba(248, 81, 73, 0.05));
  border-color: rgba(248, 81, 73, 0.3);
}

.claim-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.claim-content {
  flex: 1;
}

.claim-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.claim-desc {
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.claim-actions {
  display: flex;
  gap: 8px;
}

.claim-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.claim-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.claim-dismiss-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.claim-dismiss-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === CHANGE PASSWORD MODAL === */
  font-size: 10px;
}

.knowledge-cat {
  color: var(--text-muted);
  text-transform: uppercase;
}

.knowledge-bar {
  height: 8px;
  background: var(--bg-console);
  border-radius: 4px;
  overflow: hidden;
}

.knowledge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.knowledge-fill.expert { background: var(--accent); }
.knowledge-fill.proficient { background: #58a6ff; }
.knowledge-fill.intermediate { background: #d29922; }
.knowledge-fill.beginner { background: #f85149; }

.knowledge-pct {
  color: var(--text-primary);
  text-align: right;
  font-weight: 600;
}

.knowledge-count {
  color: var(--text-muted);
  text-align: right;
}

.no-knowledge {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 11px;
}

/* Detailed Stats Section */
.profile-detailed-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.profile-detailed-stats h4 {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
}

.stats-section h5 {
  font-size: 11px;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.stats-section.nightmare-stats h5 { color: #f85149; }
.stats-section.survival-stats h5 { color: #3fb950; }

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 3px 0;
  color: var(--text-secondary);
}

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.stat-value.good { color: var(--accent); }
.stat-value.warn { color: var(--warning); }
.stat-value.bad { color: var(--error); }

.mini-chart {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

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

.score-trend {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.trend-dot {
  font-size: 12px;
  cursor: help;
}

.knowledge-insights {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.insight {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
}

.insight.good {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--accent);
}

.insight.warn {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--warning);
}

.no-stats, .stats-error, .stats-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 11px;
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-insights {
    flex-direction: column;
  }
}

/* Responsive Profile Layout */
@media (max-width: 900px) {
  .profile-full {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "scores"
      "actions"
      "knowledge"
      "detailed"
      "footer";
  }
  
  .modal.profile-modal {
    max-width: 600px;
  }
}

/* Profile Footer */
.profile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

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

.profile-refresh-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-refresh-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .profile-scores {
    grid-template-columns: 1fr;
  }
  
  .knowledge-row {
    grid-template-columns: 70px 1fr 40px;
  }
  
  .knowledge-count {
    display: none;
  }
}

/* ============================================
   GAMIFICATION VISUAL EFFECTS
   ============================================ */

/* Floating time change */
.time-change-float {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.time-change-float.show {
  animation: floatUp 1s ease-out forwards;
}

.time-change-float.positive {
  color: #3fb950;
  text-shadow: 0 0 10px rgba(63, 185, 80, 0.5);
}

.time-change-float.negative {
  color: #f85149;
  text-shadow: 0 0 10px rgba(248, 81, 73, 0.5);
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-40px);
  }
}

/* Streak flames */
.streak-stat {
  position: relative;
}

.streak-flames {
  position: absolute;
  top: -8px;
  right: -20px;
  font-size: 16px;
  animation: flicker 0.5s infinite alternate;
}

.streak-flames.hot {
  font-size: 18px;
  animation: flicker 0.3s infinite alternate;
}

.streak-flames.legendary {
  font-size: 22px;
  animation: flicker 0.2s infinite alternate, pulse 0.5s infinite;
}

@keyframes flicker {
  from { opacity: 0.8; transform: scale(1); }
  to { opacity: 1; transform: scale(1.1); }
}

/* Streak value glow */
#survivalStreak.streak-hot {
  color: #ff6b35 !important;
  text-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

#survivalStreak.streak-legendary {
  color: #ffd700 !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  animation: legendaryPulse 0.5s infinite alternate;
}

@keyframes legendaryPulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Screen shake on wrong */
.survival-game-container.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Combo text */
.combo-text {
  color: #ffd700;
  font-weight: 700;
  animation: comboPulse 0.5s ease-out;
}

.streak-text {
  color: #ff6b35;
  font-weight: 600;
}

@keyframes comboPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Timer urgency effects */
.timer-circle.urgent {
  animation: urgentPulse 0.5s infinite;
  border-color: #f85149 !important;
}

.timer-circle.danger {
  animation: dangerPulse 0.3s infinite;
  border-color: #f85149 !important;
  box-shadow: 0 0 20px rgba(248, 81, 73, 0.5);
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(248, 81, 73, 0.3); }
  50% { box-shadow: 0 0 15px rgba(248, 81, 73, 0.6); }
}

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(248, 81, 73, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(248, 81, 73, 0.8); }
}

/* Answer button hover effects */
.survival-answer-btn {
  transition: all 0.15s ease, transform 0.1s ease;
}

.survival-answer-btn:hover:not(:disabled) {
  transform: translateX(4px);
  border-color: var(--accent);
  background: rgba(63, 185, 80, 0.1);
}

.survival-answer-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Correct/wrong button states */
.survival-answer-btn.correct {
  background: rgba(63, 185, 80, 0.2) !important;
  border-color: #3fb950 !important;
  animation: correctFlash 0.3s ease;
}

.survival-answer-btn.wrong {
  background: rgba(248, 81, 73, 0.2) !important;
  border-color: #f85149 !important;
  animation: wrongShake 0.3s ease;
}

@keyframes correctFlash {
  0% { background: rgba(63, 185, 80, 0.5); }
  100% { background: rgba(63, 185, 80, 0.2); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Category badge */
.survival-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-console);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* ============================================
   AUTHENTICATION STYLES
   ============================================ */

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
}

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

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form {
  padding: 16px;
  max-width: 420px;
  margin: 0 auto;
}

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

.auth-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.auth-header h3 {
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 16px;
}

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

.form-group {
  margin-bottom: 10px;
}

.auth-input {
  width: 100%;
  background: var(--bg-console);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-submit-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  padding: 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-submit-btn:hover {
  opacity: 0.9;
}

.auth-link {
  text-align: center;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s;
}

.auth-link:hover {
  color: var(--accent);
}

.auth-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  display: none;
}

.auth-message.success {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.auth-message.error {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.auth-success, .auth-error {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  display: inline-block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  font-size: 32px;
  line-height: 60px;
  margin-bottom: 16px;
}

.error-icon {
  display: inline-block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
  font-size: 32px;
  line-height: 60px;
  margin-bottom: 16px;
}

/* Profile actions */
.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-pwd-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-pwd-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.profile-footer-actions {
  display: flex;
  gap: 8px;
}

.profile-logout-btn {
  background: transparent;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-logout-btn:hover {
  background: #f85149;
  color: var(--bg-primary);
}

/* Password change form */
.password-change-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.password-change-form h4 {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 12px;
}

.password-change-form .auth-input {
  margin-bottom: 10px;
}

.password-actions {
  display: flex;
  gap: 8px;
}

.profile-cancel-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.profile-cancel-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* =============================================
   REDESIGNED STATS PAGE - Dual Board Layout
   ============================================= */

.stats-dual-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
}

.stats-board {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.stats-board.nightmare-board {
  border-color: rgba(248, 81, 73, 0.3);
}

.stats-board.survival-board {
  border-color: rgba(139, 148, 158, 0.3);
}

.board-header {
  padding: 12px 16px;
  background: var(--bg-console);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nightmare-board .board-header {
  background: linear-gradient(135deg, rgba(248, 81, 73, 0.1) 0%, transparent 100%);
}

.survival-board .board-header {
  background: linear-gradient(135deg, rgba(139, 148, 158, 0.1) 0%, transparent 100%);
}

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

.board-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.board-subtitle {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.board-table {
  padding: 8px;
}

.board-row {
  display: grid;
  grid-template-columns: 28px minmax(80px, 1fr) 65px 50px 35px 35px 40px minmax(70px, 1fr);
  gap: 6px;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.board-row.header-row {
  background: var(--bg-console);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
}

.board-row:last-child {
  border-bottom: none;
}

.board-row.top3 {
  background: rgba(63, 185, 80, 0.05);
}

.board-row.rank1 .col-rank,
.board-row.rank1 .col-nick {
  color: #ffd700;
}

.board-row.rank2 .col-rank,
.board-row.rank2 .col-nick {
  color: #c0c0c0;
}

.board-row.rank3 .col-rank,
.board-row.rank3 .col-nick {
  color: #cd7f32;
}

.col-rank {
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

.col-nick {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-score {
  color: var(--accent);
  font-weight: 600;
  text-align: right;
}

.col-qa, .col-pct, .col-time, .col-streak {
  color: var(--text-muted);
  text-align: center;
}

.col-correct {
  color: #3fb950;
  text-align: center;
  font-weight: 500;
}

.col-wrong {
  color: #f85149;
  text-align: center;
  font-weight: 500;
}

.col-title {
  color: var(--text-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
}

/* Bottom stats grid */
.stats-grid-bottom {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 16px 16px;
}

@media (max-width: 1200px) {
  .stats-dual-boards {
    grid-template-columns: 1fr;
  }
  
  .stats-grid-bottom {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .board-row {
    grid-template-columns: 25px 1fr 55px 45px 30px 30px 35px minmax(50px, 1fr);
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .stats-grid-bottom {
    grid-template-columns: 1fr;
  }
  
  .board-row {
    grid-template-columns: 22px 1fr 50px 30px 30px 35px;
    font-size: 10px;
  }
  
  .col-time, .col-title {
    display: none;
  }
}

/* =============================================
   KNOWLEDGE TOOLTIP FOR STATS LEADERBOARDS
   ============================================= */

.knowledge-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0;
  width: 320px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: none;
  font-family: var(--font-ui);
  overflow: hidden;
}

.knowledge-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--border-color);
}

/* Profile Section */
.tooltip-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.tooltip-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-console);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.tooltip-avatar-placeholder {
  font-size: 20px;
}

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

.tooltip-nickname {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.tooltip-motto {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Scores Section */
.tooltip-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-color);
}

.tooltip-score-item {
  background: var(--bg-secondary);
  padding: 10px 12px;
  text-align: center;
}

.tooltip-score-item .score-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.tooltip-score-item .score-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 2px;
}

.tooltip-score-item.nightmare .score-value {
  color: #f85149;
}

.tooltip-score-item.survival .score-value {
  color: var(--accent);
}

.tooltip-score-item .score-attempts {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* Knowledge Section */
.tooltip-knowledge {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
}

.tooltip-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.tooltip-no-data {
  padding: 12px 14px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.tooltip-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.tooltip-overall {
  font-size: 10px;
  color: var(--accent);
}

.tooltip-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 80px 1fr 35px;
  gap: 8px;
  align-items: center;
}

.tooltip-cat {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-bar {
  height: 8px;
  background: var(--bg-console);
  border-radius: 4px;
  overflow: hidden;
}

.tooltip-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.tooltip-fill.expert {
  background: linear-gradient(90deg, #3fb950, #56d364);
}

.tooltip-fill.proficient {
  background: linear-gradient(90deg, #58a6ff, #79c0ff);
}

.tooltip-fill.learning {
  background: linear-gradient(90deg, #d29922, #e3b341);
}

.tooltip-fill.beginner {
  background: linear-gradient(90deg, #f85149, #ff7b72);
}

.tooltip-pct {
  font-size: 10px;
  color: var(--text-primary);
  text-align: right;
}

.tooltip-more {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 4px;
}

.tooltip-loading,
.tooltip-empty,
.tooltip-error {
  text-align: center;
  padding: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.tooltip-hint {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
}

.tooltip-error {
  color: var(--error);
}

/* Make board rows hoverable */
.board-row[data-email]:not(.header-row) {
  cursor: pointer;
  transition: background 0.2s ease;
}

.board-row[data-email]:not(.header-row):hover {
  background: rgba(88, 166, 255, 0.1);
}

/* =============================================
   COMPACT STATS ROW (No scroll)
   ============================================= */

.stats-row-compact {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-console);
  border-top: 1px solid var(--border-color);
}

.stats-section-mini {
  flex: 1;
}

.section-header-mini {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.stats-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-item {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
}

.stat-item strong {
  color: var(--text-primary);
}

.stat-item strong.accent { color: var(--accent); }
.stat-item strong.gold { color: #ffd700; }
.stat-item strong.fire { color: #f85149; }

/* Make page modals fit without scroll */
.page-modal-body {
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.stats-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.stats-dual-boards {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.board-table {
  overflow: hidden;
}

/* Compact modal for better fit */
.page-modal.compact .page-modal-content {
  max-width: 95vw;
  max-height: 90vh;
}

/* =============================================
   NEWS POPUP
   ============================================= */

.news-item {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.news-item:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: var(--accent-border);
  transform: translateX(3px);
}

.news-item:hover .news-read-more {
  color: var(--accent);
  opacity: 1;
}

.news-text-preview {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.news-read-more::after {
  content: '→';
  transition: transform 0.2s ease;
}

.news-item:hover .news-read-more::after {
  transform: translateX(3px);
}

.news-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  padding: 20px;
}

.news-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-width: 600px;
  max-height: 80vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-console);
  border-bottom: 1px solid var(--border-color);
}

.news-popup-source {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.news-popup-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.news-popup-close:hover {
  color: var(--error);
}

.news-popup-content {
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  overflow-y: auto;
  flex: 1;
  max-height: 60vh;
}

.news-popup-content a {
  color: var(--accent);
  margin-left: 4px;
}

.news-popup-content a:hover {
  text-decoration: underline;
}

.news-popup-time {
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-console);
}

/* =============================================
   STATS TABS & PROGRESS PAGE
   ============================================= */
.stats-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.stats-tab {
  background: transparent;
  border: none;
  padding: 12px 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.stats-tab:hover {
  color: var(--text-secondary);
}

.stats-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.stats-tab-panel {
  display: none;
}

.stats-tab-panel.active {
  display: block;
}

/* Progress Login Prompt */
.progress-login-prompt {
  text-align: center;
  padding: 60px 40px;
  max-width: 400px;
  margin: 0 auto;
}

.progress-login-prompt .prompt-icon {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.progress-login-prompt h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.progress-login-prompt p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.prompt-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.prompt-btn {
  padding: 10px 24px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.prompt-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.prompt-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.prompt-btn.primary:hover {
  background: var(--accent-hover);
}

/* Progress Section */
.progress-section {
  margin-bottom: 24px;
}

.section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.progress-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
}

.progress-stat-box .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.progress-stat-box.nightmare .stat-value {
  color: #f85149;
}

.progress-stat-box.survival .stat-value {
  color: var(--accent);
}

.progress-stat-box .stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.progress-stat-box .stat-meta {
  font-size: 10px;
  color: var(--text-muted);
}

/* Knowledge Bars */
.knowledge-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.knowledge-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px 50px;
  gap: 12px;
  align-items: center;
}

.bar-category {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: var(--bg-console);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bar-fill.expert { background: var(--accent); }
.bar-fill.proficient { background: #56d364; }
.bar-fill.learning { background: var(--warning); }
.bar-fill.beginner { background: var(--text-muted); }

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.bar-meta {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

.knowledge-summary {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.no-data-message {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

/* =============================================
   QUIZ USER SUMMARY
   ============================================= */
.quiz-user-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.summary-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.summary-actions {
  display: flex;
  gap: 12px;
}

.summary-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
}

.summary-link:hover {
  color: var(--text-primary);
}

.summary-stats {
  display: flex;
  gap: 24px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.summary-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Quiz User Bar */
.quiz-user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.quiz-user-status {
  font-size: 12px;
  color: var(--text-muted);
}

.quiz-user-status a {
  color: var(--accent);
  text-decoration: none;
}

.quiz-user-status a:hover {
  text-decoration: underline;
}

.quiz-stats-link {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
}

.quiz-stats-link:hover {
  color: var(--accent);
}

.quiz-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.quiz-footer-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
}

/* Mode prompt boxes */
.nightmare-title {
  font-size: 16px;
  font-weight: 600;
  color: #f85149;
  margin-bottom: 12px;
}

.nightmare-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.survival-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.survival-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.survival-prompt-box {
  border-color: #238636 !important;
  background: linear-gradient(180deg, rgba(35,134,54,0.08) 0%, transparent 100%) !important;
}

.text-success { color: var(--accent); }
.text-danger { color: #f85149; }
.text-warning { color: var(--warning); }

.mode-user-badge {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  text-align: center;
  color: var(--accent);
}

.mode-user-badge.survival {
  background: rgba(35,134,54,0.15);
  border-color: #238636;
  color: var(--accent);
}

.mode-login-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.mode-login-hint a {
  color: var(--accent);
  text-decoration: none;
}

.mode-login-hint a:hover {
  text-decoration: underline;
}

.mode-buttons {
  display: flex;
  gap: 10px;
}

.survival-start-btn {
  flex: 1;
  background: #238636;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.survival-start-btn:hover {
  background: #2ea043;
}

.resume-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 8px;
}

.resume-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11px;
  transition: all 0.15s;
}

.resume-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Form inputs in prompts */
.nightmare-prompt-box .form-input {
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .progress-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .knowledge-bar-row {
    grid-template-columns: 100px 1fr 40px 40px;
    gap: 8px;
  }
  
  .summary-stats {
    gap: 16px;
  }
}

/* Section subtitle */
.section-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 24px 0 12px;
}

/* Clean up global stat cards */
.global-stat-card {
  text-align: center;
}
