/* Football Lite: game styles. Colors and fonts come from ../shared/eg-theme.css */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 20px; line-height: 1.45;
}
[hidden] { display: none !important; }
.noscript { margin: 16px; padding: 16px; border: 2px solid var(--ink); border-radius: 12px; background: #FBF6EA; color: #1F3246; }

:focus-visible { outline: 4px solid var(--mid); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

#eg-root { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- header and settings ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; padding: 8px 16px 4px; }
.name-block { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.name { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 28px; line-height: 1.15; white-space: nowrap; }
.kind { margin: 0; white-space: nowrap; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.kind::before { content: ""; width: 14px; height: 14px; border-radius: 2px; background: var(--dot); border: 2px solid var(--ink); flex: none; } /* square = Challenge */
.textlink { color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; white-space: nowrap; }
.linkbtn { background: none; border: 0; cursor: pointer; }
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 16px 10px; border-bottom: 2px solid var(--rule); }
.settings.inline { padding: 12px 0 8px; border-bottom: 0; }
.settings-label { font-size: 18px; margin-right: 2px; }

/* ---------- buttons ---------- */
.btn {
  min-height: 52px; padding: 8px 16px;
  font: inherit; font-weight: 700; font-size: 20px; line-height: 1.2;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 12px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn.small { min-height: 46px; font-size: 18px; padding: 6px 14px; }
.btn.big { min-height: 64px; font-size: 26px; font-family: var(--font-head); font-weight: 800; padding: 8px 36px; }
.btn.primary { background: var(--ink); color: var(--card); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; border-style: dashed; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.controls.col { flex-direction: column; align-items: stretch; }

/* ---------- title screen ---------- */
.titlescreen { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.titlemain { padding: 12px 12px 40px; max-width: 760px; margin: 0 auto; }
.h2 { margin: 8px 0 12px; font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1.15; }
.panel { background: var(--card); border: 2px solid var(--rule); border-radius: 20px; padding: 4px 18px; margin: 0 0 16px; }
.howto { margin: 14px 0; font-size: 20px; }
.note { margin: 12px 0 0; font-size: 18px; }
.stats { padding: 10px 18px; }
.stat { margin: 4px 0; font-size: 20px; }
.stat-label { display: inline-block; min-width: 11em; }
.msg { margin: 0 0 8px; padding: 8px 12px; font-size: 19px; line-height: 1.35; background: var(--card); border: 2px solid var(--rule); border-radius: 12px; }
.msg:empty { display: none; }
.opts { padding: 10px 18px 14px; }
.optgroup { margin: 6px 0 4px; }
.optgroup + .optgroup { margin-top: 14px; }
.optlabel { margin: 6px 0 6px; font-weight: 700; font-size: 20px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.segbtn { min-width: 96px; }
.optgroup .note { margin-top: 8px; }

/* ---------- playing ---------- */
.playscreen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hud { padding: 4px 10px 6px; background: var(--card); border-bottom: 2px solid var(--rule); }
.hud-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; font-size: 17px; line-height: 1.35; }
.hud-row.top { margin-bottom: 2px; }
.hud-item { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.hud-label { opacity: 0.85; }
.hud-row b { font-size: 19px; }
.pausebtn { margin-left: auto; min-width: 84px; }

.playmain { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--iconbg); touch-action: none; user-select: none; -webkit-user-select: none;
}
#cv { display: block; touch-action: none; background: var(--card); }

.ctl { flex: none; padding: 4px 10px 8px; background: var(--card); border-top: 2px solid var(--rule); }
.status { margin: 0 0 4px; height: 3.9em; overflow: hidden; font-size: 17px; line-height: 1.3; font-weight: 700; display: flex; align-items: center; }   /* a fixed height, so a long message never shrinks the field */
.btngrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.playbtn { min-height: 50px; padding: 4px 6px; font-size: 20px; }
.btnextra { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btnextra.gone { visibility: hidden; }
.btnextra .btn { min-height: 46px; }

.overlay {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; justify-content: center; align-items: flex-start; padding: 12px;
  background: rgba(31, 50, 70, 0.78); touch-action: pan-y;
}
:root[data-contrast="high"] .overlay { background: rgba(0, 0, 0, 0.85); }
.sheet { width: 100%; max-width: 560px; margin: auto 0; background: var(--card); border: 3px solid var(--ink); border-radius: 20px; padding: 10px 18px 18px; }
.summary { margin: 0 0 8px; padding: 8px 16px; }
.summary p { margin: 6px 0; font-size: 20px; }
.summary .big { font-weight: 700; font-size: 24px; }

/* phones held sideways: the scoreboard goes to the left and the buttons to the right, so the field gets the full height */
@media (orientation: landscape) and (max-height: 560px) {
  .playscreen { flex-direction: row; }
  .hud { width: 190px; flex: none; border-bottom: 0; border-right: 2px solid var(--rule); overflow-y: auto; }
  .hud-row { gap: 0 10px; }
  .hud-item { white-space: normal; flex-wrap: wrap; }
  .hud-row.top { flex-direction: column; align-items: flex-start; }
  .pausebtn { margin-left: 0; margin-top: 4px; width: 100%; }
  .playmain { flex-direction: row; }
  .ctl { width: 210px; border-top: 0; border-left: 2px solid var(--rule); overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 4px 8px; }
  .status { height: auto; max-height: 9em; margin-bottom: 6px; font-size: 17px; }
  .btngrid { grid-template-columns: 1fr; gap: 5px; }
  .btnextra { grid-column: auto; grid-template-columns: 1fr; gap: 5px; }
  .playbtn, .btnextra .btn { min-height: 44px; font-size: 18px; padding: 4px 6px; }
  .bar { padding-top: 4px; }
  .name { font-size: 24px; }
}
