/* ===== КАРТОЧКИ ПО СТАТУСУ ===== */
.card-default {
  background: #fbfcff;
}
.card-default .card-top {
  background: #EEF2FA;
  color: #444;
}
.card-premiere {
  background: #fdf6f0;
}
.card-premiere .card-top {
  background: #ff7a22;
  color: #fff;
}
.card-last-chance {
  background: #f1f5f6;
}
.card-last-chance .card-top {
  background: linear-gradient(90deg, #4f8fa3 0%, #6faec1 100%);
  color: #fff;
}

.played-toggle-wrap {
  display: grid;
  justify-content: center;
  margin-top: 22px;
}

/* ===== ПЛАШКИ (ЕДИНЫЙ СТАНДАРТ) ===== */
.date-badge,
.premiere-badge,
.last-chance-badge, 
.spacer-badge 
{
  height: 30px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  flex-shrink: 0;
  width: max-content;
}

.card-default .date-badge {
  background: rgba(0, 0, 0, 0.08);
  color: #444;
}
.card-premiere .date-badge{
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
}
.card-last-chance .date-badge{
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
}

.premiere-badge{
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.card-default .premiere-badge {
  color: #444;
}
.last-chance-badge {
  background: rgba(0, 0, 0, 0.08);
  color: #fff;
}

/* ===== СТАТЫ (СЛОЖНОСТЬ / ВОПРОСЫ) ===== */
.top-stats {
  height: 30px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 600;
  white-space: nowrap;
}
.card-default .top-stats {
  color: #444;
  border: none;
  background: rgba(0, 0, 0, 0.08) !important;
}
.card-premiere .top-stats,
.card-last-chance .top-stats {
  color: #fff;
  border: 1px solid rgb(255, 255, 255);
  background: none;
}

/* ===== SPOILER (SCHEDULE) ===== */
.schedule-spoiler {
  position: absolute;
  left: 10px;
  right:10px;
  bottom: 80px;
  z-index: 10;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease, opacity .18s ease;
  opacity: 0;
  background: #fff;
  border-radius: 8px;
  pointer-events: none;
}
.schedule-spoiler.open {
  opacity: 1;
  max-height: 800px;
  pointer-events: auto;
}
.schedule-spoiler .popup-content {
  padding: 12px;
}
:root {
  --bg: #f5f5f5;
  --surface: #fff;
  --muted: #444;
  --accent: #ff7a22;
  --glass: rgba(0,0,0,0.06);
}

/* ===== ЖЁСТКИЙ СБРОС ЦЕНТРИРОВАНИЯ ===== */
body,
.mainbody,
.cards-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ===== ОСНОВА ===== */
body {
  background: #E4EAF6;
  font-family: Futura PT, sans-serif;
}

/* ===== КОНТЕЙНЕР ===== */
.cards-container {
  box-sizing: border-box;
}

.sorting-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
}

#togglePlayed {
  max-width: 280px;
  margin-bottom: 0;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  width: 100%;
  margin: 0 !important;
  padding: 10px;
  justify-content: start !important;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* ===== КАРТОЧКА ===== */
.card {
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

/* ===== ВЕРХ ===== */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 70px;
  border-radius: 16px 16px 0 0;
  background: #B0C4DE;
  color: #111;
  box-sizing: border-box;
  overflow: visible;
}

.card-top span {
  background: transparent;
  font-size: 1.5rem;
}

.card-top-left{
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 24px;
  min-width: 0;
}
.card-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-right: 24px;
}

/* ===== КНОПКА РЕЙТИНГА ===== */
.rating-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
}

.rating-btn svg {
  width: 30px;
  height: 30px;
}

.rating-btn:hover {
  background: rgba(0,0,0,0.08);
}

/* ===== ЗАГОЛОВОК ===== */
.card-title {
  padding-left: 24px;
  padding-right: 24px;
  padding-top: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== ИНФА ===== */
.card-info {
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info {
  font-size: 16px;
  color: var(--muted);
}

/* ===== КНОПКИ ===== */
.actions-card {
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 24px;
  display: flex;
  gap: 14px;
  margin-top: auto;
}

.btn-main,
.btn-secondary {
  flex: 1;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .2s ease;
}

/* ОСНОВНАЯ */
.btn-main:focus,
.btn-main {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.btn-main:hover {
  background: #e06214;
  text-decoration: none;
  color: #fff;
}

/* ВТОРИЧНАЯ */
.btn-secondary:focus,
.btn-secondary {
  background: #f2f2f2;
  border: 1px solid #bbb;
  color: #333;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #e5e5e5;
  text-decoration: none;
  color: #333
}

/* ВТОРИЧНАЯ */
.reject {
  background: #3a507a;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.reject:hover {
  background: #d62828;
  color: #fff;
}

/* ===== ОТКЛЮЧЕНИЕ ===== */
.disabled,
button.disabled,
a.disabled,
[aria-disabled='true'],
[tabindex='-1'] {
  background: #e0e0e0 !important;
  color: #aaa !important;
  border: 1px solid #ccc !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  opacity: 0.7;
  text-decoration: none !important;
}

/* ===== ДНИ ===== */
.day-header {
  margin: 22px 6px 14px;
  text-align: center;
}

.day-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

/* ===== ПК ===== */
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 22px;
    padding: 10px!important;
  }
}

/* ===== ШИРОКИЕ ===== */
@media (min-width: 1600px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 10px!important;
  }
}

/* ===== ФУТЕР ===== */
footer {
  background: #222;
  color: gray;
  text-align: center;
  padding: 16px 0;
}

footer a {
  color: #aaa;
  text-decoration: none;
}

/*=== Ховеры === */
.popup-hover {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;    
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }

/* ===== TOOLTIP ===== */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip {
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Futura PT', sans-serif;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 100;
}

/* стрелка */
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--surface) transparent transparent transparent;
}

.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}


/* ===== Кнопки сортировки ===== */
.sorting-wrap {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 18px;
  justify-self: center;
  width: fit-content;
}
  .sorting-wrap .btn-secondary{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 0;
    margin: 0;
    border: 1px solid #bbb;
    background: #f2f2f2;
    color: #333;
    height:36px;
    box-shadow: none;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 0;
  }
  .sorting-wrap .btn-secondary:first-child{ border-radius: 10px 0 0 10px; }
  .sorting-wrap .btn-secondary:last-child{ border-radius: 0 10px 10px 0; border-right: 1px solid #bbb; }
  .sorting-wrap .btn-secondary + .btn-secondary{ margin-left: -1px; }
  .sorting-wrap .btn-secondary.active{
    background: linear-gradient(90deg,#eaf6ff 0,#d9eef8 100%);
    border-color: #6faec1;
    color: #083047;
  }
  @media (max-width:520px){
    .sorting-wrap .btn-secondary{ font-size:12px; padding:6px 8px; }
    .main-view {
      width: 100vh;
    }
  }

  .schedule-spoiler{ max-height:0; overflow:hidden; transition: max-height .28s ease, opacity .18s ease; opacity:0; background:#fff; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,0.08); margin-top:10px; }
  .schedule-spoiler.open{ opacity:1; max-height:800px; }
  .schedule-spoiler .close-icon{ float:right; cursor:pointer; font-size:14px; padding:6px; }
  .schedule-spoiler .popup-content{ padding:12px; }