/* საქართველოს ქრონიკები — „ექსპედიციის დღიური“ */
:root {
  --bg: #F3EEE2;
  --paper: #FFFDF8;
  --ink: #1E2A2C;
  --muted: #5B6461;
  --line: #DDD4C2;
  --sand: #E7E0CF;
  --teal: #1F6A66;
  --teal-dark: #154A47;
  --teal-soft: #DDEBE7;
  --brick: #B8492F;
  --brick-dark: #8E3822;
  --brick-soft: #F3E3D8;
  --gold: #C99A2E;
  --peach: #E8B98C;
  --night: #1E2A2C;
  --night-2: #2C3A3C;
  --night-3: #3A4749;
  --sea: #E9F0EC;
  --sans: 'Noto Sans Georgian', 'Sylfaen', sans-serif;
  --serif: 'Noto Serif Georgian', 'Sylfaen', serif;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.5; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.3; margin: 0; }
p { margin: 0; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- ღილაკები ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn-teal { background: var(--teal); color: var(--paper); }
.btn-teal:hover { background: var(--teal-dark); color: var(--paper); }
.btn-brick { background: var(--brick); color: var(--paper); }
.btn-brick:hover { background: var(--brick-dark); color: var(--paper); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--sand); color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--brick-dark); border-color: var(--brick); }
.btn-small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--brick-dark); font-size: 20px; cursor: pointer;
}
.link-quiet { color: var(--muted); font-size: 14px; text-decoration: none; }
.link-quiet:hover { color: var(--ink); text-decoration: underline; }

/* ---------- ზედა ზოლი ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px 32px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 21px/1.2 var(--serif); }
.brand:hover { color: var(--ink); }
.topnav { display: flex; gap: 6px; }
.topnav a { padding: 10px 16px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.topnav a:hover { background: var(--bg); color: var(--ink); }
.topnav a.is-active { background: var(--sand); font-weight: 600; }
.me { display: flex; align-items: center; gap: 14px; }
.xp { width: 210px; display: flex; flex-direction: column; gap: 6px; }
.xp-row { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.xp-row span { color: var(--muted); white-space: nowrap; }
.bar { height: 8px; border-radius: 8px; background: var(--sand); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 8px; background: var(--teal); transition: width .4s ease; }
.bar span.is-low { background: var(--brick); }
.bar-night { background: var(--night-3); }
.bar-night span { background: var(--peach); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brick); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ---------- განლაგება ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 28px 32px; max-width: 1500px; margin: 0 auto; }
.layout-mission { grid-template-columns: minmax(0, 1fr) 400px; padding-top: 20px; }
.layout-narrow { max-width: 640px; margin: 40px auto; padding: 0 20px; }
.side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.h3 { font-family: var(--sans); font-size: 17px; font-weight: 700; }
.card > .h3 { margin-bottom: 10px; }
.card-night { background: var(--night); color: var(--paper); border-color: var(--night); }
.card-night h2 { font-size: 23px; font-weight: 800; }
.card-night p { color: #D9D3C4; font-size: 15px; line-height: 1.6; }
.kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--peach); }
.featured { display: flex; flex-direction: column; gap: 12px; }
.mini-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #D9D3C4; }
.mini-progress .bar { flex: 1; height: 6px; }

/* ---------- რუკა ---------- */
.map-card { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.map-head h1 { font-size: 30px; font-weight: 800; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sand); }
.seg button {
  border: 0; cursor: pointer; min-height: 44px; padding: 0 18px; border-radius: 10px;
  font: 600 15px var(--sans); background: transparent; color: var(--ink);
}
.seg button.is-on { background: var(--ink); color: var(--paper); }
.map-wrap { background: #EDE7D8; border-radius: 16px; padding: 8px; }
.map { width: 100%; height: auto; display: block; }
.map .sea { fill: #D3E4E8; }
.map .sea-lbl { font: italic 15px var(--serif); fill: #3F6E7D; pointer-events: none; }
/* ოკუპირებული ტერიტორიები: დაშტრიხვა და წყვეტილი საოკუპაციო ხაზი სტატუსის ფერის თავზე */
.map .occupied { pointer-events: none; }
.map .occupied path { fill: url(#occupied-hatch); stroke: #7A3B2E; stroke-width: 1.4; stroke-dasharray: 5 3; }
.map .hatch-line { stroke: #7A3B2E; stroke-width: 1.3; opacity: .35; }
.map .occupied-lbl {
  font: italic 600 9.5px var(--sans); fill: #7A3B2E; pointer-events: none;
  paint-order: stroke; stroke: rgba(255, 253, 248, .85); stroke-width: 3px; stroke-linejoin: round;
}
.map .outline { fill: none; stroke: #5E5848; stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }
/* რეგიონის ფერი სტატუსით; წარწერები მუქია, რომ ყველა ფონზე იკითხებოდეს */
.region { cursor: pointer; outline: none; }
.region .shape { fill: #E4DDCC; stroke: #A39A85; stroke-width: 1; stroke-linejoin: round; transition: fill .2s; }
.region.is-open .shape { fill: #FFFDF8; }
.region.is-current .shape { fill: #F2C8A8; }
.region.is-done .shape { fill: #9FCBC1; }
.region.is-hover .shape { fill-opacity: .8; }
.region.is-selected .shape, .region.is-focus .shape { stroke: var(--ink); stroke-width: 2.5; }
.region .hit { fill: transparent; }
.region .dot { fill: var(--paper); stroke: var(--teal); stroke-width: 2.5; transition: fill .2s; }
.region .lbl {
  font: 600 12.5px var(--sans); fill: var(--ink); pointer-events: none;
  paint-order: stroke; stroke: rgba(255, 253, 248, .75); stroke-width: 3px; stroke-linejoin: round;
}
.region.is-done .dot { fill: var(--teal); stroke: var(--teal); }
.region.is-done .lbl { fill: var(--teal-dark); }
.region.is-current .dot { fill: var(--brick); stroke: var(--brick); }
.region.is-current .lbl { fill: var(--brick-dark); font-weight: 700; }
.region.is-locked .dot { fill: #CFC8B8; stroke: #A39A85; }
.region.is-locked .lbl { fill: #5F5E57; font-weight: 500; }
.region.is-selected .dot, .region.is-focus .dot { stroke: var(--ink); stroke-width: 3.5; }
.region.is-selected .lbl { font-weight: 800; text-decoration: underline; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-sum { margin-left: auto; color: var(--muted); }
.map-credit { width: 100%; font-size: 11px; color: var(--muted); }
.lg { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid #A39A85; }
.lg-done { background: #9FCBC1; }
.lg-current { background: #F2C8A8; }
.lg-open { background: #FFFDF8; }
.lg-locked { background: #E4DDCC; }
.lg-occupied { background: repeating-linear-gradient(45deg, rgba(122, 59, 46, .45) 0 1.5px, #FFFDF8 1.5px 5px); border: 1.4px dashed #7A3B2E; }
.eras { display: flex; flex-direction: column; gap: 10px; }
.era-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.era {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink); font-family: var(--sans); cursor: pointer; text-align: center;
}
.era strong { font-size: 14px; }
.era small { font-size: 12px; color: var(--muted); }
.era.is-on { background: var(--brick); border-color: var(--brick); color: var(--paper); }
.era.is-on small { color: var(--brick-soft); }

.mission-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mission-list li { display: grid; gap: 4px; padding: 14px; border-radius: var(--r-md); background: var(--bg); }
.mission-list li .btn { justify-self: start; margin-top: 6px; }
.mission-list li.is-done { background: var(--teal-soft); }

.streak { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--brick-dark); font-size: 14px; margin-bottom: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.badge-coin {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--sand); border: 2px dashed #A9A397;
}
.badge-name { font-size: 11px; line-height: 1.3; color: var(--muted); }
.badge.is-on .badge-coin { border: 0; background: var(--teal); }
.badge.is-on .badge-name { color: var(--ink); font-weight: 600; }
.badge-fort .badge-coin, .badge-star .badge-coin { background: var(--brick); }
.badge-map .badge-coin { background: #3F6E7D; }
.badge-compass .badge-coin, .badge-money .badge-coin { background: var(--gold); }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; font-size: 15px; }
.rank li.is-me { background: var(--bg); font-weight: 700; }
.rank-name { flex: 1; }
.place { width: 28px; height: 28px; border-radius: 50%; background: var(--sand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.place-1 { background: var(--gold); }
.place-2 { background: #B7B3A8; }
.place-3 { background: #D2A27A; }

/* ---------- მისია ---------- */
.mission-bar {
  display: flex; align-items: center; gap: 20px; padding: 16px 32px 0; max-width: 1500px; margin: 0 auto;
}
.mission-title { font-size: 22px; font-weight: 800; }
.mission-progress { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 160px; }
.mission-progress .bar { flex: 1; height: 10px; }
.quiz { display: flex; flex-direction: column; gap: 22px; padding: 34px 38px; min-height: 520px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.tag-teal { background: var(--teal-soft); color: var(--teal-dark); }
.tag-brick { background: var(--brick-soft); color: var(--brick-dark); }
.tag-gold { background: #FBF3DE; color: #6B5313; }
.tag-muted { background: var(--sand); color: var(--muted); }
.q-prompt { font-size: 32px; font-weight: 800; line-height: 1.35; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.opt {
  display: flex; align-items: center; gap: 16px; min-height: 80px; padding: 14px 18px;
  border: 2px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink);
  font: 600 19px/1.35 var(--sans); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.opt:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-1px); }
.opt:disabled { cursor: default; }
.opt-letter {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.opt.is-ok { border-color: var(--teal); background: var(--teal-soft); }
.opt.is-ok .opt-letter { background: var(--teal); }
.opt.is-miss { border-color: var(--brick); background: var(--brick-soft); opacity: .85; }
.opt.is-miss .opt-letter { background: var(--brick); }
.feedback { padding: 16px 20px; border-radius: 16px; font-size: 15px; }
.feedback strong { display: block; font-size: 17px; margin-bottom: 2px; }
.feedback-ok { background: var(--teal-soft); color: var(--teal-dark); }
.feedback-miss { background: var(--brick-soft); color: var(--brick-dark); }
.tools { margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.hint { padding: 12px 16px; border-radius: 12px; background: #FBF3DE; color: #5E4A12; font-size: 15px; }
.fact { display: flex; flex-direction: column; gap: 12px; }
.path { margin: 12px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.path li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.path li::before { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #A9A397; flex-shrink: 0; }
.path li.is-ok { color: var(--ink); }
.path li.is-ok::before { background: var(--teal); border-color: var(--teal); }
.path li.is-miss { color: var(--ink); }
.path li.is-miss::before { background: var(--peach); border-color: var(--peach); }
.path li.is-now { color: var(--ink); font-weight: 700; }
.path li.is-now::before { background: var(--brick); border-color: var(--brick); }
.big-stat { font: 800 26px var(--serif); color: var(--teal); margin: 6px 0; }
.summary-head { display: flex; flex-direction: column; gap: 6px; }
.level-up {
  display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 12px 16px; border-radius: 12px;
  background: #FBF3DE; border: 1.5px solid var(--gold); color: #5E4A12;
}
.level-up strong { font: 800 17px var(--serif); color: var(--ink); }
.xp.is-up { animation: xp-up 1.2s ease 2; border-radius: 10px; }
@keyframes xp-up { 50% { box-shadow: 0 0 0 6px rgba(201, 154, 46, .35); } }
.new-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 14px; background: #FBF3DE; }
.review { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.review li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border-left: 0; font-size: 15px; }
.review li.is-ok span { color: var(--teal-dark); }
.review li.is-miss span { color: var(--brick-dark); }

/* ---------- შესვლა ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 16px;
}
.auth-card h1 { font-size: 28px; font-weight: 800; }
.auth-foot { text-align: center; font-size: 14px; }
.code-input { font: 700 26px/1 var(--sans) !important; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.note-warn { padding: 12px 14px; border-radius: 12px; background: var(--brick-soft); color: var(--brick-dark); }

/* ---------- ფორმები ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form input:not([type=radio]), .form select, .form textarea {
  font: 400 16px var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid #C9BFA9; border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid var(--teal-soft); border-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.span-2 { grid-column: 1 / -1; }
.form-tight { gap: 10px; margin-top: 12px; }
.opt-edit { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; }
.form label.radio { flex-direction: row; align-items: center; gap: 6px; min-height: 46px; font-weight: 500; }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 16px; }
.flash-ok { background: var(--teal-soft); color: var(--teal-dark); }
.flash-err { background: var(--brick-soft); color: var(--brick-dark); }

/* ---------- მასწავლებელი ---------- */
.t-shell { display: flex; min-height: 100vh; }
.t-nav {
  width: 250px; flex-shrink: 0; background: var(--night); color: var(--paper);
  padding: 26px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.t-brand { font: 800 18px var(--serif); padding: 0 10px 20px; }
.t-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #D9D3C4; text-decoration: none; }
.t-nav a:hover { background: var(--night-2); color: var(--paper); }
.t-nav a.is-active { background: var(--night-2); color: var(--paper); font-weight: 600; }
.t-nav a.t-cta { margin-top: auto; justify-content: center; background: var(--brick); color: var(--paper); font-weight: 700; }
.t-nav a.t-out { justify-content: center; font-size: 13px; }
.t-class { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 14px; font-size: 13px; color: #D9D3C4; }
.t-class select { min-height: 40px; border-radius: 8px; border: 0; padding: 0 8px; font: 500 14px var(--sans); }
.t-main { flex: 1; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.t-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t-head h1 { font-size: 28px; font-weight: 800; }
.t-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; }
.stat span { font-size: 14px; color: var(--muted); }
.stat strong { font-size: 30px; font-weight: 800; }
.t-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.t-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid #EEE7D8; vertical-align: middle; }
.table tr.is-muted td { color: var(--muted); }
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
#import .row-actions { justify-content: flex-start; flex-wrap: wrap; }
.import-errors { font-weight: 500; }
.import-errors ul { margin: 6px 0 0; padding-left: 20px; }
.import-errors li { margin: 2px 0; }
.meter { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.assign-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EEE7D8; }
.assign-row div { display: grid; }
.assign-row form { margin: 0; }
.q-admin { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.q-admin li { padding: 10px 0; border-bottom: 1px solid #EEE7D8; }
.q-admin li > div:first-child { display: grid; gap: 2px; margin-bottom: 6px; }
.q-admin .row-actions { justify-content: flex-start; }
.code { font: 700 17px var(--sans); letter-spacing: .1em; background: var(--bg); padding: 4px 10px; border-radius: 8px; }
.empty { max-width: 560px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.danger { display: flex; }
.danger form { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pick {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none;
}
.pick:hover { border-color: var(--teal); color: var(--ink); }
.pick strong { font: 800 19px var(--serif); }
.pick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.pick-actions form { margin: 0; }
.print-cards { display: none; }

/* ---------- კლასის რეჟიმი ---------- */
.classroom { background: var(--night); color: var(--paper); }
.cr { min-height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 28px 40px; }
.cr-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cr-left, .cr-right { display: flex; align-items: center; gap: 14px; }
.cr-exit { width: 44px; height: 44px; border-radius: 12px; background: var(--night-2); color: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 24px; text-decoration: none; }
.cr-exit:hover { color: var(--peach); }
.cr-badge { padding: 8px 14px; border-radius: 10px; background: var(--brick); font-weight: 700; }
.cr-sub { color: #D9D3C4; font-size: 16px; }
.cr-round { font-size: 20px; font-weight: 700; color: #D9D3C4; }
.cr-ghost { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--night-3); background: transparent; color: #D9D3C4; font: 500 14px var(--sans); cursor: pointer; }
.cr-timer { min-width: 130px; text-align: center; padding: 8px 18px; border-radius: 14px; background: var(--night-2); font: 800 36px var(--sans); color: var(--peach); font-variant-numeric: tabular-nums; }
.cr-timer.is-low { color: #FF9C84; }
#cr-stage { flex: 1; display: flex; flex-direction: column; gap: 26px; justify-content: center; }
.cr-q { text-align: center; font: 800 clamp(30px, 3.6vw, 54px)/1.3 var(--serif); max-width: 1200px; margin: 0 auto; }
.cr-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cr-opt { display: flex; align-items: center; gap: 22px; min-height: 110px; padding: 14px 28px; border-radius: 20px; transition: opacity .3s, transform .3s; }
.cr-opt.is-dim { opacity: .28; }
.cr-opt.is-right { transform: scale(1.02); box-shadow: 0 0 0 4px var(--paper); }
.cr-letter { width: 64px; height: 64px; flex-shrink: 0; border-radius: 16px; background: rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; }
.cr-label { font-size: clamp(22px, 2.4vw, 36px); font-weight: 800; }
.cr-expl { text-align: center; font-size: 20px; color: #D9D3C4; max-width: 1000px; margin: 0 auto; }
.cr-bottom { display: flex; gap: 24px; align-items: flex-end; }
.cr-teams { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cr-team { padding: 14px 16px; border-radius: 16px; background: var(--night-2); display: flex; flex-direction: column; gap: 8px; }
.cr-team-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cr-team-row input { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed var(--night-3); color: var(--paper); font: 700 17px var(--sans); padding: 2px 0; }
.cr-team-row strong { font-size: 22px; color: var(--peach); }
.cr-bar { height: 10px; border-radius: 10px; background: var(--night-3); overflow: hidden; }
.cr-bar span { display: block; height: 100%; background: var(--peach); border-radius: 10px; transition: width .4s; }
.cr-team-btns { display: flex; gap: 8px; }
.cr-plus, .cr-minus { min-height: 40px; border-radius: 10px; border: 0; cursor: pointer; font: 700 15px var(--sans); }
.cr-plus { flex: 1; background: var(--teal); color: var(--paper); }
.cr-minus { width: 44px; background: var(--night-3); color: var(--paper); }
.cr-main { min-height: 64px; padding: 0 30px; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink); font: 800 19px var(--sans); cursor: pointer; }
.cr-podium { list-style: none; margin: 0 auto; padding: 0; width: min(640px, 100%); display: flex; flex-direction: column; gap: 12px; counter-reset: p; }
.cr-podium li { display: flex; justify-content: space-between; padding: 18px 24px; border-radius: 16px; background: var(--night-2); font-size: 26px; font-weight: 700; }
.cr-podium li:first-child { background: var(--gold); color: var(--ink); }
.cr-podium li strong { font-weight: 800; }
/* ახალი კითხვის ტიპები პროექტორზე */
.cr-order { grid-template-columns: minmax(0, 1fr); max-width: 1000px; margin: 0 auto; width: 100%; gap: 12px; }
.cr-order .cr-opt { min-height: 76px; }
.cr-map { display: block; max-width: 1100px; margin: 0 auto; width: 100%; background: #EDE7D8; border-radius: 20px; padding: 10px; }
.cr-map .map { width: 100%; height: auto; max-height: 52vh; }
.cr-map .mq-region { fill: #FFFDF8; stroke: #A39A85; stroke-width: 1; }
.cr-map .mq-region.is-ok { fill: #9FCBC1; stroke: var(--teal-dark); stroke-width: 2.5; }
.cr-map .mq-label { font: 800 22px var(--sans); fill: var(--ink); paint-order: stroke; stroke: rgba(255, 253, 248, .9); stroke-width: 5px; }

.cr-num { display: flex; justify-content: center; }
.cr-num-box {
  min-width: 260px; padding: 24px 48px; border-radius: var(--r-lg); border: 3px dashed var(--night-3);
  text-align: center; font: 800 clamp(48px, 8vw, 96px)/1.1 var(--serif); color: var(--peach);
}
.cr-num-box.is-right { border: 3px solid var(--teal); background: var(--teal); color: var(--paper); }

/* ჯვარედინი კლასის რეჟიმში (პროექტორი) */
.cr-cw { gap: 18px; height: 100vh; min-height: 0; }
.cr-timer:empty { visibility: hidden; }
.cr-cw .cr-round { color: var(--team, #D9D3C4); font-size: 24px; }
/* სცენა იღებს დარჩენილ სიმაღლეს; ბადის უჯრის ზომას JS ამ სიმაღლით ითვლის, რომ გუნდები ეკრანზე დარჩეს */
.cw-stage { flex: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 28px; min-height: 0; }
.cw-board { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.cw-grid-cr { background: transparent; border: 0; gap: 3px; }
.cw-grid-cr .cw-cell {
  border: 0; padding: 0; border-radius: 4px; background: var(--paper); color: var(--ink); cursor: pointer;
  font-size: calc(var(--cell) * .52); transition: background .3s;
}
.cw-grid-cr .cw-cell.is-team { color: var(--paper); }
.cw-grid-cr .cw-cell.cw-block { background: transparent; cursor: default; }
.cw-grid-cr .cw-cell.is-team .cw-num { color: rgba(255, 253, 248, .75); }
.cw-grid-cr .cw-cell.is-shown { background: #CFC8B8; }
.cw-grid-cr .cw-cell.is-active-word { background: var(--peach); box-shadow: 0 0 0 3px var(--paper); }
.cw-panel { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.cw-cr-clue { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; border-radius: 20px; background: var(--night-2); }
.cw-cr-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--peach); font-size: 18px; font-weight: 700; }
.cw-cr-text { font: 800 clamp(24px, 2.4vw, 38px)/1.3 var(--serif); }
.cw-cr-hint { color: #D9D3C4; font-size: 20px; }
.cw-judge { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cw-btn {
  min-height: 56px; padding: 0 14px; border: 1px solid var(--night-3); border-radius: 14px; background: transparent;
  color: var(--paper); font: 700 17px var(--sans); cursor: pointer;
}
.cw-btn:hover:not(:disabled) { background: var(--night-2); }
.cw-btn:disabled { opacity: .35; cursor: default; }
.cw-btn-ok { background: var(--teal); border-color: var(--teal); font-size: 20px; }
.cw-btn-ok:hover:not(:disabled) { background: var(--teal-dark); }
.cw-btn-no { background: var(--brick); border-color: var(--brick); font-size: 20px; }
.cw-btn-no:hover:not(:disabled) { background: var(--brick-dark); }
.cw-cr-lists { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; }
.cw-cr-lists h2 { font: 700 15px var(--sans); color: var(--peach); margin: 8px 0 6px; }
.cw-cr-lists ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cw-cr-item {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-left: 5px solid transparent; border-radius: 10px;
  background: transparent; color: #D9D3C4; text-align: left; font: 400 16px/1.35 var(--sans); cursor: pointer;
}
.cw-cr-item:hover { background: var(--night-2); }
.cw-cr-item.is-active { background: var(--night-2); color: var(--paper); box-shadow: inset 0 0 0 2px var(--peach); }
.cw-cr-item.is-done { opacity: .55; text-decoration: line-through; cursor: default; }
.cr-team.is-turn { box-shadow: 0 0 0 3px var(--team); transform: translateY(-4px); }
.cr-cw.is-finished .cw-judge, .cr-cw.is-finished .cw-cr-lists { display: none; }
.cw-cr-clue { overflow-y: auto; min-height: 0; }
.cw-panel .cr-podium { gap: 8px; }
.cw-panel .cr-podium li { padding: 10px 18px; font-size: 21px; }
.cr-team { transition: transform .2s, box-shadow .2s; }
@media (max-width: 1100px) {
  .cr-cw { height: auto; }
  .cw-stage { grid-template-columns: minmax(0, 1fr); }
  .lv-reveal { grid-template-columns: minmax(0, 1fr); }
  .cw-cr-lists { max-height: 40vh; }
}

/* ---------- ადაპტაცია ---------- */
/* ---------- კლასის რეჟიმი ტელეფონებით: პროექტორი ---------- */
.cr-live .lv-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 24px; min-height: 0; }
.lv-join { text-align: center; display: flex; flex-direction: column; gap: 8px; font-size: 24px; color: #D9D3C4; }
.lv-url { font: 800 clamp(28px, 4vw, 60px)/1.2 var(--sans); color: var(--peach); word-break: break-all; }
.lv-join-note { font-size: 20px; }
.lv-count-title { text-align: center; font: 800 28px var(--serif); }
.lv-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 1200px; margin: 0 auto; }
.lv-chip { padding: 8px 18px; border-radius: 999px; background: var(--night-2); font-size: 20px; font-weight: 600; }
.lv-opts .cr-opt { position: relative; overflow: hidden; }
.lv-count { margin-left: auto; font-size: 26px; font-weight: 800; white-space: nowrap; }
.lv-bar { position: absolute; left: 0; bottom: 0; height: 8px; background: rgba(255, 253, 248, .75); transition: width .5s; }
.lv-reveal { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.lv-side { padding: 18px 20px; border-radius: 20px; background: var(--night-2); }
.lv-side h2 { font: 700 16px var(--sans); color: var(--peach); margin-bottom: 10px; }
.lv-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-board li { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.lv-place { width: 30px; height: 30px; border-radius: 50%; background: var(--night-3); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.lv-board li:first-child .lv-place { background: var(--gold); color: var(--ink); }
.lv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-podium .lv-place { display: none; }
.lv-podium li { align-items: center; }
.lv-bottom { align-items: center; }
.lv-status { flex: 1; font-size: 20px; color: #D9D3C4; }

.lv-order { display: flex; flex-direction: column; gap: 12px; }
.lv-order-sum { text-align: center; font-size: 22px; font-weight: 700; color: var(--peach); margin-top: 8px; }
.lv-wrong-title { font-size: 18px; color: #D9D3C4; text-align: center; }
.lv-wrong { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 900px; width: 100%; }
.lv-wrong li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 14px; border-radius: 10px; background: var(--night-2); font-size: 18px; }
.lv-map-cr .map { max-height: 48vh; }
.cr-map .mq-region.is-picked { fill: var(--brick); }
.cr-map .mq-count { font-size: 26px; }
.cr-map .lv-order-sum { color: var(--teal-dark); }

/* ---------- კლასის რეჟიმი ტელეფონებით: მოსწავლის ტელეფონი ---------- */
.lv-phone { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.lv-phone-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.lv-me { font-weight: 700; }
.lv-phone-timer { height: 10px; border-radius: 10px; background: var(--sand); overflow: hidden; }
.lv-phone-timer span { display: block; height: 100%; background: var(--teal); border-radius: 10px; transition: width .2s linear; }
.lv-phone-timer span.is-low { background: var(--brick); }
.lv-phone-body { display: flex; flex-direction: column; gap: 14px; }
.lv-qnum { color: var(--muted); font-size: 14px; }
.lv-prompt { font: 800 22px/1.35 var(--serif); }
.lv-title { font: 800 26px var(--serif); text-align: center; }
.lv-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lv-choice {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; border: 0; border-radius: 16px;
  color: var(--paper); font: 700 18px/1.3 var(--sans); text-align: left; cursor: pointer; touch-action: manipulation;
  transition: opacity .2s, transform .1s;
}
.lv-choice:active:not(:disabled) { transform: scale(.98); }
.lv-choice:disabled { cursor: default; }
.lv-choice-letter { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: rgba(0, 0, 0, .25); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.lv-choice.is-mine { box-shadow: 0 0 0 4px var(--ink); }
.lv-choice.is-dim { opacity: .35; }
.lv-choice.is-right { opacity: 1; box-shadow: 0 0 0 4px var(--ink); }
.lv-msg { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; font-size: 16px; }
.lv-msg strong { font-size: 18px; }
.lv-msg.is-wait { background: var(--paper); border: 1px solid var(--line); }
.lv-msg.is-ok { background: var(--teal-soft); color: var(--teal-dark); }
.lv-msg.is-miss { background: var(--brick-soft); color: var(--brick-dark); }
.lv-score { text-align: center; font-weight: 700; }
.lv-map-box { display: flex; flex-direction: column; gap: 12px; }
.map-q .mq-region.is-sel { fill: #F2C8A8; stroke: var(--ink); stroke-width: 2.5; }
.lv-final { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; border-radius: 20px; background: var(--night); color: var(--paper); }
.lv-final strong { font: 800 48px var(--serif); color: var(--peach); }
@media (min-width: 520px) {
  .lv-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.live-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- კითხვის ტიპები: სწორი/მცდარი, ქრონოლოგია, რუკა ---------- */
.qtype-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.qtype-fields legend { padding: 0; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.qtype-fields[data-qtype="choice"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.qtype-fields[data-qtype="choice"][hidden] { display: none; }
.qtype-help { align-self: end; }
@media (max-width: 760px) { .qtype-fields[data-qtype="choice"] { grid-template-columns: minmax(0, 1fr); } }
.opts-tf .opt { min-height: 80px; justify-content: center; font-size: 20px; font-weight: 700; }
.order-wrap { display: flex; flex-direction: column; gap: 12px; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: ord; }
.order-item {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px 6px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: grab; counter-increment: ord;
}
.order-item::before { content: counter(ord); width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--sand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.order-item.is-drag { opacity: .5; }
.order-grip { color: var(--muted); letter-spacing: -2px; user-select: none; }
.order-label { flex: 1; font-size: 16px; font-weight: 600; }
.order-btn { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 20px; cursor: pointer; }
.order-btn:hover:not(:disabled) { background: var(--sand); }
.order-btn:disabled { opacity: .35; cursor: default; }
.order-check { align-self: flex-start; }
.order-list.is-miss { animation: shake .4s; }
.order-list.is-miss .order-item { border-color: var(--brick); }
.order-list.is-ok .order-item { background: var(--teal-soft); border-color: var(--teal); cursor: default; }
.order-list.is-solved .order-item { background: #FBF3DE; cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.map-q .mq-region { fill: #FFFDF8; stroke: #A39A85; stroke-width: 1; cursor: pointer; transition: fill .15s; }
.map-q .mq-region:hover:not(.is-off), .map-q .mq-region:focus-visible { fill: #F2C8A8; outline: none; }
.map-q .mq-region.is-miss { fill: var(--brick-soft); stroke: var(--brick); }
.map-q .mq-region.is-ok { fill: #9FCBC1; stroke: var(--teal-dark); stroke-width: 2; }
.map-q .mq-region.is-off { cursor: default; }
.map-q .mq-label { font: 700 16px var(--sans); fill: var(--ink); paint-order: stroke; stroke: rgba(255, 253, 248, .85); stroke-width: 4px; pointer-events: none; }

/* ---------- „იცოდი?“ სურათი ---------- */
.fact-image-field { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.fact-image-preview { width: 180px; max-width: 100%; height: auto; border-radius: 10px; object-fit: cover; }
.fact-image-inputs { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.fact-img { display: block; width: calc(100% + 44px); max-width: none; height: auto; margin: -22px -22px 4px; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* ---------- მისიის ანალიზი კლასისთვის ---------- */
.an-q { display: flex; flex-direction: column; gap: 10px; }
.an-head { display: flex; align-items: flex-start; gap: 12px; }
.an-num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--sand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.an-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.an-pct { flex-shrink: 0; padding: 4px 10px; border-radius: 8px; background: var(--sand); font-size: 14px; font-weight: 700; }
.an-pct.is-low { background: var(--brick-soft); color: var(--brick-dark); }
.an-pct.is-high { background: var(--teal-soft); color: var(--teal-dark); }
.an-dist { display: flex; flex-direction: column; gap: 8px; }
.an-opt .meter-row { font-size: 15px; }
.an-opt.is-right .meter-row span { font-weight: 700; color: var(--teal-dark); }
.an-wrong { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.an-wrong li span { margin-right: 10px; }
.review-picked { color: var(--brick-dark); }

/* ---------- მოსწავლის დეტალური გვერდი (მასწავლებელი) ---------- */
.t-main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stat small { margin-top: 4px; font-size: 13px; }
.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review-list li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.progress-cell { min-width: 140px; }
.progress-cell .bar { margin-bottom: 4px; }
.activity { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
.activity-wd { font-size: 11px; color: var(--muted); text-align: center; }
.activity-day { aspect-ratio: 1; border-radius: 6px; background: var(--sand); }
.activity-day.is-on { background: var(--teal); }
.activity-day.is-future { background: transparent; border: 1px dashed var(--line); }
.activity-day.is-today { box-shadow: 0 0 0 2px var(--brick); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EEE7D8; font-size: 15px; }
.facts li:last-child { border-bottom: 0; }
.name-link { color: var(--ink); text-decoration: none; }
.name-link:hover { color: var(--teal); text-decoration: underline; }

/* ---------- ჯვარედინი ---------- */
.field-static { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.row-actions-start { justify-content: flex-start; flex-wrap: wrap; }
.cw-scroll { overflow-x: auto; padding-bottom: 4px; }
.cw-grid {
  --cell: max(22px, min(36px, calc((100vw - 80px) / var(--cols))));
  display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell);
  width: max-content; margin: 0 auto; border: 2px solid var(--ink); background: var(--ink); gap: 1px;
}
.cw-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: var(--paper); font: 700 calc(var(--cell) * .5) var(--sans); color: var(--ink);
}
.cw-block { background: var(--ink); }
.cw-num { position: absolute; top: 1px; left: 2px; font: 600 calc(var(--cell) * .26) var(--sans); line-height: 1; color: var(--muted); }
.cw-preview { display: flex; flex-direction: column; gap: 16px; }
.cw-grid-preview .cw-letter { color: var(--teal-dark); }
.cw-cluelist ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.cw-cluelist em { color: var(--teal-dark); font-style: normal; font-weight: 600; }
/* მოსწავლის ჯვარედინი */
.cw-play { display: flex; flex-direction: column; gap: 16px; }
.cw-cluebar { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: stretch; }
.cw-nav {
  min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  font: 700 22px var(--sans); color: var(--ink); cursor: pointer;
}
.cw-nav:hover { background: var(--sand); }
.cw-clue {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 14px;
  border-radius: 12px; background: var(--night); color: var(--paper); font-size: 15px; line-height: 1.4;
}
.cw-clue strong { color: var(--peach); font-size: 13px; }
.cw-grid-play .cw-cell { border: 0; padding: 0; cursor: pointer; }
.cw-grid-play .cw-cell:focus { outline: none; }
.cw-grid-play .cw-cell.is-active-word { background: #FBEBDD; }
.cw-grid-play .cw-cell.is-solved { background: var(--teal-soft); color: var(--teal-dark); cursor: default; }
.cw-grid-play .cw-cell.is-revealed { background: #FBF3DE; color: #5E4A12; }
.cw-grid-play .cw-cell.is-wrong { background: var(--brick-soft); color: var(--brick-dark); }
.cw-grid-play .cw-cell.is-cur { box-shadow: inset 0 0 0 3px var(--brick); z-index: 1; }
.cw-status { text-align: center; }
.cw-keyboard { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 5px; }
.cw-key {
  min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  font: 600 17px var(--sans); color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.cw-key:hover { background: var(--sand); }
.cw-key:active { background: var(--peach); }
.cw-key-wide { grid-column: span 11; font-size: 15px; }
@media (max-width: 480px) {
  /* ტელეფონზე 9 სვეტი: 33 ასო + „წაშლა“ ოთხ რიგში, უფრო განიერი ღილაკები */
  .cw-keyboard { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .cw-key-wide { grid-column: span 3; }
}
.cw-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.cw-tools .btn:disabled { opacity: .5; cursor: default; }
.cw-lists { display: flex; flex-direction: column; gap: 8px; }
.cw-cluelist-play { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.cw-clue-item {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  text-align: left; font: 400 15px/1.4 var(--sans); color: var(--ink); cursor: pointer;
}
.cw-clue-item:hover { background: var(--bg); }
.cw-clue-item.is-active { background: #FBEBDD; }
.cw-clue-item.is-solved { color: var(--teal-dark); text-decoration: line-through; text-decoration-color: rgba(21, 74, 71, .45); }

/* ---------- მაღაზია (მათემატიკა) ---------- */
.shop-card { position: relative; overflow: hidden; padding-top: 0; }
/* ფარდული: ზოლიანი ტენტი ბარათის თავზე */
.shop-awning {
  height: 30px; margin: 0 -22px 20px;
  background: repeating-linear-gradient(90deg, var(--teal) 0 34px, var(--peach) 34px 68px);
  /* ზედა ზოლი + ქვემოთ ჩამოკიდებული ნახევარწრეები */
  -webkit-mask: linear-gradient(#000, #000) top / 100% 14px no-repeat, radial-gradient(circle 17px at 17px 13px, #000 98%, transparent) 0 0 / 34px 100% repeat-x;
  mask: linear-gradient(#000, #000) top / 100% 14px no-repeat, radial-gradient(circle 17px at 17px 13px, #000 98%, transparent) 0 0 / 34px 100% repeat-x;
}
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.shop-head .kicker { color: var(--brick); margin-bottom: 4px; }
.shop-head p { max-width: 560px; }
.shop-sum { display: flex; flex-direction: column; align-items: flex-end; }
.shop-sum strong { font: 800 28px/1.1 var(--serif); color: var(--teal-dark); }
.shop-empty { padding: 28px; border: 2px dashed var(--line); border-radius: var(--r-md); text-align: center; color: var(--muted); }
.stalls { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.stall { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.stall .h3 { font-family: var(--serif); font-weight: 800; }
.stall p { flex: 1; }
.stall-top { display: flex; justify-content: space-between; align-items: center; }
.stall-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-soft); }
.stall.is-current { border-color: var(--brick); box-shadow: 0 0 0 1px var(--brick) inset; }
.stall.is-done .stall-icon { background: var(--teal); }
.stall .mini-progress { color: var(--muted); }
.shop-rules { padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.55; }
.shop-badge { display: flex; align-items: center; gap: 14px; }
.shop-badge.is-on .badge-coin { border: 0; background: var(--gold); }
.shop-teaser { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; min-height: 44px; }
.shop-teaser:hover { border-color: var(--teal); color: var(--ink); }
.shop-teaser-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: var(--teal-soft); display: inline-flex; align-items: center; justify-content: center; }
.shop-teaser-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* რიცხვითი პასუხი */
.num-edit:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.num-edit legend { grid-column: 1 / -1; margin-bottom: 4px; }
.num-edit textarea { min-height: 150px; font-family: ui-monospace, Consolas, monospace; }
.num-edit-side { display: grid; gap: 12px; }
.num-help code { padding: 1px 6px; border-radius: 6px; background: var(--sand); color: var(--ink); white-space: nowrap; }
.num-samples { padding: 14px 18px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--teal-dark); }
.num-samples ol { margin: 8px 0 0 18px; display: grid; gap: 4px; font-size: 14px; }
@media (max-width: 760px) { .num-edit:not([hidden]) { grid-template-columns: minmax(0, 1fr); } .num-help code { white-space: normal; } }
.num-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.num-field { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; max-width: 360px; }
.num-input {
  flex: 1; min-width: 0; min-height: 56px; padding: 10px 16px;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
  font: 700 24px/1.2 var(--sans); color: var(--ink);
}
.num-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.num-input.is-miss { border-color: var(--brick); background: var(--brick-soft); animation: shake .4s; }
.num-input.is-ok { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.num-input.is-solved { border-color: var(--brick); color: var(--brick-dark); text-decoration: line-through; }
.num-unit { font-weight: 600; color: var(--muted); }
.num-form .btn { min-height: 56px; }
.num-keys { display: flex; gap: 8px; }
.num-key { min-width: 56px; min-height: 56px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); font: 700 24px/1 var(--sans); color: var(--ink); cursor: pointer; }
.num-key:hover { border-color: var(--teal); }
.lv-num-form .num-keys .num-key { flex: 1; }
.num-wrap .muted { margin-top: 10px; }
.lv-num-form { display: grid; gap: 12px; }
.lv-num-form .num-field { max-width: none; }
.lv-num-mine { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.lv-num-mine strong { font: 800 32px/1.2 var(--serif); }

/* ---------- ინგლისური: ნაკრებები და დუელი ---------- */
.eng-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.eng-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.eng-head .kicker { color: var(--brick); margin-bottom: 4px; }
.eng-head p { max-width: 620px; }
.eng-head-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; background: var(--brick); display: inline-flex; align-items: center; justify-content: center; }
.eng-card .h3 { margin: 18px 0 10px; }
.duel-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.duel-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
.duel-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.duel-row.is-turn { border-color: var(--brick); background: var(--brick-soft); }
.duel-form { margin-top: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.duel-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.duel-form-row label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.duel-form-row select { min-height: 44px; }
.word-prompt { font-size: 34px; }
.word-shape { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.word-shape-group { display: inline-flex; gap: 4px; }
.word-shape-cell { width: 16px; height: 3px; border-radius: 2px; background: var(--muted); opacity: .55; margin-top: 10px; }
.word-input { font-weight: 600; letter-spacing: .02em; }
.lang-keys { display: grid; gap: 6px; margin-top: 12px; }
.lang-keys-row { display: flex; gap: 5px; justify-content: center; }
.lang-key { flex: 1 1 0; max-width: 48px; min-width: 0; min-height: 44px; padding: 0 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font: 600 19px/1 var(--sans); color: var(--ink); cursor: pointer; }
.lang-key:hover { border-color: var(--teal); background: var(--teal-soft); }
.lang-key-wide { flex: 0 0 auto; max-width: none; min-width: 96px; padding: 0 12px; font-size: 15px; }
.lang-head { margin: 18px 0 10px; }
@media (max-width: 480px) { .lang-key { font-size: 17px; } .lang-keys-row { gap: 3px; } }
.word-review strong { font-size: 17px; }
.duel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.duel-score { font: 800 20px/1 var(--serif); color: var(--teal-dark); }
.duel-timer { margin-bottom: 14px; }
.duel-timer span { display: block; height: 100%; background: var(--teal); border-radius: 10px; transition: width .2s linear; }
.duel-timer span.is-low { background: var(--brick); }
.duel-vs { display: flex; align-items: center; justify-content: space-around; gap: 10px; text-align: center; }
.duel-vs-player { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.duel-vs-mid { font: 800 22px/1 var(--serif); color: var(--brick); }
.avatar-teal { background: var(--teal); }
.duel-result.is-win .q-prompt { color: var(--teal-dark); }
.duel-result.is-loss .q-prompt { color: var(--brick-dark); }
.duel-table td { vertical-align: middle; }
.duel-pts { display: inline-block; min-width: 48px; padding: 4px 10px; border-radius: 8px; text-align: center; font-weight: 700; }
.duel-pts.is-ok { background: var(--teal-soft); color: var(--teal-dark); }
.duel-pts.is-miss { background: var(--brick-soft); color: var(--brick-dark); }
@media (max-width: 760px) {
  .duel-form-row { grid-template-columns: minmax(0, 1fr); }
  .word-prompt { font-size: 28px; }
  .eng-head-icon { width: 44px; height: 44px; }
}

@media (max-width: 1100px) {
  .layout, .layout-mission, .t-cols { grid-template-columns: minmax(0, 1fr); }
  .era-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .xp { width: 150px; }
  .layout { padding: 16px; gap: 16px; }
  .mission-bar { flex-wrap: wrap; padding: 12px 16px 0; gap: 12px; }
  .quiz { padding: 22px 18px; min-height: 0; }
  .q-prompt { font-size: 24px; }
  .opts { grid-template-columns: 1fr; }
  .opt { min-height: 64px; font-size: 17px; }
  /* ტელეფონზე რუკა არ პატარავდება: გვერდულად გადაიწევა, რომ წრეებზე დაჭერა და წარწერები კომფორტული იყოს */
  .map-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .map { min-width: 880px; }
  .era-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-sum { margin-left: 0; width: 100%; }
  .t-shell { flex-direction: column; }
  .t-nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .t-brand { width: 100%; padding-bottom: 6px; }
  .t-nav a.t-cta { margin-top: 0; }
  .t-main { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .btn-small { min-height: 44px; }
  .btn-icon { width: 44px; height: 44px; }
  .cr { padding: 16px; }
  .cr-top { flex-wrap: wrap; }
  .cr-opts { grid-template-columns: 1fr; }
  .cr-bottom { flex-direction: column; align-items: stretch; }
  .shop-sum { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- ბეჭდვა: შესვლის ბარათები ---------- */
@media print {
  body { background: #fff; }
  .t-nav, .no-print, .flash { display: none !important; }
  .t-main { padding: 0; }
  .t-cols { display: block; }
  .t-main-col, .t-side { display: block; }
  .t-main-col > .card, .t-side > .card { margin-bottom: 14px; break-inside: avoid; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .activity-day, .tag, .bar span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { border: 0; padding: 0; }
  .print-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .print-card { border: 1.5px dashed #888; border-radius: 10px; padding: 14px; break-inside: avoid; }
  .pc-app { font-size: 10pt; color: #555; }
  .pc-name { font: 700 14pt var(--sans); margin: 6px 0; }
  .pc-code { font: 800 20pt var(--sans); letter-spacing: .12em; }
  .pc-url { font-size: 9pt; color: #555; margin-top: 6px; word-break: break-all; }
}
