/* Olha o Pé!: a quiet layer over the game. Dark glass sheets, one accent (sneaker yellow), the pixel font only
   for the logo and the big numbers, everything else in Inter. css/shell.css gives the page frame, the corner
   buttons, the toasts and the guide below the game. */

body.olhaope {
  --bg: #14161b;
  --glass: rgba(17, 18, 23, 0.82);
  --glass-2: rgba(255, 255, 255, 0.05);
  --edge: rgba(255, 255, 255, 0.09);
  --text: #f2f0ea;
  --muted: #a1a5b0;
  --yellow: #e8b440;
  --yellow-ink: #231900;
  --pink: #ff9ac8;
  --green: #8fdc98;
  --rain: #8fd3ff;
  --r: 16px;
}
body.olhaope .game { background: var(--bg); }
body.olhaope #game { box-shadow: none; }

/* ---------- Sheets ---------- */

.o-sheet {
  position: absolute;
  z-index: 10;
  width: min(420px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 26px 22px 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color: var(--text);
  text-align: center;
  scrollbar-width: thin;
  touch-action: pan-y;
  animation: o-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.o-sheet[hidden] { display: none; }
.o-sheet--small { width: min(360px, calc(100% - 28px)); }
@keyframes o-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.o-h { margin: 0 0 6px; font: 800 20px/1.2 var(--body); letter-spacing: -0.01em; }
.o-sub { margin: 0 0 14px; font: 500 14px/1.45 var(--body); color: var(--muted); }
.o-sub--h { margin: 18px 0 8px; color: var(--text); font-weight: 700; text-align: left; }
.o-note { margin: 14px 0 0; font: 500 12px/1.4 var(--body); color: var(--muted); }

/* ---------- Title ---------- */

.o-title { width: min(440px, calc(100% - 28px)); padding-top: 30px; }
.o-logo { margin: 0 0 10px; font: 400 34px/1.15 var(--pixel); color: #f4f1e6; text-shadow: 0 0.11em 0 #000; letter-spacing: 0.02em; }
/* the font squashes accented capitals: the logo's É is a plain E with a pixel acute */
.o-ac { position: relative; display: inline-block; }
.o-ac::before { content: ""; position: absolute; left: 0.5em; top: -0.3em; width: 0.125em; height: 0.125em; background: currentColor; box-shadow: 0.125em -0.125em 0 currentColor, -0.125em 0 0 currentColor, 0 0.08em 0 #000, 0.125em -0.045em 0 #000, -0.125em 0.08em 0 #000; }
.o-tag { margin: 0 auto 20px; max-width: 24em; font: 500 15px/1.45 var(--body); color: var(--muted); }
.o-chal { margin: -6px auto 16px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 154, 200, 0.12); color: var(--text); font: 600 14px/1.4 var(--body); }
.o-chal[hidden] { display: none; }
.o-chal b { color: var(--pink); }

.o-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.o-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 14px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--glass-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.18s, border-color 0.18s;
}
.o-mode img { width: 76px; height: 76px; image-rendering: pixelated; border-radius: 10px; }
.o-mode b { font: 800 15px/1.2 var(--body); }
.o-mode small { font: 500 12.5px/1.3 var(--body); color: var(--muted); }
.o-mode__go { margin-top: 6px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font: 700 13px/1 var(--body); color: var(--text); transition: background 0.18s, color 0.18s; }
.o-mode__best { font: 600 11.5px/1 var(--body); color: var(--yellow); }
.o-mode__best:empty { display: none; }
.o-mode:hover, .o-mode.is-sel { background: rgba(232, 180, 64, 0.1); border-color: rgba(232, 180, 64, 0.55); }
.o-mode:hover { transform: translateY(-2px); }
.o-mode:hover .o-mode__go, .o-mode.is-sel .o-mode__go { background: var(--yellow); color: var(--yellow-ink); }
.o-mode:active { transform: translateY(0) scale(0.98); }
.o-mode:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.o-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 16px 0 0; }
.o-link { padding: 10px 12px; border: 0; border-radius: 999px; background: none; color: var(--text); font: 600 14px/1 var(--body); cursor: pointer; opacity: 0.82; touch-action: manipulation; }
.o-link:hover { background: rgba(255, 255, 255, 0.07); opacity: 1; }
.o-link:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.o-links--small { margin-top: 12px; }
.o-links--small .o-link { font-size: 13px; color: var(--muted); }
.o-foot { display: grid; gap: 4px; margin: 10px 0 0; font: 500 12px/1.5 var(--body); color: var(--muted); }
.o-foot a { color: var(--muted); text-decoration: none; padding: 4px 2px; }
.o-foot a:hover { color: var(--text); }
.o-foot a[aria-current="true"] { color: var(--text); font-weight: 800; }
.o-counters { color: var(--green); }
.o-counters[hidden] { display: none; }

/* ---------- Buttons ---------- */

.o-cta { display: flex; gap: 8px; margin-top: 14px; }
.o-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 16px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text); font: 700 15px/1 var(--body); cursor: pointer; touch-action: manipulation; transition: transform 0.12s, filter 0.12s; }
.o-btn:hover { filter: brightness(1.15); }
.o-btn:active { transform: scale(0.97); }
.o-btn:focus-visible, .o-close:focus-visible, .o-sb:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.o-btn--go { background: var(--yellow); border-color: transparent; color: var(--yellow-ink); }
.o-close { display: block; margin: 16px auto 0; padding: 10px 18px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 14px/1 var(--body); cursor: pointer; }
.o-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

/* ---------- The end of a run ---------- */

.o-over { width: min(560px, calc(100% - 28px)); }
.o-over__h { margin: 0 0 4px; font: 400 19px/1.35 var(--pixel); color: var(--pink); text-shadow: 0 3px 0 #000; }
.o-over__sub { margin: 0 0 16px; font: 500 14px/1.4 var(--body); color: var(--muted); }
.o-over__sub.is-beat { color: var(--yellow); font-weight: 700; }
.o-over__grid { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: center; text-align: left; }
.o-card { width: 190px; height: 190px; border-radius: 12px; background: #1c1f26; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.o-score { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.o-score b { font: 400 28px/1 var(--pixel); color: var(--yellow); }
.o-score > span:not(.o-new) { font: 600 13px/1 var(--body); color: var(--muted); }
.o-new { padding: 4px 8px; border-radius: 999px; background: var(--yellow); color: var(--yellow-ink); font: 800 11px/1 var(--body); letter-spacing: 0.02em; }
.o-new[hidden] { display: none; }
.o-rankt { margin: 8px 0 0; font: 700 14px/1.3 var(--body); color: var(--green); }
.o-statline { margin: 4px 0 0; font: 500 12.5px/1.45 var(--body); color: var(--muted); }
.o-name { display: flex; gap: 6px; margin: 12px 0 0; }
.o-name[hidden] { display: none; }
.o-name input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: #fff; font: 700 14px/1 var(--body); text-transform: uppercase; }
.o-name input:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
.o-name button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.1); color: var(--text); font: 700 13px/1 var(--body); cursor: pointer; }
.o-name button:disabled { opacity: 0.5; }
.o-rankline { margin: 10px 0 0; font: 600 13px/1.4 var(--body); color: var(--text); }
.o-rankline[hidden] { display: none; }
.o-rankline button { margin-left: 6px; padding: 2px 4px; border: 0; background: none; color: var(--muted); font: 500 12px/1 var(--body); text-decoration: underline; cursor: pointer; }
.o-fact { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--glass-2); text-align: left; font: 500 13.5px/1.5 var(--body); color: #d9d7d1; }
.o-fact b { display: block; margin-bottom: 3px; font: 700 11px/1.3 var(--body); color: var(--pink); text-transform: uppercase; letter-spacing: 0.06em; }
.o-fact a { color: var(--yellow); font-weight: 700; white-space: nowrap; }

/* ---------- Share ---------- */

.o-sharegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.o-sb { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: var(--text); font: 700 14px/1 var(--body); text-decoration: none; cursor: pointer; transition: filter 0.12s, transform 0.12s; }
.o-sb:hover { filter: brightness(1.2); }
.o-sb:active { transform: scale(0.97); }
.o-sb--wa { background: #1f8f4e; border-color: transparent; }
.o-sb[hidden] { display: none; }

/* ---------- Ranking ---------- */

.o-rank { z-index: 12; }
.o-seg { display: flex; gap: 4px; margin: 10px 0 0; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.o-seg button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 700 13px/1 var(--body); cursor: pointer; }
.o-seg button[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.o-seg--small { width: max-content; margin: 8px auto 0; padding: 3px; }
.o-seg--small button { min-height: 28px; padding: 0 12px; font-size: 12px; }
.o-ranklist { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; font: 600 14px/1.3 var(--body); }
.o-ranklist li { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.o-ranklist li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.o-ranklist li.is-you { background: rgba(232, 180, 64, 0.16); }
.o-rk { font: 700 12px/1 var(--body); color: var(--muted); text-align: right; }
.o-ranklist li:first-child .o-rk { color: var(--yellow); }
.o-rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-rp { color: var(--muted); font-size: 12px; text-align: right; }
.o-rv { font: 800 14px/1 var(--body); text-align: right; }
.o-rank-empty, .o-rank-total { margin: 12px 0 0; font: 500 13px/1.5 var(--body); color: var(--muted); }
.o-ranklist .o-rank-gap { display: block; padding: 0; text-align: center; color: var(--muted); background: none; }

/* ---------- Help for real ---------- */

.o-help { z-index: 13; width: min(440px, calc(100% - 28px)); }
.o-helplist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; text-align: left; }
.o-helplist li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--glass-2); }
.o-helplist b { font: 800 14px/1.3 var(--body); }
.o-helplist p { grid-column: 1; margin: 0; font: 500 13px/1.45 var(--body); color: var(--muted); }
.o-helplist a.o-go { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--yellow); color: var(--yellow-ink); font: 800 13px/1 var(--body); text-decoration: none; white-space: nowrap; }
.o-helplist a.o-go:hover { filter: brightness(1.08); }

/* ---------- In play ---------- */

body.olhaope .g-toast { top: max(calc(env(safe-area-inset-top) + 8px), var(--hud-bottom, 80px)); bottom: auto; transform: translate(-50%, -24px); width: min(460px, calc(100% - 24px)); border-top: 0; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); font-size: 13.5px; }
body.olhaope .g-toast.is-on { transform: translate(-50%, 0); }
body.olhaope .g-toast b { font: 700 10px/1.3 var(--body); text-transform: uppercase; letter-spacing: 0.06em; }
body.olhaope .g-icon { border: 0; border-radius: 12px; background: rgba(17, 18, 23, 0.6); box-shadow: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.o-coach { position: absolute; left: 50%; top: max(calc(env(safe-area-inset-top) + 8px), var(--hud-bottom, 80px)); transform: translateX(-50%); z-index: 17; display: flex; align-items: center; gap: 10px; width: min(480px, calc(100% - 24px)); padding: 10px 10px 10px 14px; border-radius: 12px; background: rgba(17, 18, 23, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--text); font: 600 14px/1.4 var(--body); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); animation: o-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.o-coach[hidden] { display: none; }
.o-coach b { flex: none; font: 800 11px/1 var(--body); color: var(--yellow); }
.o-coach span { flex: 1; }
.o-coach button { flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--text); font: 700 12px/1 var(--body); cursor: pointer; }

/* the guide's sources */
.g-about .o-sources { padding-left: 1.1em; }
.g-about .o-sources a { font: 700 13px/1.4 var(--body); white-space: nowrap; }

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  .o-sheet { padding: 22px 16px 14px; }
  .o-logo { font-size: 27px; }
  .o-tag { font-size: 14px; margin-bottom: 16px; }
  .o-mode img { width: 64px; height: 64px; }
  .o-over__grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 12px; }
  .o-card { width: 180px; height: 180px; }
  .o-score { justify-content: center; }
  .o-cta { width: 100%; }
  .o-name { width: 100%; }
}
@media (max-height: 560px) {
  .o-sheet { padding: 14px 16px 10px; }
  .o-logo { font-size: 22px; margin-bottom: 4px; }
  .o-tag { display: none; }
  .o-mode { flex-direction: row; gap: 10px; padding: 8px 10px; text-align: left; }
  .o-mode img { width: 44px; height: 44px; }
  .o-mode small, .o-mode__best { display: none; }
  .o-links { margin-top: 8px; }
  .o-foot { margin-top: 4px; }
  .o-over__grid { grid-template-columns: 130px 1fr; }
  .o-card { width: 130px; height: 130px; }
  .o-fact { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .o-sheet, .o-coach { animation: none; }
  .o-mode, .o-btn, .o-sb { transition: none; }
}

/* ---------- ?poster=1: the share image, the logo over a run in the rain ---------- */

body.is-poster .o-modes, body.is-poster .o-links, body.is-poster .o-foot, body.is-poster .o-coach, body.is-poster .o-chal { display: none; }
body.is-poster .o-title { left: 5%; width: 50%; padding: 40px 30px 36px; }
body.is-poster .o-logo { font-size: 50px; margin-bottom: 16px; }
body.is-poster .o-tag { font-size: 19px; margin-bottom: 18px; color: var(--text); }
body.is-poster .o-title::after { content: "LOCO.LTD/OLHAOPE"; display: block; font: 13px/1 var(--pixel); color: var(--yellow); }

/* teia's text bar at the top (placement "topo"): its height reserved so the page doesn't jump when it loads,
   60 px, 40 px from 1024 px wide; the game takes the rest of the screen */
[data-teia="topo"] { display: block; min-height: 60px; --teia-bar-bg: #101115; --teia-bar-fg: #e6e6e0; }
body.olhaope .game { height: calc(100vh - 60px); height: calc(100svh - 60px); }
@supports (height: 100dvh) {
  body.olhaope.is-playing .game { height: calc(100dvh - 60px); }
}
@media (min-width: 1024px) {
  [data-teia="topo"] { min-height: 40px; }
  body.olhaope .game { height: calc(100vh - 40px); height: calc(100svh - 40px); }
  @supports (height: 100dvh) {
    body.olhaope.is-playing .game { height: calc(100dvh - 40px); }
  }
}
body.is-poster [data-teia="topo"] { display: none; }
body.olhaope.is-poster .game { height: 100vh; }
