:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-soft: #0b1020;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.34);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 22, 0.76);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand > span:not(.brand-logo),
.brand > div,
.brand-text {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 1 0% !important;
}

.brand-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 900;
  letter-spacing: 0;
  white-space: normal !important;
  word-break: break-word !important;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: normal !important;
  word-break: break-word !important;
}

.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px);
  flex: 1;
}

.grid {
  display: grid;
  gap: 22px;
  align-content: start;
}

.portal-grid {
  width: min(100%, 1060px);
  grid-template-columns: repeat(2, minmax(300px, 500px));
  justify-content: center;
  align-items: stretch;
  margin: 0 auto;
}

.panel,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  border-radius: 24px;
  padding: clamp(16px, 2.2vw, 28px);
}

.card {
  border-radius: 22px;
  padding: 28px;
}

.portal-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.portal-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.65);
  background: rgba(15, 23, 42, 0.94);
}

.portal-icon,
.metric-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--cyan);
  font-size: 36px;
  font-weight: 900;
}

.portal-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-card h2,
.panel h2,
.panel h3 {
  margin: 0;
}

.portal-card p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.button-row,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  flex-shrink: 0 !important;
}

.btn {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  font-weight: 900;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: rgba(30, 41, 59, 0.95);
}

.admin-shortcut {
  min-width: 118px;
  text-align: center;
}

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

.btn.primary {
  border-color: rgba(59, 130, 246, 0.68);
  background: linear-gradient(135deg, #2563eb, #0891b2);
}

.btn.success {
  border-color: rgba(16, 185, 129, 0.72);
  background: linear-gradient(135deg, #059669, #10b981);
}

.btn.danger {
  border-color: rgba(239, 68, 68, 0.64);
  background: rgba(127, 29, 29, 0.72);
}

.btn.warning {
  border-color: rgba(245, 158, 11, 0.64);
  background: rgba(217, 119, 6, 0.72);
  color: #fff;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
}

.btn.big {
  min-height: 72px;
  padding: 18px 28px;
  border-radius: 20px;
  font-size: clamp(18px, 2vw, 28px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--text);
  outline: none;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.selector-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.select-page {
  gap: clamp(20px, 3vw, 34px) !important;
}

.select-group {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(16px, 2.2vw, 28px);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 34%),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.select-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 900;
  line-height: 1;
}

.select-group h3::before {
  content: "";
  width: 12px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.36);
}

.choice-card {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(10, 16, 32, 0.64);
  color: var(--text);
  text-align: left !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.choice-card.selected,
.choice-card:hover {
  border-color: rgba(34, 211, 238, 0.78);
  background: rgba(14, 116, 144, 0.2);
}

.choice-card strong {
  display: block;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  text-align: left !important;
}

.choice-card span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  max-width: 100%;
  text-align: left !important;
}

.hidden {
  display: none !important;
}

.status {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
}

.status.error {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.28);
}

.status.success {
  border-color: rgba(16, 185, 129, 0.5);
  color: #bbf7d0;
  background: rgba(6, 78, 59, 0.28);
}

.header-with-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.unit-card-wrapper {
  display: flex !important;
  gap: 12px;
  align-items: stretch;
  min-height: 110px;
}

.unit-card-wrapper > .choice-card {
  flex: 1;
  min-width: 0;
}

.unit-card-actions {
  display: none !important;
}

.bottom-mobile-actions {
  display: flex;
}

.mac-hidden {
  display: none !important;
}

@media (min-width: 900px) {
  .header-with-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .unit-card-actions {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 154px;
  }
  .unit-card-actions .btn {
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
    padding: 12px;
    font-size: 15px;
    border-radius: 16px;
  }
  .bottom-mobile-actions {
    display: none !important;
  }
  .mac-cols-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
  }
  .mac-cols-container .select-group {
    display: flex;
    flex-direction: column;
  }
  .mac-cols-container .selector-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    align-content: start;
    padding-right: 6px;
  }
  /* Webkit scrollbar for mac-cols */
  .mac-cols-container .selector-grid::-webkit-scrollbar {
    width: 6px;
  }
  .mac-cols-container .selector-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
  }
  .mac-cols-container .selector-grid::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
  }
  .mac-cols-container .selector-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
  }
  
  /* Show but disable empty columns to complete the 3-column look */
  .mac-hidden {
    display: flex !important;
    opacity: 0.2;
    pointer-events: none;
  }
  .mac-hidden .selector-grid, .mac-hidden .status {
    display: none;
  }
}

/* Fallback for smaller screens */
.mac-cols-container {
  display: grid;
  gap: 22px;
}

.orientation-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 20px 18px;
  padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(5, 8, 22, 0.9);
  backdrop-filter: blur(18px);
}

.orientation-dialog {
  width: min(620px, 100%);
  display: grid;
  gap: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 38px);
  background:
    radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.14), transparent 18rem),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.orientation-dialog h2 {
  margin: 0;
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1;
}

.orientation-dialog p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 4.4vw, 24px);
  line-height: 1.45;
}

.orientation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rotate-phone-icon {
  width: min(220px, 52vw);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  color: var(--cyan);
}

.rotate-phone-icon::before,
.rotate-phone-icon::after {
  content: "";
  position: absolute;
}

.rotate-phone-icon {
  position: relative;
}

.rotate-phone-icon span {
  width: 38%;
  height: 64%;
  display: block;
  border: 12px solid currentColor;
  border-radius: 28px;
  transform: rotate(90deg);
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.2);
}

.rotate-phone-icon::before,
.rotate-phone-icon::after {
  width: 34%;
  height: 34%;
  border: 10px solid currentColor;
  opacity: 0.5;
}

.rotate-phone-icon::before {
  left: 3%;
  bottom: 18%;
  border-top: 0;
  border-right: 0;
  border-bottom-left-radius: 64px;
}

.rotate-phone-icon::after {
  right: 3%;
  top: 18%;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 64px;
}

.game-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.timer-track {
  height: 12px;
  background: rgba(15, 23, 42, 0.92);
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
  transition: width 0.25s linear, background 0.25s ease;
}

.timer-bar.warning {
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.score-board {
  display: grid;
  grid-template-columns: minmax(190px, 300px) 1fr minmax(190px, 300px);
  gap: 18px;
  align-items: center;
  padding: clamp(14px, 2.2vw, 28px);
  min-height: 0;
}

.team-panel {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.team-name {
  color: var(--cyan);
  font-size: clamp(20px, 2vw, 32px);
  font-weight: 900;
  text-transform: uppercase;
}

.score {
  font-size: clamp(72px, 8vw, 150px);
  line-height: 0.9;
  font-weight: 950;
}

.quiz-card {
  min-height: min(440px, 52dvh);
  min-width: 0;
  display: grid;
  align-items: center;
  text-align: center;
  border-radius: 34px;
  padding: clamp(22px, 4vw, 56px);
  overflow: hidden;
}

.quiz-card > div {
  min-width: 0;
  max-width: 100%;
}

.quiz-card .label {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.question-text {
  margin: 18px 0;
  max-width: 100%;
  font-size: clamp(32px, 4.2vw, 64px);
  line-height: 1.1;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.answer-text {
  margin: 18px 0;
  max-width: 100%;
  color: #bbf7d0;
  font-size: clamp(36px, 4.6vw, 70px);
  line-height: 1.05;
  font-weight: 950;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.game-footer {
  min-height: 88px;
  padding: 10px clamp(18px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 22, 0.82);
}

.study-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.study-card {
  width: min(560px, 100%);
  min-height: min(620px, 66dvh);
  margin: 0 auto;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 32px;
  padding: clamp(28px, 8vw, 58px);
}

.study-card > div {
  min-width: 0;
  max-width: 100%;
}

.study-question {
  font-size: clamp(26px, 8vw, 46px);
  line-height: 1.14;
  font-weight: 900;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.study-answer {
  color: #bbf7d0;
  font-size: clamp(30px, 9vw, 54px);
  line-height: 1.08;
  font-weight: 950;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.admin-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(5, 8, 22, 0.82);
  padding: 28px;
}

.admin-main {
  padding: clamp(18px, 3vw, 36px);
  align-content: start;
}

.admin-grid {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: start;
}

.admin-main h2 {
  line-height: 1.05;
}

.archive-grid {
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  align-items: start;
}

.archive-unit-list,
.archive-card-list,
.archive-new-card {
  display: grid;
  gap: 12px;
}

.archive-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.archive-unit-main {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(10, 16, 32, 0.64);
  color: var(--text);
  text-align: left;
}

.archive-unit.selected .archive-unit-main,
.archive-unit-main:hover {
  border-color: rgba(34, 211, 238, 0.78);
  background: rgba(14, 116, 144, 0.2);
}

.archive-unit-main strong,
.archive-unit-main span {
  display: block;
}

.archive-unit-main strong {
  font-size: 18px;
  line-height: 1.2;
}

.archive-unit-main span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.archive-detail h3,
.archive-new-card h4 {
  margin: 0;
}

.archive-new-card {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(10, 16, 32, 0.46);
}

.archive-card-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(10, 16, 32, 0.52);
}

.archive-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.board-select {
  gap: clamp(20px, 3vw, 34px) !important;
}

.board-select h2 {
  line-height: 1.04;
}

.board-select .intro-panel p {
  margin-bottom: 0;
}

.table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-panel {
  width: min(460px, calc(100% - 32px));
  margin: 10dvh auto;
}

@media (max-width: 1100px) {
  .portal-grid,
  .score-board,
  .admin-layout,
  .admin-grid,
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .score-board {
    align-items: stretch;
  }

  .team-panel {
    min-height: auto;
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .game-layout {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: 100dvh;
    overflow: hidden;
  }

  .game-layout .topbar {
    min-height: 46px;
    padding: 6px 14px;
  }

  .game-layout .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .game-layout .brand-logo img {
    width: 24px;
    height: 24px;
  }

  .game-layout .brand-title {
    font-size: clamp(18px, 3vw, 28px);
  }

  .game-layout .brand-subtitle {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .timer-track {
    height: 8px;
  }

  .score-board {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) minmax(120px, 170px);
    gap: 10px;
    align-items: stretch;
    padding: 10px 12px;
    min-height: 0;
  }

  .team-panel {
    min-height: 0;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    padding: 12px;
  }

  .team-name {
    font-size: clamp(14px, 2.2vw, 22px);
  }

  .score {
    font-size: clamp(48px, 9vw, 96px);
  }

  .team-panel .button-row {
    display: grid;
    grid-template-columns: 0.75fr 1fr;
    gap: 8px;
  }

  .team-panel .btn {
    min-height: 40px;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: clamp(14px, 2.4vw, 20px);
  }

  .team-panel .btn.big {
    min-height: 50px;
    font-size: clamp(18px, 3vw, 26px);
  }

  .quiz-card {
    min-height: 0;
    height: 100%;
    border-radius: 22px;
    padding: 18px;
  }

  .quiz-card .label {
    font-size: 11px;
  }

  .question-text {
    margin: 10px 0;
    max-height: 42dvh;
    overflow: auto;
    font-size: clamp(22px, 4vw, 40px);
    line-height: 1.08;
  }

  .answer-text {
    margin: 10px 0;
    max-height: 42dvh;
    overflow: auto;
    font-size: clamp(24px, 4.4vw, 44px);
    line-height: 1.06;
  }

  .quiz-card .status,
  .quiz-card .muted {
    margin: 8px 0 0;
    font-size: clamp(12px, 1.8vw, 15px);
    line-height: 1.25;
  }

  .game-footer {
    min-height: 58px;
    padding: 6px 12px;
  }

  .game-footer .btn {
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 12px;
  }

  .game-footer .btn.big {
    min-height: 46px;
    font-size: clamp(16px, 2.4vw, 22px);
  }
}

@media (max-width: 900px) {
  .topbar,
  .game-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row {
    width: 100%;
  }

  .button-row .btn {
    flex: 1;
  }

  .page {
    padding: 16px;
  }

  .card,
  .panel {
    border-radius: 18px;
    padding: 18px;
  }

  .study-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .study-shell.study-scroll-mode {
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .study-shell .topbar {
    min-height: 58px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .study-shell .topbar .button-row {
    display: flex;
    width: 100%;
  }

  .study-shell .brand {
    gap: 12px;
  }

  .study-shell .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .study-shell .brand-logo img {
    width: 30px;
    height: 30px;
  }

  .study-shell .brand-title {
    font-size: clamp(20px, 6vw, 30px);
    line-height: 1.1;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .study-shell .brand-subtitle {
    max-width: 100%;
    font-size: 10px;
    letter-spacing: 0.08em;
    white-space: normal !important;
    word-break: break-word !important;
    margin-top: 4px;
  }

  .study-shell .page {
    min-height: 0;
    padding: 10px 12px;
    display: grid !important;
    place-items: stretch !important;
  }

  .study-shell.study-scroll-mode .page {
    min-height: auto;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .select-page {
    gap: 18px !important;
  }

  .select-group {
    gap: 12px;
    border-radius: 20px;
    padding: 16px;
  }

  .select-group h3 {
    font-size: clamp(28px, 7vw, 40px);
    padding-bottom: 10px;
  }

  .select-group h3::before {
    width: 9px;
    height: 28px;
  }

  .select-group .selector-grid {
    gap: 12px;
  }

  .select-group .choice-card {
    min-height: 82px;
    border-radius: 18px;
    padding: 14px 16px;
  }

  .study-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    border-radius: 22px;
    padding: 18px;
  }

  .study-question {
    font-size: clamp(23px, 7vw, 36px);
  }

  .study-answer {
    font-size: clamp(30px, 10vw, 48px);
  }

  .study-card .muted {
    font-size: clamp(15px, 4.5vw, 22px);
    line-height: 1.35;
  }

  .study-shell .game-footer {
    min-height: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .study-shell .game-footer .button-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  .study-shell .btn {
    min-height: 44px;
    border-radius: 14px;
    padding: 9px 12px;
    font-size: 16px;
  }

  .study-shell .btn.big {
    min-height: 56px;
    border-radius: 18px;
    font-size: clamp(18px, 5.5vw, 24px);
  }
}

@media (max-width: 900px) and (max-height: 740px) {
  .study-shell .topbar {
    min-height: 50px;
    padding: 6px 10px;
  }

  .study-shell .brand-logo {
    width: 36px;
    height: 36px;
  }

  .study-shell .brand-logo img {
    width: 26px;
    height: 26px;
  }

  .study-shell .brand-title {
    font-size: clamp(18px, 5.3vw, 25px);
    white-space: normal !important;
    word-break: break-word !important;
  }

  .study-shell .brand-subtitle {
    font-size: 9px;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .study-shell .page {
    padding: 7px 10px;
  }

  .study-card {
    border-radius: 18px;
    padding: 12px;
  }

  .study-question {
    font-size: clamp(20px, 6.5vw, 32px);
  }

  .study-answer {
    font-size: clamp(28px, 9vw, 42px);
  }

  .study-card .muted {
    font-size: clamp(13px, 4vw, 18px);
  }

  .study-shell .game-footer {
    padding-top: 6px;
    gap: 6px;
  }

  .study-shell .btn.big {
    min-height: 48px;
  }

  .select-group .choice-card {
    min-height: 72px;
    padding: 12px 14px;
  }
  
  /* Yeni Kart Ekle Bölümünü Belirginleştirme */
#archiveUnitCards {
  background: rgba(59, 130, 246, 0.08) !important;
  border: 1px solid var(--blue) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

/* Kart Listesi Zebra Görünümü */
.archive-cards-list .card {
  margin-bottom: 12px !important;
  border-radius: 10px;
  border-left: 4px solid transparent;
}

/* Çift sıradaki kartlar (Koyu) */
.archive-cards-list .card:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
}

/* Tek sıradaki kartlar (Biraz daha açık) */
.archive-cards-list .card:nth-child(odd) {
  background: rgba(148, 163, 184, 0.08);
}

/* Fareyle üzerine gelince vurgu yap */
.archive-cards-list .card:hover {
  border-left-color: var(--blue);
  background: rgba(59, 130, 246, 0.05);
}
}
