/* Tailwind overrides + product polish */
:root {
  --brand: #7c3aed;
  --brand-deep: #6d28d9;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 18px 40px rgba(15, 23, 42, 0.12);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hidden {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
}

.field-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  background: #fff;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.field-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.875rem;
  padding: 0.875rem 1.25rem;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.secondary-button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #be123c;
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.danger-button:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.small-button {
  padding: 0.625rem 0.9rem;
  font-size: 0.875rem;
}

.auth-card,
.panel-card {
  background: #fff;
  border-radius: 1.5rem;
  border: 1px solid #eef2f7;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
}

.auth-card:hover,
.panel-card:hover {
  box-shadow: var(--shadow-hover);
}

.dashboard-header {
  padding: 0.25rem 0;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-soft);
}

.avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.tabs {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.375rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e2e8f0;
}

.tab {
  padding: 0.75rem 1.25rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab:hover {
  color: #334155;
  background: #f8fafc;
}

.tab.active {
  color: white;
  background: var(--brand);
  box-shadow: var(--shadow-soft);
}

.tab-panel.hidden {
  display: none;
}

.panel-card {
  padding: 1.35rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
}

.section-subtitle {
  color: #64748b;
  font-size: 0.94rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-summary {
  margin-bottom: 0.9rem;
}

.stat-card {
  border: 1px solid #edf2f7;
  background: #fff;
  border-radius: 1.15rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.security-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #fcd34d;
  border-radius: 1.15rem;
  background: #fffbeb;
  box-shadow: var(--shadow-soft);
}

.security-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.security-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
}

.lockout-hint {
  color: #be123c;
}

.stat-card:hover,
.stat-card:focus {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 800;
  color: #0f172a;
}

.stat-caption {
  display: block;
  margin-top: 0.35rem;
  color: #94a3b8;
  font-size: 0.83rem;
}

.todo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.todo-filter,
.todo-scope,
.quick-templates button {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.47rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.todo-filter:hover,
.todo-scope:hover,
.quick-templates button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.todo-filter.active,
.todo-scope.active {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.todo-scope.active {
  background: var(--brand);
  color: white;
}

.filter-divider {
  width: 1px;
  min-height: 1.8rem;
  background: #e2e8f0;
}

.quick-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.quick-templates button {
  padding: 0.42rem 0.75rem;
  font-size: 0.8rem;
}

.todo-item,
.note-item,
.user-row {
  border: 1px solid #edf2f7;
  background: #fff;
  border-radius: 1rem;
  transition: var(--transition-fast);
}

.todo-item:hover,
.note-item:hover,
.user-row:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.todo-item.todo-highlight {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.todo-item.todo-overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.todo-item.todo-due-soon {
  border-color: #fde68a;
  background: #fffbeb;
}

.todo-item {
  padding: 0.95rem 1rem;
}

.todo-main {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  width: 100%;
}

.todo-checkbox {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.todo-copy {
  min-width: 0;
  flex: 1;
}

.todo-delete,
.note-delete {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.25rem 0.3rem;
  border-radius: 0.5rem;
  flex: 0 0 auto;
}

.todo-delete:hover,
.note-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

.todo-title {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.todo-title.is-done {
  text-decoration: line-through;
  color: #94a3b8;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.todo-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.badge-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.badge-due-soon {
  background: #fef3c7;
  color: #92400e;
}

.badge-household {
  background: #e0f2fe;
  color: #075985;
}

.badge-neutral {
  background: #ede9fe;
  color: #6d28d9;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 0.95rem;
}

.note-item.note-pinned {
  border-color: #c4b5fd;
  background: #faf5ff;
}

.note-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
  color: #64748b;
  font-size: 0.73rem;
  font-weight: 700;
}

.note-category,
.note-pin {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: #f1f5f9;
  color: #475569;
}

.note-pin {
  background: #ede9fe;
  color: #6d28d9;
}

.pin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  color: #475569;
  font-weight: 700;
}

.log-list {
  display: grid;
  gap: 0.75rem;
}

.log-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.7rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.log-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
}

.log-row.log-resolved {
  opacity: 0.62;
  background: #f8fafc;
}

.log-main {
  min-width: 0;
}

.log-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #0f172a;
}

.log-title strong {
  overflow-wrap: anywhere;
}

.log-meta {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.log-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.log-error {
  background: #fee2e2;
  color: #991b1b;
}

.log-warn {
  background: #fef3c7;
  color: #92400e;
}

.note-mark {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-top: 0.42rem;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  flex: 0 0 auto;
}

.note-copy {
  min-width: 0;
  flex: 1;
}

.note-text {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.42;
}

.note-time {
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: #94a3b8;
}

.todo-delete,
.note-delete {
  opacity: 0;
}

.todo-item:hover .todo-delete,
.todo-item:focus-within .todo-delete,
.note-item:hover .note-delete,
.note-item:focus-within .note-delete {
  opacity: 1;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.95rem;
}

@media (hover: none) {
  .todo-delete,
  .note-delete {
    opacity: 1;
  }
}

.user-cell {
  min-width: 0;
}

.user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.row-feedback {
  font-size: 0.875rem;
  color: #059669;
  font-weight: 700;
}

.user-row.saved-flash {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748b;
}

.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  max-width: 20rem;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  color: white;
  font-weight: 600;
  transform: translateX(120%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-hover);
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  background: #10b981;
}

.toast-error {
  background: #ef4444;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.todo-item,
.note-item,
.user-row,
.stat-card {
  animation: slideIn 0.16s ease-out;
}

@media (min-width: 768px) {
  .user-row {
    grid-template-columns: 1.3fr 0.8fr 1fr auto;
    align-items: center;
  }

  .security-panel {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.8fr);
    align-items: center;
  }

  .security-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .log-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Family Portal home-base redesign */
:root {
  --brand: #7c3aed;
  --brand-deep: #5b21b6;
  --sun: #f97316;
  --mint: #10b981;
  --sky: #0ea5e9;
  --rose: #f43f5e;
  --ink: #172033;
}

.portal-body {
  background:
    radial-gradient(circle at 12% 10%, rgba(251, 191, 36, 0.26), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.18), transparent 30rem),
    radial-gradient(circle at 75% 85%, rgba(124, 58, 237, 0.20), transparent 26rem),
    linear-gradient(135deg, #fff7ed 0%, #f8fafc 42%, #eef2ff 100%);
  color: var(--ink);
}

.page-shell {
  position: relative;
}

.page-shell::before,
.page-shell::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.65;
}

.page-shell::before {
  width: 13rem;
  height: 13rem;
  left: -4rem;
  top: 12rem;
  background: repeating-linear-gradient(45deg, rgba(251, 146, 60, 0.25) 0 10px, transparent 10px 20px);
}

.page-shell::after {
  width: 10rem;
  height: 10rem;
  right: -3rem;
  bottom: 6rem;
  background: repeating-linear-gradient(-45deg, rgba(124, 58, 237, 0.18) 0 9px, transparent 9px 18px);
}

.auth-card,
.panel-card,
.identity-chip,
.tabs,
.hero-card,
.lounge-panel {
  backdrop-filter: blur(16px);
}

.auth-card,
.panel-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.dashboard-header {
  padding: 1rem;
  border-radius: 1.75rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
}

.identity-chip {
  background: rgba(255, 255, 255, 0.86);
}

.avatar {
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.72);
}

.tab.active {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: rgba(124, 58, 237, 0.10);
  color: #6d28d9;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  overflow: hidden;
  position: relative;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.62)),
    radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.5), transparent 16rem),
    radial-gradient(circle at 15% 85%, rgba(14, 165, 233, 0.22), transparent 14rem);
  box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12);
}

.hero-title {
  margin-top: 0.7rem;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.055em;
  color: #111827;
}

.hero-copy {
  margin-top: 1rem;
  max-width: 46rem;
  color: #475569;
  font-size: 1.04rem;
  line-height: 1.65;
}

.hero-orb {
  display: grid;
  place-items: center;
  justify-self: start;
  width: 7rem;
  height: 7rem;
  border-radius: 2rem;
  background: linear-gradient(135deg, #fef3c7, #f9a8d4);
  box-shadow: 0 22px 46px rgba(236, 72, 153, 0.24);
  font-size: 3.6rem;
  transform: rotate(4deg);
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.space-card {
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
  border: 0;
  border-radius: 1.6rem;
  text-align: left;
  color: #172033;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(30, 41, 59, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.space-card::after {
  content: '';
  position: absolute;
  right: -2.2rem;
  bottom: -2.4rem;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.space-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 28px 58px rgba(30, 41, 59, 0.18);
}

.space-icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.58);
  font-size: 2rem;
}

.space-kicker {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.space-card strong {
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 950;
}

.space-card span:last-child {
  color: rgba(23, 32, 51, 0.76);
  line-height: 1.45;
}

.family-space { background: linear-gradient(135deg, #dbeafe, #fef3c7); }
.kids-space { background: linear-gradient(135deg, #c4b5fd, #67e8f9); }
.rewards-space { background: linear-gradient(135deg, #fde68a, #fda4af); }
.parents-space { background: linear-gradient(135deg, #fed7aa, #fde68a); }
.arcade-space { background: linear-gradient(135deg, #a7f3d0, #bfdbfe); }
.control-space { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }

.lounge-panel {
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.kids-lounge-panel {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.16)), rgba(255,255,255,0.84);
}

.arcade-lounge-panel {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(59, 130, 246, 0.16)), rgba(255,255,255,0.86);
}

.rewards-lounge-panel {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(244, 63, 94, 0.12)), rgba(255,255,255,0.86);
}

.parents-lounge-panel {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.20), rgba(255, 255, 255, 0.86));
}

.preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.preview-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255,255,255,0.86);
}

.kids-section-tab {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.kids-section-tab:hover,
.kids-section-tab.active {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: var(--shadow-soft);
}

.kids-section-tab.active {
  background: rgba(255, 255, 255, 0.94);
}

.preview-card strong {
  font-weight: 900;
  color: #0f172a;
}

.preview-card span {
  color: #64748b;
  font-size: 0.9rem;
}

.kids-mini-panel {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.kids-mini-panel h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 950;
  color: #0f172a;
}

.kids-mini-panel p {
  margin: 0.25rem 0 0;
  color: #64748b;
}

.quest-list,
.badge-row,
.arcade-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.quest-card,
.badge-card,
.arcade-game-card {
  display: grid;
  gap: 0.28rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #0f172a;
}

.arcade-shelf {
  padding: 0 1.25rem 1rem;
}

.arcade-game-card {
  text-align: left;
  cursor: pointer;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.arcade-game-card span {
  font-size: 1.65rem;
}

.arcade-game-card small {
  color: rgba(248, 250, 252, 0.68);
}

.arcade-game-card.active {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(124, 58, 237, 0.34);
}

.arcade-game-card.coming-soon {
  opacity: 0.58;
  cursor: not-allowed;
}

.xp-bar {
  overflow: hidden;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.xp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #22d3ee);
}

.arcade-cabinet {
  overflow: hidden;
  border-radius: 1.65rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.4), transparent 23rem),
    radial-gradient(circle at 86% 18%, rgba(239, 68, 68, 0.28), transparent 20rem),
    linear-gradient(135deg, #17143f, #28104f 52%, #101827);
  color: #f8fafc;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
}

.arcade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
}

.arcade-kicker {
  display: inline-flex;
  margin-bottom: 0.2rem;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arcade-header h3 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  font-weight: 950;
}

.arcade-header p {
  margin: 0.2rem 0 0;
  color: rgba(248, 250, 252, 0.76);
}

.arcade-scoreboard {
  min-width: 5.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

.arcade-scoreboard span {
  display: block;
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arcade-scoreboard strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.arcade-stage-meta {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 1.25rem 1rem;
}

.arcade-stage-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.34);
  padding: 0.95rem 1rem;
}

.arcade-stage-card strong,
.arcade-stage-card small {
  display: block;
}

.arcade-stage-card strong {
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 900;
}

.arcade-stage-card small {
  color: rgba(248, 250, 252, 0.76);
  margin-top: 0.35rem;
}

.game-frame {
  position: relative;
  margin: 0 1rem;
  border: 0.5rem solid rgba(15, 23, 42, 0.72);
  border-radius: 1.3rem;
  background: #050816;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 42px rgba(0, 0, 0, 0.25);
}

.game-frame:fullscreen,
.game-frame.game-frame-expanded {
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  border-width: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.34), transparent 22rem),
    radial-gradient(circle at 86% 18%, rgba(239, 68, 68, 0.24), transparent 19rem),
    #050816;
  box-shadow: none;
  overflow: hidden;
  z-index: 80;
}

.game-frame.game-frame-expanded {
  position: fixed;
  inset: 0;
}

.game-stage-hud {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-status-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 850;
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
}

.game-utility-controls {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 4;
  display: none;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-frame:fullscreen .game-utility-controls,
.game-frame.game-frame-expanded .game-utility-controls {
  display: flex;
}

.game-utility-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
}

#factory-flyer {
  display: block;
  width: 100%;
  max-height: min(58vh, 34rem);
  aspect-ratio: 9 / 5;
  border-radius: 0.8rem;
  cursor: pointer;
  touch-action: manipulation;
}

.game-frame:fullscreen #factory-flyer,
.game-frame.game-frame-expanded #factory-flyer {
  width: min(100vw - 1.5rem, calc((100vh - 1.5rem) * 1.8));
  max-width: 100%;
  max-height: calc(100vh - 1.5rem);
  border-radius: 1rem;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  padding: 4.25rem 1.5rem 1.5rem;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgba(10, 8, 30, 0.28), rgba(10, 8, 30, 0.76));
  text-align: center;
}

.game-frame:fullscreen .game-overlay,
.game-frame.game-frame-expanded .game-overlay {
  border-radius: 1rem;
  padding: 6.25rem 1.25rem 1.5rem;
}

.game-overlay strong {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 950;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.game-title-art {
  width: min(82%, 28rem);
  max-height: 12rem;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.game-overlay span {
  max-width: 24rem;
  color: rgba(248, 250, 252, 0.82);
}

.game-frame .primary-button,
.game-frame .secondary-button,
.game-utility-button {
  touch-action: manipulation;
}

.arcade-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
}

.arcade-controls span {
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.92rem;
}

#factory-flyer-fullscreen {
  white-space: nowrap;
}

.score-save-state {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.score-save-state.saved { color: #86efac; }
.score-save-state.saving { color: #fef08a; }
.score-save-state.failed { color: #fca5a5; }

.leaderboard-card {
  margin: 0 1.25rem 1.25rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.leaderboard-header h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 950;
}

.leaderboard-personal {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.32);
  color: rgba(248, 250, 252, 0.86);
  white-space: nowrap;
}

.leaderboard-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(248, 250, 252, 0.9);
}

.leaderboard-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-rank {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  font-weight: 950;
}

.leaderboard-score {
  font-weight: 950;
  color: #fef08a;
}

body.factory-flyer-immersive {
  overflow: hidden;
}

body.factory-flyer-touch-lock {
  overscroll-behavior: none;
}

.game-frame.game-frame-touch-lock,
.game-frame.game-frame-touch-lock #factory-flyer,
.game-frame.game-frame-touch-lock .game-overlay,
.game-frame.game-frame-touch-lock .game-utility-controls {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 760px) {
  .arcade-header,
  .leaderboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .arcade-stage-meta {
    grid-template-columns: 1fr;
    padding: 0 1rem 0.9rem;
  }

  .arcade-scoreboard,
  .leaderboard-personal {
    align-self: stretch;
  }

  .arcade-shelf {
    grid-template-columns: 1fr;
    padding: 0 1rem 0.9rem;
  }

  .game-frame {
    margin: 0 1rem;
    border-width: 0.35rem;
    border-radius: 1rem;
  }

  .game-utility-controls {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
  }

  .game-stage-hud {
    left: 0.75rem;
    right: 0.75rem;
    top: 0.75rem;
    padding-right: 7rem;
  }

  .game-utility-button {
    flex: 1 1 6.5rem;
  }

  .game-overlay {
    gap: 0.7rem;
    padding: 5rem 1rem 1rem;
  }

  .game-frame:fullscreen .game-overlay,
  .game-frame.game-frame-expanded .game-overlay {
    padding: 6.75rem 1rem 1.25rem;
  }

  .game-overlay strong {
    font-size: clamp(1.55rem, 8vw, 2.3rem);
  }

  .game-overlay span {
    font-size: 0.94rem;
  }

  .game-title-art {
    width: min(92%, 18rem);
    max-height: 7rem;
  }

  .arcade-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    padding: 0.9rem 1rem 1rem;
  }

  .arcade-controls button {
    min-height: 3rem;
    width: 100%;
  }

  .arcade-controls .score-save-state,
  .arcade-controls span {
    grid-column: 1 / -1;
  }

  .arcade-controls span:last-child {
    font-size: 0.84rem;
  }

  .leaderboard-card {
    margin: 0 1rem 1rem;
    padding: 0.9rem;
  }
}

@media (max-width: 560px) {
  .game-stage-hud {
    padding-right: 0;
    top: 3.8rem;
  }

  .game-status-chip {
    flex: 1 1 100%;
    justify-content: center;
  }

  .arcade-controls {
    grid-template-columns: 1fr;
  }

  .game-frame:fullscreen #factory-flyer,
  .game-frame.game-frame-expanded #factory-flyer {
    width: 100%;
  }
}

@media (min-width: 860px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hero-orb {
    justify-self: end;
    width: 9rem;
    height: 9rem;
    font-size: 4.7rem;
  }
}

.splinterlands-space {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(88, 28, 135, 0.9));
  color: #fff;
}

.splinterlands-panel {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 32%), linear-gradient(135deg, #0f172a, #1e1b4b);
  color: #f8fafc;
}

.splinterlands-panel .section-title,
.splinterlands-panel .section-subtitle,
.splinterlands-panel .eyebrow {
  color: inherit;
}

.splinterlands-account-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.5rem;
  background: rgba(15, 23, 42, 0.62);
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
}

.splinterlands-account-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.splinterlands-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.splinterlands-save-button {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.splinterlands-save-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.26);
}

.splinterlands-save-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.splinterlands-account-header h3 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0;
}

.splinterlands-balance-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.splinterlands-balance-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.splinterlands-balance-card span {
  color: rgba(248, 250, 252, 0.74);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.splinterlands-balance-card strong {
  display: block;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 950;
  letter-spacing: -0.04em;
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .splinterlands-balance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .splinterlands-ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .splinterlands-account-header {
    display: block;
  }
  .splinterlands-balance-grid {
    grid-template-columns: 1fr;
  }
  .splinterlands-ledger-detail-grid {
    grid-template-columns: 1fr;
  }
}

.splinterlands-portfolio-card {
  border: 1px solid rgba(251, 191, 36, 0.36);
  border-radius: 1.5rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(14, 165, 233, 0.14));
  padding: 1.15rem;
}

.splinterlands-portfolio-card span,
.splinterlands-portfolio-card small,
.splinterlands-balance-card small {
  color: rgba(248, 250, 252, 0.72);
  display: block;
  font-weight: 800;
}

.splinterlands-portfolio-card span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.splinterlands-portfolio-card strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 1;
  margin-top: 0.45rem;
}

.splinterlands-portfolio-card small,
.splinterlands-balance-card small {
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.splinterlands-subtabs,
.splinterlands-range-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.splinterlands-ops-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.splinterlands-ops-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.splinterlands-ops-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.22);
  padding: 0.85rem;
}

.splinterlands-ops-card span,
.splinterlands-ops-card small {
  color: rgba(248, 250, 252, 0.76);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
}

.splinterlands-ops-card strong {
  color: #f8fafc;
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
  margin-top: 0.2rem;
}

.splinterlands-subtab,
.splinterlands-range-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.78);
  cursor: pointer;
  font-weight: 850;
  padding: 0.62rem 1rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.splinterlands-subtab:hover,
.splinterlands-range-button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.splinterlands-subtab.active,
.splinterlands-range-button.active {
  background: #fbbf24;
  border-color: rgba(251, 191, 36, 0.9);
  color: #1e1b4b;
  box-shadow: 0 12px 28px rgba(251, 191, 36, 0.22);
}

.splinterlands-history-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.splinterlands-chart-card,
.splinterlands-empty-state {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.splinterlands-empty-state {
  color: rgba(248, 250, 252, 0.82);
  font-weight: 750;
  text-align: center;
}
.splinterlands-empty-state strong,
.splinterlands-empty-state span {
  display: block;
}
.splinterlands-empty-state strong {
  color: #f8fafc;
}
.splinterlands-empty-state span {
  margin-top: 0.35rem;
}
.splinterlands-empty-action {
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  margin-top: 0.75rem;
  padding: 0.48rem 0.85rem;
}
.splinterlands-empty-action:hover,
.splinterlands-empty-action:focus-visible {
  background: rgba(251, 191, 36, 0.24);
  outline: 2px solid rgba(251, 191, 36, 0.45);
  outline-offset: 2px;
}

.splinterlands-chart-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.splinterlands-chart-header span,
.splinterlands-chart-header small {
  color: rgba(248, 250, 252, 0.78);
  font-weight: 850;
}

.splinterlands-chart-header span {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

#splinterlands-history-chart {
  display: block;
  height: auto;
  max-width: 100%;
  min-height: 180px;
  overflow: visible;
  width: 100%;
}

@media (max-width: 700px) {
  .splinterlands-history-summary {
    grid-template-columns: 1fr;
  }

  .splinterlands-ops-grid,
  .splinterlands-analytics-grid,
  .splinterlands-reconciliation-grid {
    grid-template-columns: 1fr;
  }

  .splinterlands-chart-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .splinterlands-ledger-header {
    display: block;
  }
  .splinterlands-ledger-pager {
    margin-top: 0.75rem;
  }
  .splinterlands-ledger-detail-header {
    display: block;
  }
  .splinterlands-ledger-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.splinterlands-asset-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.splinterlands-asset-card:hover,
.splinterlands-asset-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.28);
  outline: none;
}
.splinterlands-asset-detail {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.28);
  padding: 1rem;
}
.splinterlands-analytics-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.splinterlands-metric-card,
.splinterlands-reconciliation-preview,
.splinterlands-unexplained-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.85rem;
}
.splinterlands-metric-card span,
.splinterlands-reconciliation-preview span,
.splinterlands-reconciliation-preview small,
.splinterlands-unexplained-panel span,
.splinterlands-unexplained-panel small {
  color: rgba(248, 250, 252, 0.76);
  font-size: 0.78rem;
  font-weight: 800;
}
.splinterlands-metric-card strong,
.splinterlands-reconciliation-preview strong,
.splinterlands-unexplained-panel strong {
  color: #f8fafc;
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  margin-top: 0.2rem;
}
.splinterlands-reconciliation-title {
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.splinterlands-reconciliation-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0.75rem 0;
}
.splinterlands-unexplained-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.splinterlands-unexplained-header strong {
  font-size: 1rem;
  margin-top: 0;
}
.splinterlands-unexplained-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}
.splinterlands-unexplained-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.22);
  padding: 0.75rem;
}
.splinterlands-unexplained-card strong {
  font-size: 1rem;
}
.splinterlands-unexplained-list {
  display: grid;
  gap: 0.75rem;
}
.splinterlands-unexplained-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.22);
  padding: 0.75rem;
}
.splinterlands-unexplained-row header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.splinterlands-unexplained-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.55rem;
}
.splinterlands-unexplained-meta code {
  color: #fde68a;
  font-size: 0.82rem;
  word-break: break-all;
}
.splinterlands-unexplained-empty {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0.85rem;
  color: rgba(248, 250, 252, 0.82);
}
.splinterlands-table-wrap { overflow-x: auto; }
.splinterlands-ledger-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.24);
  padding: 1rem;
}
.splinterlands-ledger-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.splinterlands-ledger-header strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
}
.splinterlands-ledger-header small {
  color: rgba(248, 250, 252, 0.78);
  display: block;
  font-weight: 800;
  margin-top: 0.2rem;
}
.splinterlands-ledger-pager,
.splinterlands-ledger-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.splinterlands-ledger-controls label {
  color: rgba(248, 250, 252, 0.78);
  display: grid;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 0.25rem;
  min-width: 10rem;
  text-transform: uppercase;
}
.splinterlands-ledger-controls select {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-weight: 800;
  padding: 0.58rem 0.75rem;
}
.splinterlands-ledger-table code {
  color: #fde68a;
  font-size: 0.78rem;
  word-break: break-all;
}
.splinterlands-detail-button {
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.45rem 0.65rem;
}
.splinterlands-detail-button:hover,
.splinterlands-detail-button:focus-visible {
  background: rgba(251, 191, 36, 0.22);
  outline: 2px solid rgba(251, 191, 36, 0.45);
  outline-offset: 2px;
}
.splinterlands-ledger-detail {
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.42);
  padding: 1rem;
}
.splinterlands-ledger-detail-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.splinterlands-ledger-detail-header strong {
  color: #f8fafc;
  display: block;
  font-size: 1.08rem;
  font-weight: 950;
}
.splinterlands-ledger-detail-header small {
  color: rgba(248, 250, 252, 0.76);
  display: block;
  font-weight: 800;
}
.splinterlands-ledger-detail-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.splinterlands-ledger-detail-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.72rem;
}
.splinterlands-ledger-detail-item span,
.splinterlands-ledger-evidence span {
  color: rgba(248, 250, 252, 0.68);
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}
.splinterlands-ledger-detail-item strong {
  color: #f8fafc;
  display: block;
  font-size: 0.9rem;
  font-weight: 850;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}
.splinterlands-ledger-detail-item code {
  color: #fde68a;
  font-size: 0.78rem;
  white-space: normal;
}
.splinterlands-ledger-review {
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.08);
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
}
.splinterlands-ledger-review strong,
.splinterlands-ledger-review label span {
  color: #f8fafc;
  display: block;
  font-weight: 900;
}
.splinterlands-ledger-review label span {
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.74rem;
  text-transform: uppercase;
}
.splinterlands-ledger-review textarea {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.52);
  color: #f8fafc;
  font: inherit;
  font-size: 0.88rem;
  margin-top: 0.35rem;
  min-height: 5.25rem;
  padding: 0.65rem;
  resize: vertical;
  width: 100%;
}
.splinterlands-ledger-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.splinterlands-training-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.splinterlands-training-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.9rem;
}
.splinterlands-training-card-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}
.splinterlands-training-card-header strong {
  color: #f8fafc;
  display: block;
  font-size: 1rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}
.splinterlands-training-meta,
.splinterlands-training-window {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.75rem;
}
.splinterlands-training-meta span,
.splinterlands-training-window span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  padding: 0.45rem 0.55rem;
}
.splinterlands-training-examples {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}
.splinterlands-training-examples li {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
}
.splinterlands-training-examples span,
.splinterlands-training-examples strong,
.splinterlands-training-examples code {
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.76rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.splinterlands-training-examples code {
  color: #fde68a;
}
.splinterlands-rule-suggestion {
  border: 1px solid rgba(251, 191, 36, 0.38);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0;
  padding: 0.7rem;
}
.splinterlands-rule-suggestion > div {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}
.splinterlands-rule-suggestion strong {
  color: #f8fafc;
  display: block;
  font-size: 1rem;
  font-weight: 950;
  text-transform: capitalize;
}
.splinterlands-rule-suggestion p,
.splinterlands-rule-suggestion small {
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}
.splinterlands-rule-suggestion-muted {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.24);
}
.splinterlands-ledger-evidence pre {
  max-height: 24rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font-size: 0.78rem;
  margin: 0.45rem 0 0;
  padding: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.splinterlands-history-table {
  width: 100%;
  border-collapse: collapse;
  color: #f8fafc;
  font-size: 0.9rem;
}
.splinterlands-history-table th,
.splinterlands-history-table td {
  padding: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}
.splinterlands-history-table th {
  color: #fde68a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.splinterlands-history-row-unknown {
  background: rgba(148, 163, 184, 0.08);
}
.splinterlands-classification-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.splinterlands-classification-unknown {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
.splinterlands-status-classified {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}
.splinterlands-status-partial,
.splinterlands-status-needs_review {
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}
.splinterlands-status-reviewed {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.32);
  color: #bbf7d0;
}

@media (max-width: 700px) {
  .splinterlands-ledger-header,
  .splinterlands-ledger-detail-header {
    display: block;
  }
  .splinterlands-ledger-pager {
    margin-top: 0.75rem;
  }
  .splinterlands-ledger-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .splinterlands-training-grid,
  .splinterlands-training-meta,
  .splinterlands-training-window {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .splinterlands-ledger-detail-grid {
    grid-template-columns: 1fr;
  }
  .splinterlands-training-examples li {
    grid-template-columns: 1fr;
  }
}
