/* Cimenta, Dudu!: the Praça Osório game. The shell comes from css/game.css; this turns it to concrete,
   safety yellow and araucária green, and adds the levels, the ranking, the stars and the play buttons. */

body.cimenta {
  --bg: #1b1f2a;
  --panel: rgba(28, 30, 38, 0.95);
  --line: #5a5f6c;
  --yellow: #ffcc1f;
  --green: #7bd88a;
}
body.cimenta .game {
  background:
    repeating-linear-gradient(135deg, rgba(255, 204, 31, 0.05) 0 18px, transparent 18px 36px),
    radial-gradient(60% 50% at 50% 40%, rgba(120, 140, 120, 0.25), transparent 70%),
    var(--bg);
}
body.cimenta #game { box-shadow: 0 0 0 2px #2a2e38, 0 20px 60px rgba(0, 0, 0, 0.6); }

/* The panels: concrete with a hazard stripe on top */
body.cimenta .g-panel {
  border-color: #6b7080;
  box-shadow: 0 0 0 3px #000, 0 24px 60px rgba(0, 0, 0, 0.6);
  background-image: repeating-linear-gradient(135deg, #ffcc1f 0 10px, #1a1622 10px 20px);
  background-size: 100% 8px;
  background-repeat: no-repeat;
  background-color: var(--panel);
  padding-top: 26px;
}
.c-logo { display: block; font-size: 22px; line-height: 1.3; color: #e6e6e0; text-shadow: 3px 3px 0 #000, 0 0 0 #000; letter-spacing: 0.02em; }
body.cimenta .g-h__kicker { color: var(--yellow); }
body.cimenta .g-route { color: #c8c8c2; }
body.cimenta .g-btn--go { background: var(--yellow); color: #2a1f00; }
body.cimenta .g-lang a[aria-current="true"] { color: #2a1f00; background: var(--yellow); border-color: #fff0a8; }
body.cimenta .g-more { color: var(--yellow); }

.c-sub { margin: 16px 0 8px; font: 10px/1.4 var(--pixel); color: #c8c8c2; }
.c-levels { list-style: none; margin: 0 auto 12px; padding: 0; max-width: 420px; display: grid; gap: 6px; text-align: left; }
.c-level { display: block; }
.c-level__btn, .c-level.is-locked { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 2px solid #4a4f5c; background: #2a2e38; color: var(--text); font: inherit; text-align: left; }
.c-level__btn { cursor: pointer; border-color: var(--yellow); box-shadow: 0 3px 0 #000; touch-action: manipulation; }
.c-level__btn:hover { filter: brightness(1.12); }
.c-level__btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.c-level.is-locked { opacity: 0.6; }
.c-level__n { display: grid; place-items: center; width: 30px; height: 30px; background: var(--yellow); color: #2a1f00; font: 11px/1 var(--pixel); }
.c-level.is-locked .c-level__n { background: #4a4f5c; color: #c8c8c2; }
.c-level__body b { display: block; font: 700 15px/1.25 var(--body); }
.c-level__body small { display: block; font: 500 12px/1.35 var(--body); color: var(--muted); }
.c-level__stars { font: 14px/1 var(--body); color: var(--yellow); letter-spacing: 1px; white-space: nowrap; }
.c-level__tag { font: 8px/1.3 var(--pixel); color: #c8c8c2; border: 1px solid #6b7080; padding: 4px 6px; white-space: nowrap; }
.c-btn-rank { margin-top: 2px; }

/* The shell's buttons set a display, which beats [hidden] */
body.cimenta .g-btn[hidden] { display: none; }

/* Ranking: over the results panel when opened from it */
.c-rank { z-index: 12; }
.c-ranklist { list-style: none; margin: 8px 0 10px; padding: 0; text-align: left; font: 600 14px/1.3 var(--body); }
.c-ranklist li { display: grid; grid-template-columns: 26px 1fr auto 40px auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #3a3e4a; }
.c-ranklist li.is-you { background: rgba(255, 204, 31, 0.16); outline: 1px solid var(--yellow); }
.c-rk { font: 10px/1 var(--pixel); color: var(--yellow); text-align: right; }
.c-rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-rs { color: var(--yellow); font-size: 12px; letter-spacing: 1px; }
.c-rp { color: var(--muted); text-align: right; font-size: 13px; }
.c-rv { font: 10px/1 var(--pixel); text-align: right; }
.c-rank-empty { margin: 10px 0; color: var(--muted); font: 500 14px/1.5 var(--body); }

/* The end of a level */
.c-stars { margin: 0 0 4px; font: 30px/1 var(--body); color: var(--yellow); letter-spacing: 6px; text-shadow: 2px 2px 0 #000; }
.c-over-sub { margin: 4px auto 10px; max-width: 30em; font: 500 14px/1.45 var(--body); color: var(--muted); }
.c-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 8px auto 6px; max-width: 460px; text-align: left; }
.c-stats div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #3a3e4a; }
.c-stats dt { font: 500 13px/1.3 var(--body); color: var(--muted); }
.c-stats dd { margin: 0; font: 9px/1.5 var(--pixel); color: var(--text); white-space: nowrap; }
.c-stats .c-total { grid-column: 1 / -1; border-bottom: 0; border-top: 2px solid var(--yellow); padding-top: 8px; }
.c-stats .c-total dt { font: 700 15px/1.3 var(--body); color: var(--text); }
.c-stats .c-total dd { font-size: 14px; color: var(--yellow); }
.c-title { margin: 8px 0 0; font: 10px/1.5 var(--pixel); color: var(--green); }
.c-name { margin: 12px auto 4px; max-width: 360px; }
.c-name[hidden] { display: none; }
.c-name label { display: block; margin-bottom: 6px; font: 700 14px/1.4 var(--body); color: var(--yellow); }
.c-name__row { display: flex; gap: 8px; }
.c-name input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; border: 2px solid var(--yellow); background: #12141a; color: #fff; font: 14px/1 var(--pixel); text-transform: uppercase; }
.c-name input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* While playing: the video button and the ribbon to open the square, above the minimap's corner */
.c-actions { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom), var(--hud-low, 0px)); transform: translateX(-50%); z-index: 16; display: flex; gap: 8px; pointer-events: none; }
.c-act { pointer-events: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 2px solid #000; background: #2a2e38; color: #fff; font: 9px/1 var(--pixel); cursor: pointer; touch-action: manipulation; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.15), 0 4px 0 #000; }
.c-act[hidden] { display: none; }
.c-act:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.c-act:disabled { opacity: 0.55; cursor: default; }
.c-act--go { background: var(--yellow); color: #2a1f00; animation: pulse 1.2s ease-in-out infinite; }
.c-act:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
body:not(.is-playing) .c-actions { display: none; }

/* Facts drop in from the top, under the HUD, clear of the cement gauge and the minimap */
body.cimenta .g-toast { top: max(calc(env(safe-area-inset-top) + 8px), var(--hud-bottom, 120px)); bottom: auto; transform: translate(-50%, -30px); width: min(520px, calc(100% - 24px)); }
body.cimenta .g-toast.is-on { transform: translate(-50%, 0); }
@media (max-width: 520px) {
  body.cimenta .g-toast { font-size: 13px; }
  .c-logo { font-size: 18px; }
  .c-stats { grid-template-columns: 1fr; }
  .c-act { font-size: 8px; padding: 0 10px; }
}
@media (max-height: 520px) {
  .c-sub, .c-levels { display: none; }
  .c-logo { display: inline; font-size: 15px; }
  .c-stats { grid-template-columns: 1fr 1fr 1fr; }
  .c-stars { font-size: 22px; }
}

/* The guide's sources */
.g-about .c-sources { padding-left: 1.1em; }
.g-about .c-sources a { font: 700 13px/1.4 var(--body); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .c-act--go { animation: none; }
}

/* ?poster=1: the share image, the title over a game in progress */
body.is-poster .c-sub, body.is-poster .c-levels, body.is-poster .c-btn-rank, body.is-poster .c-actions { display: none; }
body.is-poster .g-panel--title { padding-top: 34px; }
body.is-poster .g-h__kicker { font-size: 16px; color: var(--yellow); }
body.is-poster .c-logo { font-size: 40px; line-height: 1.25; margin: 6px 0 4px; }
body.is-poster .g-route { font-size: 13px; }
body.is-poster .g-panel--title::after { content: "LOCO.LTD/CIMENTEL"; display: block; margin-top: 18px; font: 12px/1 var(--pixel); color: #c8c8c2; }

/* A friend's challenge on the title screen */
.c-challenge { margin: 0 auto 12px; max-width: 30em; padding: 9px 12px; border: 2px solid #ff9ac8; background: rgba(255, 95, 162, 0.12); font: 600 14px/1.45 var(--body); color: var(--text); }
.c-challenge[hidden] { display: none; }
.c-challenge b { display: block; margin-bottom: 3px; font: 9px/1.3 var(--pixel); color: #ff9ac8; }

/* Share buttons: on the title (invite) and on the results (your card) */
.c-invite { margin: 12px auto 0; max-width: 420px; }
.c-invite__h, .c-share__h { margin: 0 0 6px; font: 9px/1.4 var(--pixel); color: #c8c8c2; }
.c-sharebtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.c-sb { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border: 2px solid #000; background: #2a2e38; color: #fff; font: 700 13px/1 var(--body); text-decoration: none; cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 #000; }
.c-sb:hover { filter: brightness(1.15); }
.c-sb:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.c-sb:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.c-sb--go { background: var(--yellow); color: #2a1f00; font-family: var(--pixel); font-size: 9px; font-weight: 400; }
.c-sb--wa { background: #1f8f4e; }
.c-share { display: flex; gap: 14px; align-items: center; margin: 14px auto 12px; max-width: 640px; text-align: left; }
.c-card { flex: none; width: 150px; height: 150px; image-rendering: auto; border: 2px solid #000; box-shadow: 0 4px 0 #000; background: #1b1f2a; }
.c-share__side { flex: 1; min-width: 0; }
.c-share .c-sharebtns { justify-content: flex-start; }
.c-vs { margin: 6px auto 0; max-width: 30em; font: 700 14px/1.4 var(--body); color: #ff9ac8; }
.c-vs[hidden] { display: none; }
.c-vs.is-beat { color: var(--yellow); }
@media (max-width: 520px) {
  .c-share { flex-direction: column; text-align: center; }
  .c-share .c-sharebtns { justify-content: center; }
  .c-card { width: 200px; height: 200px; }
}
@media (max-height: 520px) {
  .c-invite { display: none; }
  .c-card { width: 110px; height: 110px; }
}
body.is-poster .c-invite, body.is-poster .c-challenge { display: none; }

/* The global ranking: tabs, the record to beat, your position */
.c-tabs { display: flex; justify-content: center; gap: 4px; margin: 4px 0 6px; }
.c-tabs button { min-height: 36px; padding: 0 10px; border: 2px solid #4a4f5c; background: #2a2e38; color: var(--muted); font: 700 12px/1 var(--body); cursor: pointer; }
.c-tabs button[aria-selected="true"] { border-color: var(--yellow); color: #2a1f00; background: var(--yellow); }
.c-tabs button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.c-record { margin: 6px 0 0; font: 9px/1.5 var(--pixel); color: var(--yellow); }
.c-record[hidden] { display: none; }
.c-rank-msg { margin: 10px auto 0; max-width: 30em; font: 700 15px/1.4 var(--body); color: var(--yellow); }
.c-rank-msg[hidden] { display: none; }
.c-rank-total { margin: 4px 0 0; font: 500 12px/1.4 var(--body); color: var(--muted); }
.c-ranklist .c-rank-gap { display: block; padding: 2px 0; border: 0; text-align: center; color: var(--muted); }
.c-name button:disabled { opacity: 0.6; }

/* ---------- The title screen: the pitch, the three steps with their animation, one button ---------- */
.c-how { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 14px; align-items: center; margin: 12px auto 14px; max-width: 560px; text-align: left; }
.c-how__anim { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; image-rendering: pixelated; border: 2px solid #000; box-shadow: 0 4px 0 #000; background: #437f3a; }
.c-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.c-steps li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border: 2px solid transparent; font: 600 14px/1.35 var(--body); color: var(--muted); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.c-steps li b { display: grid; place-items: center; width: 24px; height: 24px; background: #3a3e4a; color: #fff; font: 10px/1 var(--pixel); }
.c-steps li.is-on { color: var(--text); border-color: var(--yellow); background: rgba(255, 204, 31, 0.08); }
.c-steps li.is-on b { background: var(--yellow); color: #2a1f00; }
.c-warn { grid-column: 1 / -1; margin: 0; font: 600 13px/1.4 var(--body); color: #ff9ac8; text-align: center; }
.c-title-row { display: flex; justify-content: center; gap: 8px; margin: 12px 0 0; }
/* The level picker: two buttons side by side, the one in play lit */
.c-lvpick { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0 auto 12px; max-width: 460px; }
.c-lvpick__h { flex-basis: 100%; font: 400 8px/1.4 var(--pixel); color: #9ba8cc; letter-spacing: 0.04em; }
.c-lvpick__b { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 10px; border: 2px solid #4a4f5c; background: #2a2e38; color: #c8c8c2; font: 700 13px/1.15 var(--body); text-align: left; cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 #000; }
.c-lvpick__b b { display: inline-grid; place-items: center; width: 20px; height: 20px; background: #4a4f5c; color: #e6e6e0; font: 400 9px/1 var(--pixel); }
.c-lvpick__b[aria-checked="true"] { border-color: var(--yellow); color: #fff; background: #343947; }
.c-lvpick__b[aria-checked="true"] b { background: var(--yellow); color: #2a1f00; }
.c-lvpick__b:hover { filter: brightness(1.15); }
.c-lvpick__b:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.c-lvpick__b:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.c-lvpick__stars { color: var(--yellow); font-size: 12px; letter-spacing: 1px; }
.c-lvpick__new { padding: 2px 4px; background: #ff5fa2; color: #fff; font: 400 7px/1 var(--pixel); }
.c-title-row .c-sb { font-size: 14px; }
body.cimenta .g-panel--title .g-disclaimer a { color: var(--yellow); }
@media (max-width: 560px) {
  .c-how { grid-template-columns: 1fr; gap: 8px; }
  .c-how__anim { max-width: 300px; margin: 0 auto; }
  .c-steps li { font-size: 13px; padding: 4px 6px; }
}
@media (max-height: 520px) {
  .c-how { grid-template-columns: 200px 1fr; margin: 6px auto 8px; }
  .c-steps li { font-size: 12px; padding: 2px 6px; }
  .c-warn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .c-steps li { transition: none; }
}

/* ---------- The first game's hints, above the play buttons ---------- */
.c-coach { position: absolute; left: 50%; bottom: calc(max(10px, env(safe-area-inset-bottom), var(--hud-low, 0px)) + 58px); transform: translateX(-50%); z-index: 17; display: flex; align-items: center; gap: 10px; width: min(520px, calc(100% - 24px)); padding: 10px 12px; background: var(--paper); color: var(--ink); border: 3px solid #000; border-top: 6px solid var(--yellow); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font: 700 15px/1.35 var(--body); }
.c-coach[hidden] { display: none; }
.c-coach b { flex: none; font: 10px/1 var(--pixel); color: var(--press-red); }
.c-coach span { flex: 1; }
.c-coach button { flex: none; min-height: 36px; padding: 0 10px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 12px/1 var(--body); cursor: pointer; }
@media (max-width: 520px) { .c-coach { font-size: 13px; } }

/* the poster shows only the title */
body.is-poster .c-how, body.is-poster .c-lvpick, body.is-poster .c-title-row, body.is-poster .c-record, body.is-poster .c-coach { display: none; }

/* 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: #14101c; --teia-bar-fg: #e6e6e0; }
body.cimenta .game { height: calc(100vh - 60px); height: calc(100svh - 60px); }
@supports (height: 100dvh) {
  body.cimenta.is-playing .game { height: calc(100dvh - 60px); }
}
@media (min-width: 1024px) {
  [data-teia="topo"] { min-height: 40px; }
  body.cimenta .game { height: calc(100vh - 40px); height: calc(100svh - 40px); }
  @supports (height: 100dvh) {
    body.cimenta.is-playing .game { height: calc(100dvh - 40px); }
  }
}
/* the share image is captured without it */
body.is-poster [data-teia="topo"] { display: none; }
body.cimenta.is-poster .game { height: 100vh; }
