﻿/* /assets/css/app.css */

.hidden { display: none !important; }

:root {
  --bg:    #f5f9ff;
  --card:  #ffffff;
  --card2: #eef5ff;

  --text:  #1a2744;
  --muted: rgba(26,39,68,.58);
  --line:  rgba(26,39,68,.09);
  --line2: rgba(26,39,68,.05);

  --accent:  #2563eb;
  --accent2: #7c3aed;

  --ok:     #16a34a;
  --warn:   #d97706;
  --danger: #dc2626;

  --radius: 16px;
  --shadow: 0 4px 20px rgba(26,39,68,.08), 0 1px 4px rgba(26,39,68,.04);
  --shadow-md: 0 8px 32px rgba(26,39,68,.12), 0 2px 8px rgba(26,39,68,.06);

  --max: 1180px;
  --pad: 20px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial,
               "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

body.nav-open {
  overflow: hidden;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) calc(72px + var(--safe-bottom));
}

.title {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -.2px;
}
.desc {
  margin: 0 0 18px;
  color: var(--muted);
}
.muted { color: var(--muted); }
.hide  { display: none !important; }
.state { margin: 12px 0 14px; color: var(--muted); }

.card, .panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--card2);
  border-color: rgba(26,39,68,.16);
  box-shadow: 0 2px 8px rgba(26,39,68,.08);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.30);
}
.btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(37,99,235,.38);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover { background: var(--card2); }

.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

.btn.danger, .btn--danger {
  border-color: rgba(220,38,38,.30);
  background: rgba(220,38,38,.08);
  color: var(--danger);
}
.btn.danger:hover, .btn--danger:hover { background: rgba(220,38,38,.14); }

.rating-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.1;
}
.rating-inline .rating-num   { font-weight: 800; letter-spacing: .1px; }
.rating-inline .rating-count { color: var(--muted); }

.starbar {
  position: relative;
  display: inline-block;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
}
.starbar::before { content: "★★★★★"; color: rgba(26,39,68,.15); }
.starbar::after  {
  content: "★★★★★";
  position: absolute; left: 0; top: 0;
  width: var(--pct, 0%);
  overflow: hidden;
  color: var(--warn);
}

.footer {
  border-top: 1px solid var(--line2);
  padding: 18px var(--pad);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px){
  :root { --pad: 14px; }

  .page {
    padding: 0 var(--pad) calc(60px + var(--safe-bottom));
  }

  .title {
    font-size: 22px;
    line-height: 1.28;
  }

  .desc {
    font-size: 14px;
    line-height: 1.6;
  }

  .card,
  .panel {
    border-radius: 14px;
    padding: 14px;
  }

  .btn,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ── pending / spinner states ────────────────────────────────────────────────── */
@keyframes _spin { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block; vertical-align: middle;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: _spin .55s linear infinite;
}
#gamePendingOverlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.48);
  display: flex; align-items: center; justify-content: center;
}
#gamePendingOverlay.hidden { display: none !important; }
.gpo-box {
  background: #fff; border-radius: 16px; padding: 24px 32px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.32);
  font-size: 15px; font-weight: 600; color: #1a2744;
  max-width: min(320px, 90vw);
}
.gpo-spin {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 3px solid var(--accent, #2563eb); border-top-color: transparent;
  border-radius: 50%; animation: _spin .55s linear infinite;
}
