/* Question selector — aligned with MITA landing theme */
* {
  font-family: var(--font-serif);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  padding: 6px 0;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

.app-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.app-nav a:hover {
  background: var(--panel-bg);
  border-color: rgba(255, 255, 255, 0.16);
}

.app-nav a:active {
  transform: scale(0.98);
}

.nav-ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-ic svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selector-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h1 {
  margin: 0 0 8px 0;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-intro .lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 42rem;
}

.pool-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: clamp(20px, 4vw, 28px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

.panel:focus-within {
  border-color: rgba(255, 255, 255, 0.09);
}

.panel h2 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.hint {
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.82);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  font-family: inherit;
  min-height: 44px;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.chip.active {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.chip:active {
  transform: scale(0.97);
}

.elo-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.elo-preset-btn {
  background: var(--panel-bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.35;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  font-family: inherit;
  font-weight: 500;
  text-align: center;
  min-height: 48px;
}

.elo-preset-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #222;
}

.elo-preset-btn.active {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 600;
}

.elo-advanced {
  margin-top: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.elo-advanced summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  user-select: none;
  transition: background 0.2s ease;
}

.elo-advanced summary::-webkit-details-marker {
  display: none;
}

.elo-advanced summary::after {
  content: "▸";
  float: right;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.elo-advanced[open] summary::after {
  transform: rotate(90deg);
}

.elo-advanced summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.elo-advanced .inner {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-color);
}

.elo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.elo-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.elo-input-group input[type="number"] {
  width: 100px;
  min-height: 44px;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .elo-input-group input[type="number"] {
    font-size: 0.95rem;
  }
}

.elo-input-group input[type="number"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.elo-separator {
  color: var(--muted);
  font-size: 0.88rem;
}

.actions-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 520px) {
  .actions-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .actions-row .btn {
    flex: 1;
    min-width: 160px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  min-height: 48px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn:active {
  transform: scale(0.99);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled:hover {
  background: transparent;
}

.btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.btn-primary:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-panel .window {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: clamp(20px, 4vw, 32px);
  box-sizing: border-box;
  transition: border-color 0.25s ease, border-style 0.25s ease;
}

.preview-panel .window.has-question {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.18);
  min-height: auto;
}

.window .ka {
  font-size: 1.05rem;
  text-align: center;
  color: #fff;
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
}

.window .placeholder-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  max-width: 22rem;
}

.window .placeholder-stack .t1 {
  font-size: 1.05rem;
  opacity: 0.88;
}

.window .placeholder-stack .t2 {
  font-size: 0.9rem;
  opacity: 0.62;
  line-height: 1.5;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.meta-item {
  padding: 14px 16px;
  background: var(--bg-dark);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.meta-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.meta-value {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.mini {
  margin-top: 20px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.mini h3 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.mini sub {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.mini .radar-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.mini svg {
  max-width: 100%;
  height: auto;
}
