body.talos {
  min-height: 100vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(20, 13, 7, 0.55), rgba(20, 13, 7, 0.82)),
    url("../assets/egypt-desert.jpg") center / cover no-repeat fixed,
    #14100a;
  font-family: "Courier New", ui-monospace, monospace;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(216, 196, 154, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 196, 154, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.sigil {
  position: fixed;
  width: 90px;
  fill: none;
  stroke: #d8c49a;
  stroke-width: 2;
  opacity: 0.45;
  filter: drop-shadow(0 0 6px rgba(216, 196, 154, 0.6));
  animation: drift 14s ease-in-out infinite;
  pointer-events: none;
}

.sigil-1 { top: 12%; left: 8%; animation-duration: 16s; }
.sigil-2 {
  top: 70%; left: 12%; width: 60px;
  stroke: #c07a3e;
  filter: drop-shadow(0 0 6px rgba(192, 122, 62, 0.6));
  animation-duration: 12s;
}
.sigil-3 { top: 18%; right: 10%; width: 70px; animation-duration: 18s; animation-delay: -4s; }
.sigil-4 { bottom: 12%; right: 14%; width: 110px; animation-duration: 20s; animation-delay: -8s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

.terminal {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 2rem;
  max-width: 40rem;
  width: 100%;
}

.boot {
  color: #d8b878;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.terminal h1 {
  font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 0.35em;
  line-height: 1.25;
  color: #f0e4c4;
  text-shadow: 0 0 24px rgba(216, 196, 154, 0.4);
  margin-bottom: 0.4rem;
}

.tagline {
  color: #e0c184;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 2.2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  text-align: left;
}

.menu-header {
  margin: 1.2rem 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  color: #e0c184;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.menu-item {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(53, 240, 208, 0.25);
  color: #bfeee2;
  text-decoration: none;
  letter-spacing: 0.25em;
  font-size: 0.85rem;
  background: rgba(6, 18, 16, 0.55);
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.menu-item .arrow { color: #35f0d0; }
.menu-item .note {
  margin-left: auto;
  font-size: 0.65rem;
  color: #3f6f66;
  letter-spacing: 0.15em;
}

.menu-item:hover {
  background: rgba(53, 240, 208, 0.08);
  box-shadow: 0 0 18px rgba(53, 240, 208, 0.25), inset 0 0 12px rgba(53, 240, 208, 0.08);
  color: #ffffff;
}

.menu-item.primary { border-color: rgba(255, 179, 71, 0.5); color: #ffe3b3; }
.menu-item.primary .arrow { color: #ffb347; }
.menu-item.primary:hover {
  background: rgba(255, 179, 71, 0.08);
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.25);
  color: #ffffff;
}

.footer-line {
  margin-top: 2rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #b39b6b;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

body.tool-page { display: block; }

.terminal.tool {
  max-width: 46rem;
  margin: 0 auto;
  text-align: left;
  padding: 2.5rem 1.5rem 4rem;
}

.tool-title {
  font-size: 2rem;
  letter-spacing: 0.5em;
  margin-bottom: 0.6rem;
}

.back { color: #35f0d0; text-decoration: none; }

.notice {
  border: 1px solid rgba(53, 240, 208, 0.3);
  background: rgba(53, 240, 208, 0.06);
  color: #9fe8d8;
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}

.field-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: #3f6f66;
  margin: 1rem 0 0.3rem;
}

textarea,
input[type="password"] {
  width: 100%;
  background: rgba(4, 10, 9, 0.8);
  border: 1px solid rgba(53, 240, 208, 0.3);
  color: #d9fff6;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.6rem 0.7rem;
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
}

textarea:focus,
input[type="password"]:focus {
  border-color: #35f0d0;
  box-shadow: 0 0 10px rgba(53, 240, 208, 0.25);
}

.btn-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn-row button {
  animation: none;
  font-family: inherit;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
}

button.ghost {
  background: transparent;
  color: #5f8f86;
  border: 1px solid rgba(95, 143, 134, 0.5);
}

.error {
  color: #ff7b72;
  font-size: 0.75rem;
  margin-top: 0.6rem;
  min-height: 1em;
}

.out {
  background: rgba(4, 10, 9, 0.8);
  border: 1px solid rgba(53, 240, 208, 0.2);
  padding: 0.8rem;
  font-size: 0.75rem;
  color: #bfeee2;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 4px;
  max-height: 16rem;
  overflow-y: auto;
}

.out.small {
  max-height: 6rem;
  color: #5f8f86;
}

.claims {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.claim {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  border: 1px solid;
}

.claim.ok { color: #66ffcc; border-color: rgba(102, 255, 204, 0.5); }
.claim.bad { color: #ff7b72; border-color: rgba(255, 123, 114, 0.5); }

.hint-line {
  font-size: 0.75rem;
  color: #5f8f86;
  margin: 0.8rem 0 0.2rem;
}

#alg { color: #ffb347; }

#verify-result {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin-top: 0.8rem;
  min-height: 1.2em;
}

.ok { color: #66ffcc; }
.bad { color: #ff7b72; }

.game-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  text-align: left;
}

#board {
  background: rgba(4, 10, 9, 0.85);
  border: 1px solid rgba(53, 240, 208, 0.35);
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(53, 240, 208, 0.15);
  max-width: 100%;
  touch-action: none;
  cursor: crosshair;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 160px;
}

.stat {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: #5f8f86;
}

.stat b {
  color: #ffb347;
  font-size: 1.05rem;
  margin-left: 0.5rem;
}

.next-row {
  display: flex;
  gap: 0.5rem;
}

.next-piece,
#hold-piece {
  background: rgba(4, 10, 9, 0.85);
  border: 1px solid rgba(53, 240, 208, 0.25);
  border-radius: 4px;
}

.hint {
  font-size: 0.65rem;
  color: #3f6f66;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.terminal.hub {
  max-width: 58rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 1.4rem;
  margin-top: 1.8rem;
  text-align: left;
}

.hub-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-col .menu-header {
  margin: 0 0 0.2rem;
}

.hub-col .menu-header:not(:first-child) {
  margin-top: 0.7rem;
}

.hub-text {
  font-size: 0.72rem;
  color: #ead9b5;
  line-height: 1.7;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.icon-bar {
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  margin-top: 2.2rem;
}

.icon-bar a {
  display: block;
  width: 30px;
  height: 30px;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s, filter 0.15s;
}

.icon-bar a:hover {
  opacity: 1;
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(53, 240, 208, 0.8));
}

.icon-bar img {
  width: 100%;
  height: 100%;
}

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

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

.tray-piece {
  background: rgba(4, 10, 9, 0.85);
  border: 1px solid rgba(53, 240, 208, 0.25);
  border-radius: 4px;
  cursor: pointer;
}

.tray-piece.selected {
  border-color: #ffb347;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.5);
}

.tray-piece.placed {
  opacity: 0.22;
  cursor: default;
}

@media (max-width: 820px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* gritty sandy egyptian buttons */
.menu-item.egypt {
  --sand: linear-gradient(160deg, #d8c49a, #bfa678);
  --glow: rgba(216, 196, 154, 0.35);
  --ink: #2e2620;
  border: 2px solid rgba(43, 34, 25, 0.85);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  background: var(--sand);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 248, 230, 0.35),
    inset 0 -3px 6px rgba(74, 60, 44, 0.28);
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.3);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.menu-item.egypt .arrow { color: var(--ink); opacity: 0.75; text-shadow: none; }
.menu-item.egypt .note { color: var(--ink); opacity: 0.65; text-shadow: none; }

.menu-item.egypt:hover {
  color: var(--ink);
  background: var(--sand);
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 16px var(--glow);
}

.menu-item.egypt-sand      { --sand: linear-gradient(160deg, #d8c49a, #bfa678); --glow: rgba(216, 196, 154, 0.4); }
.menu-item.egypt-ochre     { --sand: linear-gradient(160deg, #cf8b4e, #a05f2c); --glow: rgba(207, 139, 78, 0.4); }
.menu-item.egypt-dune      { --sand: linear-gradient(160deg, #caa96e, #a8834f); --glow: rgba(202, 169, 110, 0.4); }
.menu-item.egypt-papyrus   { --sand: linear-gradient(160deg, #cbb98a, #a89468); --glow: rgba(203, 185, 138, 0.4); }
.menu-item.egypt-limestone { --sand: linear-gradient(160deg, #e3d7b8, #c4b592); --glow: rgba(227, 215, 184, 0.45); }
.menu-item.egypt-umber     { --sand: linear-gradient(160deg, #8a6b4a, #5f4630); --glow: rgba(138, 107, 74, 0.45); --ink: #efe3c2; }
.menu-item.egypt-basalt    { --sand: linear-gradient(160deg, #4a4034, #2b241d); --glow: rgba(74, 64, 52, 0.6); --ink: #e8dcc0; }

/* button texts in hieroglyphs, turning into latin letters on hover */
.menu-item .label { font-size: 0; }
.menu-item .label::after {
  content: attr(data-glyph);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  font-family: "Noto Sans Egyptian Hieroglyphs", "Segoe UI Historic", "Segoe UI Symbol", sans-serif;
}
.menu-item:hover .label::after {
  content: attr(data-latin);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  font-family: inherit;
  animation: glyph-in 0.18s ease;
}
@keyframes glyph-in {
  from { opacity: 0.2; transform: translateY(2px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
