/* Shared look for the kids' corner: light, friendly, MIDTRANS blue/navy/steel.
   Touch-first: built for iPhone, iPad/tablets and Android/Huawei phones in portrait and landscape; still usable on a computer. */
:root {
  --blue: #007DC5; --blue-600: #00639C; --blue-100: #DCEFFA;
  --navy: #0B2140; --navy-700: #18365E; --steel: #5B6B7E; --steel-200: #DCE3EA;
  --paper: #FFFFFF; --bg: #EEF5FB;
  --sun: #F4C451; --teal: #12B8A6; --coral: #F2716B; --leaf: #5DBB63; --violet: #8E6CE0;
  --font-en: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ar: "Cairo", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; background: var(--bg); color: var(--navy);
  font-family: var(--font-en); line-height: 1.45; -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* No pull-to-refresh, text selection or long-press menus while children play. */
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="he"] body { font-family: Arial, "Arial Hebrew", "Noto Sans Hebrew", sans-serif; }
select.lang { appearance: none; -webkit-appearance: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--navy); cursor: pointer; padding-inline-end: 26px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235B6B7E'/%3E%3C/svg%3E") no-repeat right 10px center; }
html[dir="rtl"] select.lang { background-position: left 10px center; }
a, button { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

.top {
  max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
}
.top h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; text-align: center; }
@media (max-width: 420px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .top h1 { order: 3; flex-basis: 100%; }
  .top .back { margin-inline-end: auto; }
}
.back, .lang {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 999px;
  background: var(--paper); border: 2px solid var(--steel-200); text-decoration: none; font-weight: 700; font-size: 14px;
  white-space: nowrap;
}
.back::before { content: "←"; margin-inline-end: 6px; }
html[dir="rtl"] .back::before { content: "→"; }
@media (hover: hover) { .back:hover, .lang:hover { border-color: var(--blue); } }
.lang.sound { padding: 6px 10px; font-size: 18px; }
button, a, canvas { touch-action: manipulation; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti span { position: absolute; top: -40px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

.game {
  max-width: 760px; margin: 0 auto;
  padding: 4px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.status { font-size: 18px; font-weight: 800; min-height: 1.6em; text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn {
  border: 0; border-radius: 14px; padding: 10px 18px; min-height: 48px; font-weight: 800; font-size: 16px;
  background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-600);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-600); }
.btn.ghost { background: var(--paper); color: var(--navy); box-shadow: 0 3px 0 var(--steel-200); border: 2px solid var(--steel-200); }
.btn.ghost[aria-pressed="true"] { border-color: var(--blue); color: var(--blue-600); }
.score { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-weight: 700; color: var(--steel); }
.score b { color: var(--navy); }
.card-box { background: var(--paper); border-radius: 20px; padding: 14px; box-shadow: 0 6px 18px rgba(11,33,64,.08); }

/* Placeholder only. Real ad code is not wired: child-directed ad settings need an owner decision first. */
.ad-slot {
  max-width: 728px; margin: 22px auto calc(24px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); min-height: 100px; aspect-ratio: 728 / 160;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
  border: 2px dashed var(--steel-200); border-radius: 16px; color: var(--steel); font-size: 13px; background: rgba(255,255,255,.6);
}
/* Phones held sideways: tighten the header and spacing so the board fits the short screen. */
@media (orientation: landscape) and (max-height: 520px) {
  .top { padding-top: max(6px, env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
  .top h1 { font-size: 17px; }
  .game { gap: 8px; }
  .status { font-size: 15px; min-height: 1.3em; }
  .btn { min-height: 44px; padding: 8px 14px; }
}
/* Tablets: a little more room and larger text. */
@media (min-width: 700px) and (min-height: 700px) {
  .top h1 { font-size: 24px; }
  .status { font-size: 21px; }
  .btn { font-size: 18px; min-height: 52px; padding: 12px 22px; }
}
.gate { position: fixed; inset: 0; z-index: 60; background: rgba(11,33,64,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-card { background: var(--paper); border-radius: 20px; padding: 20px; width: min(92vw, 380px); text-align: center; display: grid; gap: 12px; }
.gate-card b { font-size: 20px; }
.gate-card p { margin: 0; font-size: 18px; }
.gate-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc, .doc * { -webkit-user-select: text; user-select: text; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
