@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0b1430;
  --bg-soft: #101c42;
  --bg-panel: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #b8c3de;
  --muted-soft: #91a0c2;
  --gold: #ffd55e;
  --gold-soft: #fff2c4;
  --orange: #ff9f43;
  --green: #72e3a6;
  --white-soft: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(60, 92, 194, 0.28), transparent 28%),
    linear-gradient(180deg, #081126 0%, #0b1430 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.screen {
  min-height: 100vh;
}

.screen-container {
  width: min(1800px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* TOPBAR */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.title-badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 34px;
  flex: 0 0 auto;
  color: #1b2550;
  background: linear-gradient(135deg, #ffe89d, #ffc84a);
  box-shadow: 0 10px 30px rgba(255, 205, 90, 0.2);
}

.top-label {
  margin: 0 0 6px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.8rem);
  line-height: 1.02;
  font-weight: 800;
}

.top-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1vw, 1.1rem);
  line-height: 1.45;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.filter-button {
  min-width: 110px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.filter-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.filter-button.active {
  background: linear-gradient(135deg, #ffe89d, #ffd15a);
  color: #15214a;
  box-shadow: 0 8px 22px rgba(255, 209, 90, 0.22);
}

.fullscreen-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.fullscreen-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

/* SUMMARY */

.summary-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}

.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ready-dot {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 213, 94, 0.7);
}

.almost-dot {
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255, 159, 67, 0.7);
}

.total-dot {
  background: var(--green);
  box-shadow: 0 0 10px rgba(114, 227, 166, 0.7);
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.connection-status.loading .connection-dot {
  background: #ffd55e;
  box-shadow: 0 0 10px rgba(255, 213, 94, 0.7);
  animation: connectionPulse 1.1s ease-in-out infinite;
}

.connection-status.connected .connection-dot {
  background: #72e3a6;
  box-shadow: 0 0 10px rgba(114, 227, 166, 0.7);
}

.connection-status.error .connection-dot {
  background: #ff7474;
  box-shadow: 0 0 10px rgba(255, 116, 116, 0.7);
}

.connection-status.warning {
  color: #ffd39a;
  border-color: rgba(255, 166, 77, 0.25);
  background: rgba(255, 159, 67, 0.08);
}

.connection-status.warning .connection-dot {
  background: #ff9f43;
  box-shadow:
    0 0 10px rgba(255, 159, 67, 0.7);
}

@keyframes connectionPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* BOARD */

.board {
  flex: 1;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 18px;
  min-height: 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  border-radius: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
}

.panel-ready {
  background:
    linear-gradient(180deg, rgba(255, 213, 94, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
}

.panel-almost {
  background:
    linear-gradient(180deg, rgba(255, 159, 67, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.panel-almost .panel-kicker {
  color: #ffb66d;
}

.panel-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 1.8vw, 2.2rem);
  line-height: 1.18;
  font-weight: 800;
}

.panel-count {
  min-width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0b7, #ffd55e);
  color: #182451;
  font-size: 1.2rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.panel-count-almost {
  background: linear-gradient(135deg, #ffd0a8, #ff9f43);
}

/* READY LIST */

.ready-list {
  display: grid;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.ready-list--two-columns {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
}

.ready-list--two-columns .ready-row {
  grid-template-columns:
    64px minmax(0, 1fr);
  min-height: 94px;
}

.ready-list--two-columns .ready-date {
  grid-column: 2;
  justify-self: start;
  text-align: left;
}

.ready-list--two-columns
.ready-date-label {
  display: none;
}

.ready-list--two-columns
.ready-date-value {
  min-width: 0;
  min-height: 30px;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.ready-list--compact {
  gap: 10px;
}

.ready-list--compact .ready-row {
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 18px;
}

.ready-list--compact .rank-number {
  font-size: 1.55rem;
}

.ready-list--compact .rank-star {
  font-size: 1rem;
}

.ready-list--compact .ready-name {
  font-size: clamp(
    1.05rem,
    1.15vw,
    1.45rem
  );
}

.ready-list--compact .ready-meta {
  margin-top: 4px;
  font-size: 0.82rem;
}

.ready-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ready-rank {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.rank-star {
  font-size: 1.3rem;
}

.ready-main {
  min-width: 0;
}

.ready-name {
  margin: 0;
  font-size: clamp(1.2rem, 1.35vw, 1.9rem);
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ready-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.ready-date {
  justify-self: end;
  text-align: right;
}

.ready-date-label {
  display: block;
  color: var(--muted-soft);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ready-date-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 213, 94, 0.14);
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 800;
}

/* ALMOST LIST */

.almost-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.almost-list--compact {
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
}

.almost-list--compact .almost-card {
  padding: 15px;
  border-radius: 19px;
}

.almost-list--compact .almost-name {
  margin: 8px 0 11px;
  font-size: clamp(
    1rem,
    1.05vw,
    1.35rem
  );
}

.almost-list--compact .progress-dot {
  width: 16px;
  height: 16px;
}

.almost-list--compact .progress-dots {
  gap: 7px;
}

.almost-list--compact .streak-value {
  font-size: 1.2rem;
}

.almost-list--compact .almost-note {
  margin-top: 11px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.almost-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.almost-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.almost-class {
  margin: 0;
  color: #ffc894;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.almost-badge {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 159, 67, 0.16);
  color: #ffd7b7;
  font-size: 0.78rem;
  font-weight: 800;
}

.almost-name {
  margin: 10px 0 14px;
  font-size: clamp(1.15rem, 1.2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.progress-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-dots {
  display: flex;
  gap: 10px;
}

.progress-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.progress-dot.filled {
  background: var(--orange);
  border-color: rgba(255, 159, 67, 0.35);
  box-shadow: 0 0 10px rgba(255, 159, 67, 0.45);
}

.streak-value {
  color: #ffd7b7;
  font-size: 1.55rem;
  font-weight: 800;
  white-space: nowrap;
}

.almost-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 159, 67, 0.1);
  color: #ffe2c8;
  font-size: 0.96rem;
  font-weight: 700;
}

.pagination {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 24px;
  margin-top: 14px;
}

.pagination.visible {
  display: flex;
}

.pagination-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition:
    width 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.pagination-dot:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 0.45);
}

.pagination-dot.active {
  width: 28px;
  background: var(--gold);
}

.panel-almost
.pagination-dot.active {
  background: var(--orange);
}

/* EMPTY */

.empty-box {
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

/* FOOTER */

.footer-note {
  text-align: center;
  color: var(--muted-soft);
  font-size: 0.95rem;
  font-weight: 700;
  padding-bottom: 4px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
    align-items: stretch;
  }

  .filters {
    width: 100%;
    justify-content: stretch;
  }

  .filter-button {
    flex: 1;
    min-width: 0;
  }

  .fullscreen-button {
    width: 100%;
  }

  .ready-row {
    grid-template-columns: 72px 1fr;
  }

  .ready-date {
    grid-column: 2 / 3;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .screen-container {
    padding: 16px;
  }

  .title-badge {
    display: none;
  }

  .topbar h1 {
    font-size: 2rem;
  }

  .summary-bar {
    gap: 10px;
  }

  .summary-item {
    width: 100%;
    justify-content: center;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .panel-count {
    min-width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .ready-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ready-date {
    grid-column: auto;
  }

  .ready-rank {
    justify-content: flex-start;
  }

  .progress-row {
    flex-direction: column;
    align-items: flex-start;
  }
}