/* Gamified dashboard layer */
:root {
  --game-purple: #7c3aed;
  --game-pink: #ec4899;
  --game-cyan: #06b6d4;
  --game-gold: #f59e0b;
  --game-dark: #111827;
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(124, 58, 237, .14), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(6, 182, 212, .13), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(245, 158, 11, .10), transparent 34%),
    linear-gradient(180deg, #f8fbff, #eef2ff 42%, #f7f7fb);
}

.site-header {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
}

.brand > span {
  background: linear-gradient(135deg, var(--game-purple), var(--game-cyan));
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .12), 0 10px 24px rgba(124, 58, 237, .28);
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b, #4338ca 48%, #0891b2);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 255, 255, .18) 0 2px, transparent 3px);
  background-size: 34px 34px;
  opacity: .28;
  transform: rotate(8deg);
}

.hero > * {
  position: relative;
}

.card,
.game-hud,
.quest-card {
  border: 1px solid rgba(124, 58, 237, .14);
  box-shadow: 0 20px 60px rgba(31, 41, 55, .10);
}

.card {
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--game-purple), var(--game-cyan), var(--game-gold));
  opacity: .75;
}

.game-hud {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.player-card,
.skill-panel,
.quest-card {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(238, 242, 255, .96));
}

.avatar-orb {
  flex: 0 0 74px;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--game-gold), #f97316);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 16px 30px rgba(249, 115, 22, .28);
}

.player-card h2 {
  margin: .1rem 0 .35rem;
}

.player-card p {
  margin: 0;
  color: var(--muted);
}

.skill-panel {
  display: grid;
  gap: 14px;
}

.skill-row {
  display: grid;
  grid-template-columns: 92px 1fr 44px;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.gauge {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  box-shadow: inset 0 1px 4px rgba(17, 24, 39, .14);
}

.gauge i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--game-purple), var(--game-gold));
  box-shadow: 0 0 18px rgba(245, 158, 11, .48);
}

.gauge.cyan i {
  background: linear-gradient(90deg, #0ea5e9, var(--game-cyan));
}

.gauge.pink i {
  background: linear-gradient(90deg, var(--game-pink), #f97316);
}

.gauge.violet i {
  background: linear-gradient(90deg, #6366f1, #a855f7);
}

.quest-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.quest-card {
  position: relative;
  overflow: hidden;
}

.quest-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(124, 58, 237, .10);
}

.quest-card span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--game-purple);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.quest-card h3 {
  margin: .7rem 0 .45rem;
  font-size: 1.06rem;
}

.quest-card p {
  margin: 0;
  color: var(--muted);
}

.main-quest {
  color: #fff;
  background: linear-gradient(135deg, #312e81, #7c3aed);
}

.main-quest p {
  color: rgba(255, 255, 255, .82);
}

.main-quest span {
  color: #fff;
  background: rgba(255, 255, 255, .16);
}

.primary {
  background: linear-gradient(135deg, var(--game-purple), #2563eb);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.secondary {
  color: #4338ca;
  background: #f1f5ff;
}

.track {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .48);
}

@media (max-width: 900px) {
  .game-hud,
  .quest-board {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 84px 1fr 42px;
  }
}

.student-party {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.student-card {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid rgba(124, 58, 237, .15);
  border-radius: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, .9);
  text-decoration: none;
  box-shadow: 0 18px 44px rgba(31, 41, 55, .09);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.student-card:hover,
.student-card.selected {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, .45);
  box-shadow: 0 24px 58px rgba(67, 56, 202, .16);
}

.student-card strong {
  font-size: 1.08rem;
}

.student-card small,
.student-card em {
  color: var(--muted);
  font-style: normal;
}

.avatar-orb.small {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 17px;
  font-size: 1.15rem;
}

.mini-gauge {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.mini-gauge i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--game-purple), var(--game-cyan));
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.equipment-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 94% 12%, rgba(245, 158, 11, .22), transparent 22%),
    linear-gradient(135deg, #fff, #f8fbff);
  border: 1px solid rgba(6, 182, 212, .22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 16px 38px rgba(15, 23, 42, .08);
}

.equip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.equipment-card span,
.game-badge {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: .74rem;
  font-weight: 900;
}

.equipment-card em {
  color: #92400e;
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.equipment-card small {
  color: var(--muted);
}

.equip-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(124, 58, 237, .28);
  border-radius: 14px;
  color: #6b7280;
  background: rgba(238, 242, 255, .55);
  font-size: .86rem;
}

.unit-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.unit-chip-grid .unit-chip {
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 11px;
  color: #475569;
  background: #f1f5f9;
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-chip.state-started {
  color: #1d4ed8;
  background: #dbeafe;
}

.unit-chip.state-practiced {
  color: #6d28d9;
  background: #ede9fe;
}

.unit-chip.state-completed {
  color: #047857;
  background: #d1fae5;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin-bottom: 0;
}

.game-badge {
  color: #fff;
  background: linear-gradient(135deg, var(--game-purple), #2563eb);
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}

.skill-map-card {
  padding-bottom: 28px;
}

.map-track-label {
  width: fit-content;
  margin: 8px 0 12px;
  padding: 4px 11px;
  border-radius: 999px;
  color: #4338ca;
  background: #eef2ff;
  font-weight: 900;
  font-size: .78rem;
}

.map-area {
  margin: 18px 0 20px;
}

.map-area h3 {
  margin: 0 0 10px;
  color: #334155;
  font-size: .98rem;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.map-area-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.map-area-card[open] {
  grid-column: 1 / -1;
  border-color: rgba(124, 58, 237, .32);
  background:
    radial-gradient(circle at 96% 0%, rgba(124, 58, 237, .10), transparent 26%),
    rgba(255, 255, 255, .92);
}

.map-area-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.map-area-card summary::-webkit-details-marker {
  display: none;
}

.map-area-card summary h3 {
  margin: 5px 0 4px;
  color: #0f172a;
  font-size: 1.08rem;
}

.map-area-card summary p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.map-area-card summary strong {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  color: #4338ca;
  background: #eef2ff;
  font-size: .78rem;
}

.area-rank {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.map-area-card .skill-grid {
  padding: 0 18px 18px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}

.skill-node {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}

.skill-node::after {
  content: "◇";
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: rgba(100, 116, 139, .22);
  font-size: 1.35rem;
}

.skill-node span {
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
  background: #e5e7eb;
  color: #475569;
}

.skill-node strong {
  line-height: 1.35;
}

.skill-node small {
  color: var(--muted);
}

.skill-node.state-logged {
  border-color: rgba(59, 130, 246, .35);
  background: linear-gradient(135deg, #eff6ff, #fff);
}

.skill-node.state-logged span {
  color: #1d4ed8;
  background: #dbeafe;
}

.skill-node.state-checking {
  border-color: rgba(245, 158, 11, .42);
  background: linear-gradient(135deg, #fffbeb, #fff);
}

.skill-node.state-checking span {
  color: #b45309;
  background: #fef3c7;
}

.skill-node.state-evidence {
  border-color: rgba(124, 58, 237, .38);
  background: linear-gradient(135deg, #f5f3ff, #fff);
}

.skill-node.state-evidence span {
  color: #6d28d9;
  background: #ede9fe;
}

.skill-node.state-mastered {
  border-color: rgba(16, 185, 129, .42);
  background: linear-gradient(135deg, #ecfdf5, #fff);
}

.skill-node.state-mastered span {
  color: #047857;
  background: #d1fae5;
}

.skill-node.state-mastered::after {
  content: "◆";
  color: rgba(16, 185, 129, .38);
}

.maintenance-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.maintenance-inline p {
  margin: 0;
  color: var(--muted);
}

.maintenance-table {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
}

.maintenance-table table {
  min-width: 1100px;
  margin: 0;
}

.maintenance-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.maintenance-table input,
.maintenance-table select {
  width: 100%;
  min-width: 110px;
  padding: 7px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
}

.maintenance-table .number-input {
  min-width: 72px;
}

.maintenance-table small {
  color: var(--muted);
  white-space: nowrap;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.checkline input {
  width: auto;
  min-width: auto;
}
