:root {
  color-scheme: light;
  --bg: #f3f7fa;
  --surface: #ffffff;
  --surface-strong: #edf8fd;
  --text: #20242c;
  --muted: #5d707d;
  --line: #d4e0e5;
  --primary: #003459;
  --primary-dark: #01040d;
  --primary-soft: #e6f5fb;
  --accent: #0093d4;
  --accent-dark: #0c4e7f;
  --success: #087f5b;
  --warning: #b7791f;
  --shadow: 0 18px 44px rgba(0, 52, 89, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 440px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.brand-row.compact {
  gap: 10px;
}

.brand-mark {
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand-mark.small {
  border-radius: 6px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.form-row {
  display: grid;
  gap: 8px;
}

label {
  color: #394151;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 147, 212, 0.18);
}

.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.form-error,
.status-bar {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.form-error {
  color: #7f1d1d;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.status-bar {
  color: #3f2f12;
  background: #fff8e1;
  border: 1px solid #f7d27a;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--primary);
  background: #fff;
  border: 1px solid rgba(0, 147, 212, 0.38);
}

.ghost-button {
  color: #394151;
  background: transparent;
  border: 1px solid var(--line);
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.user-name {
  max-width: 220px;
  color: #394151;
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 42px) 48px;
}

.day-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 4vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 36, 51, 0.06);
}

.day-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.range-selector {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  gap: 4px;
  padding: 4px;
  background: #eef4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.range-button {
  min-height: 38px;
  padding: 8px 12px;
  color: #4a5f6d;
  background: transparent;
  border-radius: 6px;
  font-weight: 900;
  white-space: nowrap;
}

.range-button.is-active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(0, 52, 89, 0.18);
}

.summary-block {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 14px 16px;
  text-align: center;
  background: var(--surface-strong);
  border: 1px solid #cbeaf6;
  border-radius: 8px;
}

.summary-number {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-dark);
}

.summary-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.schedule-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

.event-card.is-current {
  background: linear-gradient(90deg, #e6f5fb 0%, #ffffff 72%);
  border-color: var(--accent);
  border-left-color: var(--primary);
  outline: 2px solid rgba(0, 147, 212, 0.22);
  outline-offset: 2px;
  box-shadow: 0 14px 34px rgba(0, 52, 89, 0.18);
}

.event-card.is-past {
  border-left-color: #9aa6b2;
}

.event-time {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.event-time strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.event-card.is-current .event-time strong,
.event-card.is-current .event-title {
  color: var(--primary);
}

.event-time span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.event-body {
  min-width: 0;
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.event-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #fff;
  background: var(--success);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.event-badge.past {
  background: #7b8794;
}

.event-badge.current {
  background: var(--primary);
}

.event-description {
  margin: 8px 0 0;
  color: #3e4655;
  line-height: 1.45;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.meta-pill {
  max-width: 100%;
  padding: 6px 9px;
  color: #354052;
  background: #f3f6fa;
  border: 1px solid #e4eaf2;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.meta-pill.game {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #bfe3f2;
}

.empty-state {
  margin-top: 18px;
  padding: 26px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed #c7d0dc;
  border-radius: 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions button {
    flex: 1 1 0;
  }

  .user-name {
    display: none;
  }

  .day-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .day-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .range-selector {
    width: 100%;
  }

  .summary-block {
    width: 100%;
  }

  .event-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .event-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
