:root {
  --bg: #0a0b0d;
  --surface: #16181c;
  --ink: #ecebe7;
  --ink-soft: #8b8d92;
  --line: #292b30;
  --accent: #ecebe7;
  --accent-hover: #d8d6cf;
  --accent-ink: #0a0b0d;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
}

.wordmark {
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
}

.rule {
  width: 36px;
  height: 1px;
  background: var(--line);
  margin: 1.75rem 0;
}

.eyebrow {
  margin: 0 0 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lede {
  margin: 0 0 2.5rem;
  max-width: 380px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.25rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.footer {
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer .sep {
  margin: 0 0.6rem;
  color: var(--line);
}

/* ---- Portal ---- */

.portal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.portal-card {
  width: 100%;
  max-width: 360px;
  padding: 2.75rem 2.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.portal-wordmark {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.portal-title {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2.25rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.portal-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.portal-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.portal-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.portal-message {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.portal-back {
  display: block;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
}

.portal-back:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- Simple content pages ---- */

.doc-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 5rem 1.5rem;
}

.doc {
  width: 100%;
  max-width: 480px;
}

.doc-wordmark {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.doc h1 {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 1.75rem;
}

.doc p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.doc a {
  color: var(--ink);
}

.field-checkbox label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.85rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-checkbox input {
  width: auto;
}

/* ---- Admin ---- */

.admin-main {
  flex: 1;
  padding: 3.5rem 1.5rem 5rem;
  display: flex;
  justify-content: center;
}

.admin-wrap {
  width: 100%;
  max-width: 780px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.admin-header-actions {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
}

.admin-header-actions a {
  color: var(--ink-soft);
  text-decoration: none;
}

.admin-header-actions a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.admin-title {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 2.5rem;
}

.admin-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

.admin-section:last-child {
  border-bottom: none;
}

.admin-section h2 {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.admin-form {
  max-width: 420px;
}

.admin-btn {
  width: auto;
  padding: 0.75rem 1.75rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table th {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

.admin-table td {
  color: var(--ink);
}

.admin-table input[type="text"],
.admin-table input[type="password"] {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-right: 0.4rem;
}

.admin-table-actions a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-right: 0.9rem;
  font-size: 0.8rem;
}

.admin-table-actions a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- App icons (home screen) ---- */

.app-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 2.75rem 2rem;
  padding: 1.5rem 0 1rem;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  position: relative;
}

.app-icon-glyph {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.app-icon-glyph svg {
  width: 100%;
  height: 100%;
}

a.app-icon:hover .app-icon-glyph {
  color: var(--ink);
  transform: translateY(-3px);
}

.app-icon-label {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

a.app-icon:hover .app-icon-label {
  color: var(--ink);
}

.app-icon-disabled {
  cursor: default;
}

.app-icon-disabled .app-icon-glyph {
  color: var(--line);
}

.app-icon-badge {
  margin-top: 0.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.1rem 0.4rem;
}

/* ---- App access checkboxes (admin) ---- */

.app-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.app-checkbox input {
  width: auto;
}

td.app-checkbox-group {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.9rem;
  white-space: normal;
}

/* ---- Notepad ---- */

.notepad-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.notepad-list {
  width: 220px;
  flex-shrink: 0;
}

.notepad-new-btn {
  width: 100%;
  margin-bottom: 1.25rem;
}

.notepad-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.notepad-note-item {
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.notepad-note-item:hover {
  color: var(--ink);
}

.notepad-note-item.active {
  color: var(--ink);
  font-weight: bold;
}

.notepad-editor {
  flex: 1;
  min-width: 0;
}

.notepad-title-input {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  margin-bottom: 1rem;
}

.notepad-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

.notepad-content-input {
  width: 100%;
  min-height: 320px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
}

.notepad-content-input:focus {
  outline: none;
  border-color: var(--accent);
}

.notepad-editor-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.notepad-editor-actions a {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.notepad-editor-actions a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .notepad-layout {
    flex-direction: column;
  }
  .notepad-list {
    width: 100%;
  }
}

/* ---- Hotel search ---- */

.hotel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.hotel-card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.hotel-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.hotel-card-photo-empty {
  background: var(--bg);
}

.hotel-card-body {
  padding: 1rem 1.1rem;
}

.hotel-card-name {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.hotel-card-stars {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.hotel-card-review {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.hotel-card-price {
  font-size: 0.9rem;
  font-weight: bold;
}

/* ---- News ---- */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.news-card {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
}

.news-card:hover .news-card-title {
  text-decoration: underline;
}

.news-card-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.news-card-body {
  min-width: 0;
}

.news-card-title {
  font-size: 0.92rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.news-card-snippet {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.news-card-meta img {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

/* ---- Drive ---- */

.drive-hud {
  display: flex;
  gap: 1.5rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.drive-wrap {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

#drive-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg);
  border: 1px solid var(--line);
}

.drive-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(10, 11, 13, 0.78);
  text-align: center;
  padding: 1.5rem;
}

.drive-overlay[hidden] {
  display: none;
}

.drive-overlay-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drive-overlay-score {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---- Blackjack ---- */

.bj-status {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  min-height: 1.3em;
}

.bj-dealer {
  margin-bottom: 1.5rem;
}

.bj-seats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.bj-seat {
  flex: 1;
  min-width: 220px;
  background: #16241c;
  border: 1px solid #2a3f30;
  padding: 1rem;
  text-align: center;
}

.bj-seat-label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.bj-seat-label span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.bj-hand {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 78px;
  flex-wrap: wrap;
}

.bj-card {
  width: 50px;
  height: 72px;
  border-radius: 4px;
  background: #ecebe7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.bj-card.red {
  color: #b23b3b;
}

.bj-card.black {
  color: #1b1c1f;
}

.bj-rank {
  font-size: 1.05rem;
  font-weight: 700;
}

.bj-suit {
  font-size: 1.1rem;
}

.bj-card.back {
  background: repeating-linear-gradient(45deg, #16181c, #16181c 5px, #1f2127 5px, #1f2127 10px);
  border: 2px solid #d9a441;
}

.bj-bet-line {
  margin-top: 0.6rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

/* ---- Roulette ---- */

.rl-hud {
  display: flex;
  gap: 1.5rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.rl-wheel-wrap {
  position: relative;
  width: 300px;
  margin: 0 auto 0.75rem;
}

#rl-wheel {
  display: block;
  width: 100%;
  height: auto;
}

#rl-wheel-group {
  transition: transform 4.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  transform-origin: 150px 150px;
}

.rl-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid #d9a441;
  z-index: 2;
}

.rl-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a2c31, #0a0b0d);
  border: 2px solid #d9a441;
}

.rl-result {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 1.5rem;
  min-height: 1.4em;
}

.rl-table {
  max-width: 560px;
  margin: 0 auto;
}

.rl-grid {
  display: flex;
  gap: 3px;
}

.rl-numbers {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.rl-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.rl-zero {
  width: 34px;
}

.rl-cell.red {
  background: #b23b3b;
}

.rl-cell.black {
  background: #1b1c1f;
}

.rl-cell.green {
  background: #3a8f5b;
}

.rl-outside {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-top: 3px;
}

.rl-outside-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  padding: 0.6rem 0.3rem;
}

.rl-outside-cell.red {
  background: #b23b3b;
}

.rl-outside-cell.black {
  background: #1b1c1f;
}

.rl-chip-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 50%;
  background: #d9a441;
  color: #0a0b0d;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0a0b0d;
}

.rl-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.rl-controls[hidden] {
  display: none;
}

.rl-chips {
  display: flex;
  gap: 0.5rem;
}

.rl-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px dashed rgba(236, 235, 231, 0.4);
  background: var(--surface);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.7rem;
  cursor: pointer;
}

.rl-chip.selected {
  border-style: solid;
  border-color: #d9a441;
  color: #d9a441;
}

/* ---- Connect Four ---- */

.c4-lobby {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.c4-lobby-option {
  flex: 1;
  min-width: 200px;
}

.c4-status {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  min-height: 1.3em;
}

.c4-board {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px;
  width: fit-content;
  margin: 0 auto;
}

.c4-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c4-column.clickable {
  cursor: pointer;
}

.c4-column.clickable:hover {
  background: rgba(236, 235, 231, 0.06);
}

.c4-cell {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.c4-cell.p1 {
  background: var(--ink);
  border-color: var(--ink);
}

.c4-cell.p2 {
  background: #c96a6a;
  border-color: #c96a6a;
}

.c4-code-line {
  text-align: center;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}

/* ---- Wordle ---- */

.wordle-wrap {
  max-width: 420px;
}

.wordle-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 1.5rem 0 2rem;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.wordle-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
}

.wordle-tile.filled {
  border-color: var(--ink-soft);
}

.wordle-tile.correct {
  background: #2f6b3a;
  border-color: #2f6b3a;
  color: #ecebe7;
}

.wordle-tile.present {
  background: #8a6d1f;
  border-color: #8a6d1f;
  color: #ecebe7;
}

.wordle-tile.absent {
  background: var(--line);
  border-color: var(--line);
  color: var(--ink-soft);
}

.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wordle-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.wordle-key {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.7rem 0.55rem;
  min-width: 2rem;
  border: none;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  border-radius: 3px;
}

.wordle-key.wide {
  min-width: 3.2rem;
  font-size: 0.65rem;
}

.wordle-key:hover {
  background: var(--line);
}

.wordle-key.correct {
  background: #2f6b3a;
  color: #ecebe7;
}

.wordle-key.present {
  background: #8a6d1f;
  color: #ecebe7;
}

.wordle-key.absent {
  background: #1c1e22;
  color: var(--ink-soft);
}

/* ---- Status bar (location / time / weather) ---- */

.status-bar {
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---- Life Sim ---- */

.lifesim-wrap {
  max-width: 560px;
}

.lifesim-topline {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.lifesim-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.lifesim-stat {
  background: var(--surface);
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.lifesim-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.lifesim-stat-value {
  font-size: 1rem;
  font-weight: 600;
}

.lifesim-age {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.lifesim-narrative {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.lifesim-narrative p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.lifesim-choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lifesim-choice-btn {
  width: 100%;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  text-align: left;
  padding: 0.85rem 1.1rem;
}

.lifesim-death-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.lifesim-achievement-list {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.lifesim-tabs {
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.lifesim-tab {
  flex: 1;
  white-space: nowrap;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
  border: none;
  cursor: pointer;
}

.lifesim-tab:hover {
  color: var(--ink);
}

.lifesim-tab.active {
  color: var(--accent-ink);
  background: var(--accent);
}

.lifesim-relationship-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.lifesim-relationship-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.lifesim-relationship-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.lifesim-relationship-type {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: capitalize;
}

.lifesim-relationship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lifesim-mini-btn {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.lifesim-mini-btn:hover {
  border-color: var(--ink-soft);
}

.lifesim-mini-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 560px) {
  .lifesim-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- Server status ---- */

.status-page {
  max-width: 420px;
}

.status-banner {
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  margin-bottom: 2rem;
  color: var(--ink-soft);
}

.status-banner.ok {
  color: #5fae6c;
  border-color: #5fae6c;
}

.status-banner.down {
  color: #c96a6a;
  border-color: #c96a6a;
}

.status-rows {
  border-top: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-soft);
  vertical-align: middle;
}

.mono-cell .status-dot,
td .status-dot {
  margin-right: 0.5rem;
}

.status-dot.ok {
  background: #5fae6c;
}

.status-dot.down {
  background: #c96a6a;
}

.status-row-label {
  flex: 1;
}

.status-row-detail {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.status-checked {
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

/* ---- Admin control panel ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.1rem 0.75rem;
  text-align: center;
}

.stat-card-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.stat-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section-index {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--ink-soft);
  margin-right: 0.4rem;
}

.mono-cell {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- ADS-B background map (homepage) ---- */

body.home .page {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

body.home .btn,
body.home .footer a {
  pointer-events: auto;
}

#adsb-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  outline: none;
}

#adsb-map.maplibregl-map {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#adsb-map .maplibregl-ctrl-attrib {
  background: transparent;
  color: rgba(139, 141, 146, 0.4);
  font-size: 0.55rem;
  padding: 0 4px;
}

#adsb-map .maplibregl-ctrl-attrib a {
  color: rgba(139, 141, 146, 0.55);
}

#adsb-map .maplibregl-ctrl-attrib.maplibregl-compact::after {
  background-color: rgba(139, 141, 146, 0.4);
}

#adsb-map .maplibregl-ctrl-attrib-button {
  opacity: 0.5;
}

.adsb-plane {
  width: 20px;
  height: 20px;
  color: rgba(236, 235, 231, 0.6);
  cursor: pointer;
  transition: transform 4s linear, color 0.2s ease;
}

.adsb-plane:hover {
  color: rgba(236, 235, 231, 0.95);
}

.adsb-plane svg {
  display: block;
}

.adsb-plane path {
  fill: currentColor;
}

.adsb-tooltip .maplibregl-popup-content {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.55rem;
  box-shadow: none;
  white-space: nowrap;
}

.adsb-tooltip .maplibregl-popup-tip {
  border-top-color: var(--line);
  border-bottom-color: var(--line);
}
