/* Onboarding: one-time introductions (spotlight + coach bubble), help centre, "Yenilikler" and
   the grouped "Sen yokken" summary. Uses the shared tokens and parchment card from style.css. */
:root { --z-tip-spot: 14; --z-tip: 15; }

/* Spotlight: a soft ring around the thing being introduced; the dimmed rest stays tappable
   (pointer-events: none) so a new player can never get stuck behind it. */
#tip-spot { position: fixed; z-index: var(--z-tip-spot); pointer-events: none; border-radius: var(--radius-lg);
  border: 3px solid #f5a524; box-shadow: 0 0 0 4px rgba(245, 165, 36, .35);
  transition: left var(--duration-normal) var(--ease-out), top var(--duration-normal) var(--ease-out), width var(--duration-normal), height var(--duration-normal);
  animation: tipPulse 1.6s ease-in-out infinite; }
@keyframes tipPulse { 50% { box-shadow: 0 0 0 9px rgba(245, 165, 36, .18); } }
/* The dim is its own full-screen layer with a hole cut out (clip-path, set in JS): a 200vmax
   box-shadow is skipped by some mobile GPUs at high device-pixel ratios. */
#tip-dim { position: fixed; inset: 0; z-index: var(--z-tip-spot); pointer-events: none; background: rgba(24, 16, 8, .42); }

#tip { position: fixed; z-index: var(--z-tip); width: min(340px, calc(100vw - 16px)); max-height: calc(var(--visible-h, 100dvh) - 24px); overflow-y: auto;
  padding: var(--space-3) var(--space-3) var(--space-2); border: 2px solid #f5a524; border-radius: var(--radius-lg);
  background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-modal);
  font: var(--text-sm)/1.45 var(--font-body); animation: tipIn var(--duration-normal) var(--ease-out); }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px); } }
#tip .tip-kicker { margin: 0 36px 2px 0; font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; color: var(--even); text-transform: uppercase; }
#tip h3 { margin: 0 36px 6px 0; font: 700 var(--text-lg)/1.25 var(--font-display); color: var(--ink); }
#tip .tip-text { margin: 0 0 var(--space-3); }
#tip .tip-close { position: absolute; top: 4px; right: 4px; width: var(--touch-target); height: var(--touch-target); border: 0; background: transparent; font-size: 18px; color: var(--muted); }
#tip .tip-actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
#tip .tip-actions button { min-height: var(--touch-target); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font: 600 var(--text-sm)/1.2 var(--font-body); color: var(--ink); border: 1px solid var(--border); background: var(--surface); }
#tip .tip-actions button.primary { flex: 1 1 auto; border: 3px double var(--border); background: var(--btn-beige); box-shadow: 0 0 0 3px var(--decoration-glow), var(--shadow-sm); font-weight: 700; }
#tip .tip-actions button small { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--btn-muted); }

/* Help centre and "Yenilikler": same full-screen parchment modal as the intro/away cards. */
#help, #whats-new { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; background: rgba(20, 12, 5, .45); }
:where(#help, #whats-new, #tip) :is(button, input, summary) { min-height: var(--touch-target); min-width: var(--touch-target); }
.help-card, .news-card { width: min(560px, calc(100vw - 24px)); text-align: left; padding-top: 44px; }
.help-card h3, .news-card h3 { text-align: center; }
.help-card h4 { margin: 0 0 var(--space-2); font: 700 var(--text-md)/1.3 var(--font-display); color: var(--ink); }
.help-next { margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--warning-surface); }
.help-next ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.help-next li { display: flex; align-items: center; gap: var(--space-2); color: var(--ink); font-size: var(--text-sm); }
.help-next .grow { flex: 1; min-width: 0; }
.help-next-icon { font-size: 20px; }
.intro-card .help-next button { padding: 4px 10px; flex: 0 0 auto; }
.intro-card .help-next button[data-primary] { font-weight: 700; box-shadow: 0 0 0 3px var(--decoration-glow); }
.help-search { display: grid; gap: 4px; margin-bottom: var(--space-2); font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.help-search input { width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); font: var(--text-md) var(--font-body); }
.help-list { display: grid; gap: var(--space-2); }
.help-item { border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); }
.help-item summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); cursor: pointer; color: var(--ink); font-size: var(--text-sm); }
.help-item summary .ui-badge { margin-left: auto; }
.help-item[open] summary { border-bottom: 1px solid var(--border-soft); }
.help-item dl { margin: 0; padding: var(--space-2) var(--space-3); display: grid; gap: 2px; font-size: var(--text-sm); }
.help-item dt { font-weight: 700; color: var(--even); margin-top: 4px; }
.help-item dd { margin: 0; color: var(--ink); line-height: 1.45; }
.intro-card .help-item > button { margin: 0 var(--space-3) var(--space-3); padding: 4px 12px; }
.help-empty { text-align: center; }
.help-more { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.intro-card .help-more button { flex: 1 1 160px; }
.news-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 6px; font-size: var(--text-sm); color: var(--ink); line-height: 1.4; }
.news-list li { display: flex; gap: var(--space-2); }
.news-card > p { text-align: center; }

/* "Sen yokken" grouped summary */
.away-summary { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.away-summary li { padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-soft); background: var(--success-surface); color: var(--ink); font-weight: 600; font-size: var(--text-sm); }
.away-summary li.bad { background: var(--btn-danger-bg); border-color: var(--bad); color: var(--bad); }
.away-details { margin-bottom: var(--space-2); }
.away-details summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: var(--text-sm); padding: 6px 0; }
.away-next { display: flex; gap: 6px; padding: var(--space-2); border-radius: var(--radius-md); background: var(--warning-surface); color: var(--ink); }
.intro-card p.away-next { margin-bottom: var(--space-2); }

@media (max-width: 760px), (pointer: coarse) and (max-width: 1100px) {
  #tip, #help, #whats-new { --text-xs: 14px; --text-sm: 15px; --text-md: 16px; }
  .help-card, .news-card { width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  #tip-spot { animation: none; transition: none; }
  #tip { animation: none; }
}
#help .panel-close, #whats-new .panel-close { width: var(--touch-target); height: var(--touch-target); }
