/* ===== Гоёлын давхарга: style.css-ийн дараа ачаална ===== */
:root {
  --rose: #e0457b;
  --rose-dark: #c2185b;
  --ink: #4a2040;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 30px rgba(180, 60, 120, 0.18);
}

body {
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 10% -10%, #ffc2dc 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 0%, #d9c2ff 0%, transparent 55%),
    radial-gradient(900px 600px at 50% 120%, #ffd9c2 0%, transparent 55%),
    linear-gradient(160deg, #fff0f6, #f3e8ff);
  background-attachment: fixed;
  line-height: 1.45;
}

/* хөвөх зүрхнүүд */
.hearts { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hearts span { position: absolute; bottom: -40px; opacity: 0; animation: floatUp linear infinite; }
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.55; }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}
.page { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .hearts { display: none; } .page.active { animation: none; } }

/* гарчгууд */
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; letter-spacing: 0.2px; color: var(--ink); }
h1 { font-size: clamp(2rem, 7vw, 3rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin-bottom: 4px; }
h2::after { content: ""; display: block; width: 54px; height: 3px; margin: 8px auto 0; border-radius: 3px; background: linear-gradient(90deg, #ff8fb8, #b794f4); }
#page1 h1 { color: var(--rose-dark); text-shadow: 0 4px 18px rgba(224, 69, 123, 0.25); }
#page1 p { font-size: 1.1rem; }

/* товчнууд */
button {
  font-family: inherit; font-weight: 700;
  background: linear-gradient(135deg, #d6336f, #c2185b);
  box-shadow: 0 6px 16px rgba(224, 69, 123, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s;
}
button:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 22px rgba(224, 69, 123, 0.38); filter: brightness(1.04); }
button:active { transform: translateY(0) scale(0.98); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8e5cf0; outline-offset: 2px; }
#noBtn { background: linear-gradient(135deg, #6f6a78, #5d5866); box-shadow: none; }
button:disabled { box-shadow: none; filter: grayscale(0.4); }
.back { background: rgba(255, 255, 255, 0.7); color: var(--ink); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); border: 1px solid var(--glass-line); }
.tab, .ctab { background: rgba(255, 255, 255, 0.55); box-shadow: none; }
.tab.active, .ctab.active { background: linear-gradient(135deg, #d6336f, #c2185b); }
#musicBtn { border-radius: 50%; width: 44px; height: 44px; padding: 0; font-size: 1.2rem; backdrop-filter: blur(6px); }

/* үндсэн цэс */
.menu { grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 460px; }
.menu button {
  background: var(--glass); color: var(--ink); border: 1px solid var(--glass-line);
  border-radius: 20px; padding: 20px 10px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
  font-size: 1.02rem;
}
.menu button:hover { background: #fff; }

/* хуудас доторх цонхнууд */
.photo-form, .rules, .saved, .coupon-details, .list li, .gallery figure, .viral {
  backdrop-filter: blur(6px);
}
.photo-form { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--shadow); }
.list li { background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 4px 14px rgba(180, 60, 120, 0.08); border-radius: 16px; }
.rules { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 16px; box-shadow: 0 4px 14px rgba(180, 60, 120, 0.08); }
.coupon { border-radius: 16px; box-shadow: 0 6px 16px rgba(224, 69, 123, 0.12); transition: transform 0.18s; }
.coupon:hover { transform: translateY(-2px) rotate(-0.4deg); }
.gallery figure { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14); transition: transform 0.25s; }
.gallery figure:hover { transform: rotate(0) scale(1.04); z-index: 2; }

input[type="text"], input[type="date"], input[type="time"], input[type="number"], select {
  font-family: inherit; border: 2px solid rgba(224, 69, 123, 0.25); border-radius: 14px; padding: 10px 12px; background: rgba(255, 255, 255, 0.9); color: var(--ink);
}
input:focus { border-color: var(--rose); }

/* онлайн тоглоомын цэс */
.game-grid { gap: 10px; }
.game-grid button { background: var(--glass); color: var(--ink); border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: 0 6px 16px rgba(180, 60, 120, 0.12); }
.game-grid button:hover { background: #fff; }
.game-grid button.picked { background: linear-gradient(135deg, #51cf66, #2f9e44); color: #fff; }
.game-grid button:disabled { background: rgba(255, 255, 255, 0.35); color: #9b88a0; }
.players-tag { color: var(--rose-dark); }

/* хөзөр, самбарууд */
.pcard { border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18); font-family: "Nunito", sans-serif; }
.pcard.back { background: repeating-linear-gradient(45deg, #4c6ef5 0 6px, #3b5bdb 6px 12px); }
.pcard.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px #ffd43b, 0 10px 18px rgba(0, 0, 0, 0.25); }
.game-info { font-weight: 700; }
.online-note { color: var(--rose-dark); }

/* гар утас */
@media (max-width: 480px) {
  .page { padding: 28px 12px; }
  .menu { gap: 10px; }
  .menu button { padding: 18px 8px; font-size: 0.95rem; }
}
.menu button:last-child { grid-column: auto; }

#installBtn { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; margin: 0; font-size: 0.95rem; padding: 10px 20px; }
#installBtn:hover { transform: translateX(-50%) translateY(-2px); }
#installBtn[hidden] { display: none; }

/* Jaipur, Sushi Go */
.jp-tokens { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.tag { font-size: 0.75rem; background: #fff; border-radius: 99px; padding: 3px 9px; color: #c2185b; font-weight: 700; }
.jp-card, .sg-card { font-size: 1.4rem; background: #fff; min-width: 44px; }
.sg-card.sel, .jp-card.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px #ffd43b, 0 8px 16px rgba(0,0,0,.25); }
/* Onitama */
.on-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; width: min(92vw, 320px); margin: 8px auto; background: #7a5c70; padding: 4px; border-radius: 10px; }
.on-cell { aspect-ratio: 1; min-width: 0; padding: 0; margin: 0; border-radius: 6px; background: #f5ebe0; color: #4a2040; font-size: clamp(18px, 7vw, 30px); box-shadow: none; }
.on-cell.temple { background: #ffd8a8; }
.on-cell.mine { color: #d6336c; }
.on-cell.theirs { color: #1c7ed6; }
.on-cell.sel { outline: 3px solid #ffd43b; outline-offset: -3px; }
.on-cell.target { background: #b2f2bb; }
.on-row { display: flex; gap: 8px; justify-content: center; margin: 4px 0; }
.on-card { background: rgba(255,255,255,.85); color: #4a2040; padding: 6px 8px; margin: 0; border-radius: 12px; font-size: .8rem; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: none; }
.on-card.sel { outline: 3px solid #ffd43b; }
.on-mini { display: grid; grid-template-columns: repeat(5, 9px); gap: 1px; }
.on-mini i { width: 9px; height: 9px; background: #e9d5e0; display: block; }
.on-mini i.lit { background: #e0457b; }
.on-mini i.mid { background: #4a2040; }
/* Лудо */
.lu-board { width: min(94vw, 380px); height: auto; display: block; margin: 8px auto; background: rgba(255,255,255,.6); border-radius: 50%; }
/* Домино */
.dm-chain, .dm-hand { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 8px 0; }
.dm-tile { display: inline-flex; flex-direction: row; gap: 0; background: #fffdf5; color: #222; padding: 0; margin: 0; border: 2px solid #4a2040; border-radius: 6px; box-shadow: none; font-size: 1rem; overflow: hidden; }
.dm-tile span { width: 26px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.dm-tile span + span { border-left: 2px solid #4a2040; }
.dm-tile.ok { box-shadow: 0 0 0 3px #51cf66; }
.dm-tile.sel { box-shadow: 0 0 0 3px #ffd43b; transform: translateY(-4px); }

/* Шүдэнз */
.nim-count { font-size: 1.3rem; font-weight: 800; color: #c2185b; margin-bottom: 6px; }
.match-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 360px; margin: 0 auto; }
.match { position: relative; width: 6px; height: 46px; background: linear-gradient(90deg, #c68642, #e0a96d); border-radius: 3px; margin-top: 8px; }
.match::before { content: ""; position: absolute; top: -8px; left: -3px; width: 12px; height: 14px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 35% 30%, #ff8a8a, #d6336c 70%); }
.nim-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; padding: 10px 14px; }
.nim-btn .match-row { gap: 3px; }
.nim-btn .match { height: 30px; width: 4px; margin-top: 6px; background: linear-gradient(90deg, #f1d3a8, #fff0d9); }
.nim-btn .match::before { top: -6px; left: -2px; width: 8px; height: 10px; }
.nim-btn b { font-size: 1.3rem; }

/* Latice: цэнхэр хавтан */
.latice-board { background: linear-gradient(145deg, #2f6fd6, #1b4ba8); box-shadow: 0 8px 22px rgba(27, 75, 168, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.35); padding: 6px; gap: 3px; }
.lcell { background: #d6e6ff; box-shadow: inset 0 0 0 1px rgba(27, 75, 168, 0.25); }
.lcell.special { background: #ffe58a; }
.lcell:hover { background: #eaf2ff; }
.nim-btn b { color: #c2185b; }

/* Latice мэдээллийн самбар */
.latice-info { align-items: center; gap: 8px; margin-bottom: 8px; }
.l-title { font-size: 1.15rem; color: #c2185b; }
.l-moves { background: #fff3bf; color: #7a5a00; font-weight: 800; border-radius: 99px; padding: 3px 12px; font-size: .9rem; }
.l-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.l-player { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.75); border: 2px solid transparent; border-radius: 14px; padding: 6px 12px; box-shadow: 0 3px 10px rgba(180,60,120,.12); }
.l-player.me { background: #fff; }
.l-player.turn { border-color: #e0457b; box-shadow: 0 0 0 3px rgba(224,69,123,.2); }
.l-name { font-weight: 800; color: #4a2040; font-size: .9rem; }
.l-stat { font-size: .9rem; font-weight: 700; background: #f3e8ff; border-radius: 99px; padding: 2px 9px; color: #4a2040; }
.l-legend { font-size: .72rem; color: #8a5a7a; }

/* Memory: 40 карт (8×5) */
.memory-board.big { width: min(96vw, 460px); gap: 4px; }
.memory-board.big .mem { font-size: clamp(16px, 4.6vw, 28px); border-radius: 8px; }

/* ===== Өргөн дэлгэц: нүүр хуудсын хоёр багана (зүүн талд хамтдаа хэдэн өдөр) ===== */
.home-hero { display: none; }
.home-main { display: contents; }
@media (min-width: 1000px) {
  #pageMenu.active { display: grid; grid-template-columns: 1fr minmax(380px, 500px); column-gap: 72px; align-items: center; justify-content: center; max-width: 1120px; margin: 0 auto; width: 100%; }
  #pageMenu .home-main { display: flex; flex-direction: column; align-items: center; grid-column: 2; }
  #pageMenu .menu { width: 100%; }
  .home-hero { display: flex; flex-direction: column; grid-column: 1; grid-row: 1; text-align: left; gap: 4px; padding-right: 8px; }
  .hero-kicker { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--pr, var(--rose)); }
  .hero-days { margin: 0; line-height: .95; display: flex; align-items: baseline; gap: 14px; }
  .hero-days span { font-family: var(--hfont, "Playfair Display", Georgia, serif); font-size: clamp(5rem, 11vw, 9rem); font-weight: 800; color: var(--pr, var(--rose)); }
  .hero-days small { font-size: 1.8rem; font-weight: 700; color: var(--ink, #4a2040); }
  .hero-sub { margin: 4px 0 18px; font-size: 1.15rem; color: var(--mu, #8a5a7a); }
  .hero-quote { margin: 0; padding: 16px 20px; border-left: 4px solid var(--pr, var(--rose)); background: rgba(255,255,255,.55); border-radius: 0 var(--rc, 16px) var(--rc, 16px) 0; font-size: 1.25rem; line-height: 1.4; max-width: 460px; color: var(--ink, #4a2040); }
}

/* ===== Вэб интерфэйсийн дүрэм (Vercel) шалгалтаас: хүртээмж, мэдрэгч, хөдөлгөөн ===== */
html { -webkit-tap-highlight-color: rgba(224, 69, 123, 0.18); }
button, a, input, select, summary, label { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
.hero-days span, .l-stat, .game-info, .nim-count { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid #8e5cf0; outline-offset: 2px; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100000; background: #fff; color: #222; padding: 8px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ===== impeccable шалгалтаас: контраст ба "хажуугийн зураас" ===== */
.name, .hero-kicker, .online-note, #hint, .players-tag { color: #a8134f; }
::placeholder { color: #7d5a74; opacity: 1; }
.hero-quote { border-left: 0 !important; border-radius: var(--rc, 16px) !important; padding: 18px 22px !important; box-shadow: 0 4px 18px rgba(180, 60, 120, 0.12); position: relative; }
.hero-quote::before { content: "“"; position: absolute; top: -18px; left: 14px; font: 700 3.2rem/1 var(--hfont, "Playfair Display", Georgia, serif); color: var(--pr, #c2185b); }
