/* altitudedevlabs.com: the game's own colours (app ui/theme), dark only, as the game is. */
:root {
  --ink: #0B0D12;
  --ink-raised: #141821;
  --ink-border: #232A38;
  --bone: #E8E6E1;
  --bone-dim: #9AA0AC;
  --blood: #C1292E;
  --ember: #E8A33D;
  --wall: #E8E6E1;
  --radius: 18px;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Noto Serif", Georgia, serif;
  color-scheme: dark;
}
:lang(ar) { --sans: "Noto Kufi Arabic", "Noto Sans", system-ui, sans-serif; --serif: "Noto Kufi Arabic", serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 16px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ember); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 7vw, 4rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-top: .2em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
section.wrap { padding-block: 40px; }
.lead { font-size: 1.15rem; color: var(--bone); max-width: 62ch; }
.dim, .small { color: var(--bone-dim); }
.small { font-size: .85rem; }
.skip { position: absolute; top: 8px; inset-inline-start: 16px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; z-index: 9; background: var(--ember); color: var(--ink); padding: 6px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* --- nav --- */
header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink-border); }
.nav { width: min(1120px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bone); font-weight: 800; font-family: var(--serif); font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.links { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; }
.links a { color: var(--bone-dim); font-weight: 600; padding: 6px 0; }
.links a[aria-current="page"], .links a:hover { color: var(--bone); text-decoration: none; }
.links .lang { border: 1px solid var(--ink-border); border-radius: 999px; padding: 4px 12px; color: var(--bone); }
@media (max-width: 560px) {
  .nav { padding-block: 8px; }
  .links { width: 100%; justify-content: space-between; font-size: .92rem; }
}

/* --- buttons --- */
.btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 14px; padding: 12px 20px; font-weight: 800; border: 1px solid transparent; background: var(--ember); color: var(--ink); cursor: pointer; font: 800 1rem var(--sans); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--ink-border); color: var(--bone); }
.btn.play { background: var(--blood); color: #fff; box-shadow: 0 6px 28px -8px var(--blood); }
.btn.play span { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.btn.play small { font-weight: 600; font-size: .75rem; opacity: .85; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 16px; }

/* --- hero --- */
.hero { position: relative; overflow: hidden; padding-block: 48px 24px; background: radial-gradient(ellipse at 70% 0%, #1d2230 0%, var(--ink) 60%); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero-shot img { width: min(320px, 100%); margin-inline: auto; border-radius: 24px; box-shadow: 0 30px 80px -30px #000, 0 0 0 1px var(--ink-border); }
.kicker { color: var(--blood); font-weight: 800; letter-spacing: .04em; margin-bottom: .4em; }
.facts { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: 999px; padding: 4px 12px; color: var(--bone-dim); font-size: .9rem; }
.facts b { color: var(--bone); }
.hero-eyes i { position: absolute; width: 18px; height: 6px; animation: blink 6s infinite; }
.hero-eyes i::before, .hero-eyes i::after { content: ""; position: absolute; top: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.hero-eyes i::before { left: 0; } .hero-eyes i::after { right: 0; }
.hero-eyes i:nth-child(1) { top: 12%; left: 6%; animation-delay: .3s; }
.hero-eyes i:nth-child(2) { top: 30%; left: 48%; animation-delay: 2.1s; }
.hero-eyes i:nth-child(2)::before, .hero-eyes i:nth-child(2)::after { background: var(--blood); box-shadow: 0 0 10px var(--blood); }
.hero-eyes i:nth-child(3) { top: 78%; left: 3%; animation-delay: 3.7s; }
.hero-eyes i:nth-child(4) { top: 8%; right: 4%; animation-delay: 1.2s; }
.hero-eyes i:nth-child(5) { top: 58%; right: 2%; animation-delay: 4.6s; }
@keyframes blink { 0%, 44%, 50%, 100% { transform: scaleY(1); opacity: .85; } 47% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .hero-eyes i { animation: none; } }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot { display: none; }
}

/* --- screenshots --- */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 62vw); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.shots figure { margin: 0; scroll-snap-align: start; position: relative; }
.shots img { border-radius: 18px; border: 1px solid var(--ink-border); }
.shots figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- features --- */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.feature { background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); padding: 20px; }
.feature h3 { color: var(--ember); }
.feature p { color: var(--bone-dim); margin: 0; }

/* --- portraits --- */
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.portraits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.portrait { background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); padding: 12px; color: var(--bone); text-align: center; font-weight: 600; }
.portrait:hover { border-color: var(--ember); text-decoration: none; }
.portrait img { margin-bottom: 8px; border-radius: 12px; }

.drowned { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: linear-gradient(120deg, #0f2630, var(--ink) 70%); border: 1px solid #1f4a57; border-radius: var(--radius); padding: 24px !important; }
.drowned-art { display: flex; }
.drowned-art img { width: 84px; height: 84px; border-radius: 50%; border: 2px solid #1f4a57; background: #0b1c22; margin-inline-end: -18px; }
@media (max-width: 560px) { .drowned { grid-template-columns: 1fr; } }

.faint { text-align: center; }
.faint .cta { justify-content: center; }

/* --- pages --- */
.page-head { padding-top: 48px !important; }
.lost { text-align: center; } .lost img { margin: 0 auto 16px; border-radius: 50%; }

/* --- rules --- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.rule { background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); padding: 20px; }
.rule p { color: var(--bone-dim); margin: 0; }
.mini, .board { direction: ltr; }
.mini { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 176px; aspect-ratio: 1; margin: 0 auto 16px; border: 2px solid var(--wall); border-radius: 6px; overflow: hidden; }
.mini .c, .board .c { position: relative; border: 1px solid rgba(255,255,255,.07); display: grid; place-items: center; }
.mini .c img { width: 78%; }
.mini em, .board em { position: absolute; top: 2px; inset-inline-start: 4px; font-style: normal; font-weight: 800; font-size: .72rem; color: var(--bone); text-shadow: 0 1px 2px #000; }
.mini .c.bad, .board .c.bad { box-shadow: inset 0 0 0 3px var(--blood); }
/* Room colours: muted, as the game's default room style. */
.g0 { background: #2b3550; } .g1 { background: #4a2f3f; } .g2 { background: #2f4a3c; } .g3 { background: #4d4129; }
.g4 { background: #3b2f55; } .g5 { background: #24434d; } .g6 { background: #4f3326; } .g7 { background: #3a3f2a; }

/* --- practice board --- */
.play-area { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .play-area { grid-template-columns: 1fr; } }
.board { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 100%; max-width: 440px; aspect-ratio: 1; border: 3px solid var(--wall); border-radius: 8px; overflow: hidden; user-select: none; touch-action: manipulation; }
.board .c { border-width: 2px; cursor: pointer; padding: 0; background-clip: padding-box; font: inherit; color: inherit; }
.board .c:hover { filter: brightness(1.2); }
.board .c.x::after { content: "×"; font-size: clamp(1rem, 5vw, 1.8rem); color: rgba(232,230,225,.45); }
.board .c img { width: 76%; pointer-events: none; }
.status { font-weight: 800; font-size: 1.1rem; }
.won { background: var(--ink-raised); border: 1px solid var(--ember); border-radius: var(--radius); padding: 16px; }
.tips { padding-inline-start: 1.2em; } .tips li { margin-bottom: .5em; }

/* --- monsters page --- */
.monsters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.monster { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); padding: 14px; scroll-margin-top: 80px; }
.monster:target { border-color: var(--ember); }
.monster img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; }
.monster h3 { margin-bottom: .2em; }
.monster .ch { color: var(--bone-dim); font-size: .8rem; font-weight: 600; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.monster .blurb { color: var(--bone-dim); font-style: italic; font-size: .95rem; margin-bottom: .4em; }
.monster details { font-size: .92rem; } .monster summary { cursor: pointer; color: var(--ember); }
.monster details p { margin: .4em 0 0; color: var(--bone); }
.starter { max-width: 560px; border-color: var(--ember); }
.drowned-list .monster { background: linear-gradient(135deg, #0f2630, var(--ink-raised)); border-color: #1f4a57; }

/* --- live boards --- */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.board-card { background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); padding: 16px 18px; }
.board-card h3 { color: var(--ember); }
.board-card ol { list-style: none; margin: 0; padding: 0; }
.board-card li { display: grid; grid-template-columns: 2.2em 36px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ink-border); }
.board-card li:last-child { border-bottom: 0; }
.board-card .rank { color: var(--bone-dim); font-weight: 800; text-align: center; }
.board-card li:nth-child(1) .rank { color: var(--ember); }
.board-card .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--ink); }
.board-card .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board-card .score { color: var(--bone-dim); font-variant-numeric: tabular-nums; }
.news p { margin: 0 0 .6em; }

/* --- studio --- */
.studio-hero { padding-top: 72px !important; }
.game-card { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--ink-raised); border: 1px solid var(--ink-border); border-radius: var(--radius); overflow: hidden; color: var(--bone); margin-bottom: 16px; }
.game-card:hover { border-color: var(--ember); text-decoration: none; }
.game-card img { width: 100%; height: 100%; object-fit: cover; }
.game-card-text { padding: 24px; }
.game-card-text p { color: var(--bone-dim); }
.game-card .more { color: var(--ember); font-weight: 800; }
@media (max-width: 720px) { .game-card { grid-template-columns: 1fr; } }

/* --- footer --- */
.foot { border-top: 1px solid var(--ink-border); margin-top: 40px; padding-block: 24px; color: var(--bone-dim); }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot a { color: var(--bone-dim); } .foot a:hover { color: var(--bone); }
