/* Übergreifende Design- und Responsiveness-Überarbeitung */
:root {
  --paper: #f2f7f9;
  --line: #dfebef;
  --shadow: 0 18px 50px rgba(25, 53, 76, .07);
}
body {
  background: radial-gradient(ellipse 700px 360px at 85% 100px, #dcefee8a, transparent 72%),
              linear-gradient(180deg, #f7fafc 0%, #eff6f7 100%);
}
.topbar {
  height: auto;
  min-height: 78px;
  padding: 12px max(24px, calc((100vw - 1230px)/2));
  gap: 25px;
  background: linear-gradient(112deg, #09152c 0%, #102943 68%, #0c3543 100%);
  border-bottom: 1px solid #ffffff1a;
  box-shadow: 0 10px 25px #0b213522;
  position: relative;
  z-index: 3;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22c3b190, transparent);
  pointer-events: none;
}
.brand { min-width: 0; flex-shrink: 0; }
.brand-mark {
  flex-shrink: 0;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  box-shadow: 0 4px 17px #05bba43b;
}
.brand-copy strong { font-size: 16px; color: #fff; }
.brand-copy small { font-size: 9px; letter-spacing: 1.35px; }
.topbar-right { min-width: 0; gap: 9px; margin-left: auto; }
.topbar-right > .mini-pill { background: #ffffff13; border: 1px solid #ffffff1a; white-space: nowrap; }
.topbar-right .live-link,
.topbar-right .account-link,
.topbar-right .owner-login,
.topbar-right .live-back,
.topbar-right .live-badge {
  min-height: 40px;
  border-radius: 12px;
  font-size: 11px;
  padding: 11px 14px;
  white-space: nowrap;
  line-height: 1.2;
  transition: background .16s, transform .16s, box-shadow .16s;
}
.topbar-right .live-link { background: #e6f9f5; color: #065d55; }
.topbar-right .account-link { border-color: #45687b; background: #ffffff0d; color: #e3f5f5; }
.topbar-right .owner-login { color: #052a30; background: #4bdfc3; border-color: #4bdfc3; }
.topbar-right .live-link:hover,
.topbar-right .account-link:hover,
.topbar-right .owner-login:hover { transform: translateY(-2px); box-shadow: 0 7px 19px #00000016; }
.topbar-right .account-link { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.hero { padding-top: 52px; }
.hero h1 { text-wrap: balance; }
.hero h1 em { color: #0ba99e; }
.panel { border-color: #deebed; box-shadow: var(--shadow); }
.settings-panel { background: linear-gradient(180deg, #ffffff 0%, #fff 76%, #fafdfe 100%); }
.side-quote { background: linear-gradient(145deg, #122a44, #0c5763); }
.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-card {
  min-width: 0;
  min-height: 153px;
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #fcfefe);
  box-shadow: 0 5px 20px #1c526009;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px #163e5117; }
.mode-card.is-selected { background: linear-gradient(150deg, #e9fbf5, #eff9ff); }
.mode-card .mode-icon { font-size: 26px; }
.mode-card strong { line-height: 1.35; }
.weak-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  border-radius: 8px;
  background: #fcefe4;
  color: #ba642e;
  font-size: 11px;
}
.subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.subject-grid .all-subjects { grid-column: 1 / -1; }
.subject-card {
  min-height: 98px;
  position: relative;
  padding: 17px;
  border-radius: 17px;
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 12px;
  align-content: center;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: 0 9px 22px #163e5112; }
.subject-card > span:first-child {
  grid-row: 1 / 3;
  width: 37px;
  height: 37px;
  border-radius: 12px;
  background: #eef7f8;
  display: grid;
  place-items: center;
  font-size: 21px;
}
.subject-card strong { align-self: end; font-size: 14px; line-height: 1.3; padding-right: 17px; }
.subject-card small { align-self: start; font-size: 10px; }
.subject-card.is-active { background: #e9f8f5; border-color: #1eb5a8; box-shadow: inset 0 0 0 1px #1eb5a8; }
.subject-card.is-active::after {
  content: '✓'; position: absolute; right: 10px; top: 10px;
  background: #0ba99c; color: white; width: 19px; height: 19px;
  display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 900;
}
.subject-card.all-subjects > span:first-child { background: #e9ebff; color: #5550b6; font-size: 25px; }
.subject-card.all-subjects.is-active { background: linear-gradient(130deg, #eafaf5, #edf1ff); }
.topic-chip { transition: transform .16s, border-color .16s, background .16s; }
.topic-chip:hover { transform: translateY(-1px); }
.primary-button { background: linear-gradient(130deg, #0ca79c, #0d8997); }
.primary-button:hover:not(:disabled) { background: linear-gradient(130deg, #07877f, #0c7d8c); }
.question-panel { box-shadow: 0 23px 60px #17395512; }
.question-meta { flex-wrap: wrap; }
.topic-tag { max-width: 100%; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; padding: 16px 24px; row-gap: 14px; }
  .topbar-right { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .brand-copy strong { font-size: 16px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-mode { grid-column: 1 / -1; min-height: 110px; }
}
@media (max-width: 680px) {
  .topbar { height: auto; min-height: 0; padding: 15px 17px; row-gap: 15px; }
  .brand { gap: 11px; }
  .brand-copy strong { font-size: 15px; overflow-wrap: anywhere; }
  .brand-copy small { font-size: 8px; }
  .topbar-right { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .topbar-right > .mini-pill { display: none; }
  .topbar-right > .owner-login { grid-column: 1 / -1; }
  .topbar-right > .live-link,
  .topbar-right > .account-link,
  .topbar-right > .owner-login,
  .topbar-right > .live-back,
  .topbar-right > .live-badge { width: 100%; max-width: none; text-align: center; justify-content: center; white-space: normal; min-width: 0; }
  .mode-grid { grid-template-columns: 1fr; gap: 9px; }
  .mode-card, .review-mode { grid-column: auto; min-height: 107px; padding: 13px 15px; }
  .subject-card { padding: 13px 10px; min-height: 108px; gap: 6px; grid-template-columns: 31px minmax(0, 1fr); }
  .subject-card > span:first-child { width: 31px; height: 31px; font-size: 17px; border-radius: 10px; }
  .subject-card strong { font-size: 12px; }
  .subject-card small { font-size: 9px; line-height: 1.35; }
  .subject-card.is-active::after { top: 7px; right: 7px; }
  .hero { padding-top: 31px; }
}
