/* Дуел на цял екран: играта в средата, живи панели отстрани.
   Включва се последен — след duel.css, duel-effects.css и duel-visual.css. */

/* ---------- рамка на цял екран ---------- */
html, body { height: 100%; }
body { overflow: hidden; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  margin: 0 !important;
  padding: 8px 16px !important;
  background: linear-gradient(180deg, rgba(8, 13, 11, .96), rgba(8, 13, 11, .6) 70%, transparent);
  border-bottom: 1px solid rgba(201, 162, 39, .14);
  backdrop-filter: blur(6px);
}

.duelwrap {
  display: grid;
  grid-template-columns: minmax(230px, 288px) minmax(0, 1fr) minmax(250px, 320px);
  gap: 14px;
  align-items: stretch;
  max-width: 1760px;
  margin: 0 auto;
  padding: 64px 16px 14px;
  height: 100svh;
}

.stage {
  max-width: none !important;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* ---------- странични панели ---------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, .25); border-radius: 6px; }

.widget {
  border: 1px solid rgba(236, 229, 211, .1);
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(201, 162, 39, .07), transparent 60%),
    rgba(255, 255, 255, .022);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.widget h3 {
  margin: 0 0 10px;
  font: 600 10.5px/1.2 system-ui, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #c9a227;
}

/* профил */
.me { display: flex; align-items: center; gap: 12px; }
.me .avatar { width: 52px; height: 52px; font-size: 17px; border: 2px solid rgba(201, 162, 39, .45); }
.me-name { font: 600 15px/1.2 Georgia, serif; color: #f4ecda; }
.me-elo { color: #93a096; font-size: 12px; font-variant-numeric: tabular-nums; }
.divbadge {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, .28);
  background: rgba(201, 162, 39, .07);
  font-size: 12.5px;
}
.divbadge b { color: #f2dd9b; letter-spacing: .04em; }
.divbar { height: 6px; border-radius: 4px; background: rgba(236, 229, 211, .09); overflow: hidden; margin-top: 9px; }
.divbar > i { display: block; height: 100%; background: linear-gradient(90deg, #8a6f1f, #d8b25a); transition: width .5s; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { border: 1px solid rgba(236, 229, 211, .08); border-radius: 10px; padding: 8px 10px; background: rgba(255, 255, 255, .02); }
.stat b { display: block; font: 600 17px/1.1 Georgia, serif; color: #f3e6c4; font-variant-numeric: tabular-nums; }
.stat small { color: #93a096; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }

/* занимавка: мини въпрос */
.mini-q { font: 500 14px/1.35 Georgia, serif; color: #e9e1cf; margin: 0 0 10px; }
.mini-opts { display: grid; gap: 6px; }
.mini-opt {
  appearance: none;
  text-align: left;
  border: 1px solid rgba(236, 229, 211, .14);
  background: rgba(255, 255, 255, .03);
  color: #d8d0bd;
  border-radius: 9px;
  padding: 8px 10px;
  font: 13px/1.3 system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.mini-opt:hover { border-color: rgba(201, 162, 39, .5); transform: translateX(2px); }
.mini-opt.ok { border-color: rgba(127, 168, 135, .8); background: rgba(127, 168, 135, .16); color: #dff0e2; }
.mini-opt.bad { border-color: rgba(217, 83, 78, .75); background: rgba(217, 83, 78, .14); color: #f4d9d7; }
.mini-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: #93a096; }
.mini-next { appearance: none; border: 0; background: none; color: #d8b25a; font: 600 11.5px system-ui; cursor: pointer; letter-spacing: .06em; }
.mini-next:hover { color: #f2dd9b; }

/* факт на деня */
.fact { font: 400 13.5px/1.5 Georgia, serif; color: #ded6c3; margin: 0; }
.fact b { color: #f2dd9b; font-weight: 600; }

/* на линия */
.live { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #cfc7b4; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #7fa887; box-shadow: 0 0 10px #7fa887; animation: livePulse 2.4s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* как се играе */
.howto { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.howto li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 12.5px; color: #b9b2a2; line-height: 1.4; }
.howto b { color: #c9a227; font: 700 12px/1.4 Georgia, serif; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .duelwrap { grid-template-columns: minmax(0, 1fr); padding-top: 60px; }
  .rail { display: none; }
  body { overflow: auto; }
  .stage { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .live i { animation: none; }
}

/* клавиши */
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.keys li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9b2a2; }
.keys kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 6px; border: 1px solid rgba(236,229,211,.18);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.25));
  font: 600 11px/1 system-ui; color: #e7dfcd;
  box-shadow: 0 2px 0 rgba(0,0,0,.45);
}
.keys span { margin-left: 4px; }

/* панелите да запълват височината */
.rail { justify-content: flex-start; }
.rail .widget { flex: 0 0 auto; }
.rail .widget:last-child { flex: 1 1 auto; }

/* класация */
.top { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; counter-reset: t; }
.top li {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px;
  font-size: 12.5px; color: #cfc7b4; padding: 5px 0; border-bottom: 1px dashed rgba(236,229,211,.07);
}
.top li:last-child { border-bottom: 0; }
.top li::before { counter-increment: t; content: counter(t); color: #8a8168; font: 600 11px/1 Georgia, serif; }
.top li:first-child::before { color: #d8b25a; }
.top .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .rr { font-variant-numeric: tabular-nums; color: #f2dd9b; font-weight: 600; }
.top .empty { display: block; color: #8a8168; border: 0; font-size: 12px; }
.top .empty::before { content: none; }

/* само панелът с класацията расте */
.rail .widget:last-child { flex: 0 0 auto; }
.rail .widget.grow { flex: 1 1 auto; display: flex; flex-direction: column; }
.rail .widget.grow .top { align-content: start; }

/* лявата колона: картите се разпределят равномерно, без празна кутия */
.rail-left { justify-content: space-between; }
.rail-left .widget:last-child { margin-bottom: 0; }

/* игралният екран да диша вертикално, а не да виси горе */
#screen-round:not([hidden]) { min-height: 0 !important; justify-content: center !important; }
#screen-round .q-card { width: 100%; }
#screen-round .opt { min-height: 74px !important; }

/* картата да не се реже при показване на верния отговор */
#screen-round .q-card { max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
#screen-round .q-card::-webkit-scrollbar { width: 6px; }
#screen-round .q-card::-webkit-scrollbar-thumb { background: rgba(201,162,39,.3); border-radius: 6px; }
#screen-round .opt { min-height: 66px !important; }
