:root {
  --ink: #172033;
  --muted: #667085;
  --line: rgba(23, 32, 51, .12);
  --panel: rgba(255, 255, 255, .9);
  --blue: #2161ff;
  --cyan: #00b8d9;
  --green: #1fbf75;
  --pink: #f0449b;
  --yellow: #ffbd12;
  --shadow: 0 18px 45px rgba(24, 37, 70, .14);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #f7fbff 0%, #fff8e8 46%, #f8f7ff 100%);
}
a { color: inherit; text-decoration: none; }
.bg-shapes::before, .bg-shapes::after {
  content: "";
  position: fixed;
  width: 34vmax;
  height: 34vmax;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .22;
  pointer-events: none;
  animation: float 12s ease-in-out infinite alternate;
}
.bg-shapes::before { background: var(--cyan); left: -10vmax; top: 8vh; }
.bg-shapes::after { background: var(--pink); right: -12vmax; bottom: 2vh; animation-delay: -4s; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(28px); } }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: var(--shadow);
}
.topnav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 70px; }
.hero {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
}
.eyebrow { color: var(--blue); font-weight: 900; }
h1 { font-size: clamp(2rem, 5vw, 4.6rem); line-height: 1; margin: 0 0 16px; }
h2 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.6; }
.actions, .inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #6c3cff);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  padding: 12px 18px;
  box-shadow: 0 12px 28px rgba(33, 97, 255, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(33, 97, 255, .28); }
.btn.big { min-height: 52px; padding-inline: 24px; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); box-shadow: none; }
.hero-card, .auth-card, .panel, .join-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-card {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.hero-card strong { font-size: clamp(3.4rem, 8vw, 6rem); color: var(--blue); }
.game-chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: #e7f7ff;
  color: #056789;
  font-weight: 900;
}
.game-chip.maletin { background: #fff3cb; color: #8a5b00; }
.auth-card { width: min(520px, 100%); margin: 46px auto; padding: clamp(22px, 4vw, 38px); }
.auth-card.wide { width: min(820px, 100%); }
.form { display: grid; gap: 14px; }
.form.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form.inline { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.span { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
}
textarea { min-height: 110px; resize: vertical; }
.password-field { display: flex; }
.password-field input { border-radius: 12px 0 0 12px; }
.password-field button { border: 1px solid var(--line); border-left: 0; background: #f5f7fb; border-radius: 0 12px 12px 0; padding: 0 12px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }
.dashboard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.sidebar a { padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 800; }
.sidebar a.active, .sidebar a:hover { background: #eef4ff; color: var(--blue); }
.content { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 22px; }
.stat { border-radius: 18px; padding: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat span { display: block; color: var(--muted); font-weight: 800; margin-bottom: 8px; }
.stat strong { font-size: 2rem; }
.panel { padding: 20px; margin: 18px 0; }
.center { text-align: center; }
.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.table th, .table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: .86rem; text-transform: uppercase; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.game-card {
  min-height: 210px;
  border-radius: 22px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #2161ff, #00a676);
  box-shadow: var(--shadow);
}
.game-card:nth-child(even) { background: linear-gradient(135deg, #ff8a00, #f0449b); }
.game-card span { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.2); font-weight: 900; margin-bottom: 18px; }
.game-card p { color: rgba(255,255,255,.86); }
.student-home { display: grid; place-items: center; min-height: 60vh; text-align: center; }
.join-card { width: min(620px, 100%); padding: clamp(24px, 5vw, 44px); background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(231,247,255,.9)); }
.join-card h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.join-form { display: grid; gap: 14px; margin-top: 18px; }
.join-form input { text-align: center; font-size: 2rem; font-weight: 900; letter-spacing: 6px; }
.alert { border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-weight: 800; }
.alert.success { background: #e8fff4; color: #067647; }
.alert.error { background: #fff1f3; color: #b42318; }
.hint { margin: 10px 0 0; color: var(--muted); font-weight: 800; }
.hint:empty { display: none; }
.footer { padding: 22px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); background: rgba(255,255,255,.62); }
@media (max-width: 900px) {
  .hero, .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form.grid, .form.compact, .form.inline, .game-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topnav { width: 100%; }
  .topnav a { flex: 1; text-align: center; }
  .stats, .sidebar { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
  h1 { font-size: 2.2rem; }
}
