/* ============================================================
   Portal – ortak çerçeve (nötr renkler, pembe temayla uyumlu)
   ============================================================ */
:root {
    --bg: #faf7f8;
    --surface: #ffffff;
    --ink: #2b2329;
    --muted: #7a6d75;
    --line: #ece4e8;
    --accent: #a8566f;          /* mat gül kurusu */
    --accent-ink: #ffffff;
    --accent-soft: #f4e4ea;
    --accent-dark: #7a3b55;     /* mürdüm */
    --radius: 14px;
    --shadow: 0 1px 2px rgba(43, 35, 41, .05), 0 6px 20px rgba(43, 35, 41, .06);
}

html, body { background: var(--bg); color: var(--ink); }
body { min-height: 100vh; display: flex; flex-direction: column; font-feature-settings: "kern"; }
main { flex: 1 0 auto; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

/* ---------- Butonlar ---------- */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline-accent { border-color: var(--accent); color: var(--accent-dark); background: transparent; }
.btn-outline-accent:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(168, 86, 111, .18); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

/* ---------- Üst menü ---------- */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav .navbar-brand { font-weight: 800; letter-spacing: .2px; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #e7b7c6); display: inline-block; }
.site-nav .nav-link { color: var(--ink); font-weight: 500; }
.site-nav .nav-link:hover { color: var(--accent-dark); }
.dropdown-item.active, .dropdown-item:active { background: var(--accent); }

/* ---------- Alt bilgi ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 1rem 0; font-size: .9rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-dark); }

/* ---------- Ortak bileşenler ---------- */
.page-head { margin-bottom: 1.25rem; }
.page-head h1 { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.danger-zone { border-color: #f1d0d0; }
.section-title { font-size: 1.25rem; font-weight: 800; margin: 2rem 0 1rem; }

/* ---------- Ana sayfa ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem; align-items: center;
        background: linear-gradient(135deg, #f7e9ee 0%, #fdf9fa 60%); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.5rem, 4vw, 3rem); }
.hero h1 { font-weight: 800; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.1; }
.hero .lead { color: var(--muted); }
.hero-art { position: relative; height: 200px; }
.mini-card { position: absolute; width: 96px; height: 134px; border-radius: 12px; background: #fff; border: 1px solid #e8dde2; box-shadow: 0 8px 22px rgba(122, 59, 85, .15);
             display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; font-weight: 800; color: #2b2329; }
.mini-card i { font-style: normal; font-size: 2.2rem; align-self: center; margin-bottom: 18px; }
.mini-card.red { color: #b3263e; }
.mini-card.c1 { left: 18%; top: 30px; transform: rotate(-12deg); }
.mini-card.c2 { left: 38%; top: 10px; transform: rotate(3deg); z-index: 2; }
.mini-card.c3 { left: 58%; top: 36px; transform: rotate(14deg); }
@media (max-width: 767px) { .hero { grid-template-columns: 1fr; } .hero-art { height: 160px; } }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
             text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
a.game-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(122, 59, 85, .14); color: var(--ink); }
.game-card.soon { opacity: .7; }
.game-card-art { height: 120px; position: relative; background: #efe4e9; }
.game-card-body { padding: 1rem 1.1rem 1.2rem; }
.game-card-body h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .25rem; }
.game-card-body p { color: var(--muted); font-size: .92rem; margin-bottom: .75rem; }
.game-card-cta { color: var(--accent-dark); font-weight: 700; font-size: .92rem; }
.art-pisti { background: radial-gradient(ellipse at center, #e5bcc8 0%, #b88893 85%); }
.art-pisti::before, .art-pisti::after { content: ""; position: absolute; width: 54px; height: 76px; border-radius: 8px; background: #fff; top: 22px; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.art-pisti::before { left: calc(50% - 50px); transform: rotate(-10deg); }
.art-pisti::after { left: calc(50% - 4px); transform: rotate(8deg); background: repeating-linear-gradient(45deg, #7a3b55 0 6px, #8f4d68 6px 12px); border: 4px solid #fff; }
.art-satranc { background: conic-gradient(#f5e6ea 25%, #c79aa6 0 50%, #f5e6ea 0 75%, #c79aa6 0) 0 0 / 40px 40px; }
.art-puzzle { background: repeating-linear-gradient(0deg, #f3eaee 0 23px, #e2d3da 23px 24px), repeating-linear-gradient(90deg, transparent 0 23px, #e2d3da 23px 24px); }
.art-exam { background: linear-gradient(#efe4e9, #efe4e9) padding-box; }
.art-exam::before { content: "A  B  C  D"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; letter-spacing: 6px; color: #b88893; }

/* ---------- Giriş / kayıt ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 1rem 0 2rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: clamp(1.25rem, 4vw, 2rem); width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.big-icon { font-size: 3rem; color: var(--accent); font-weight: 800; }
.consents .form-check { margin-bottom: .4rem; }
.nick-feedback.ok { color: #2e7d4f; }
.nick-feedback.err { color: #b3263e; }
.nick-feedback .sugg { display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); cursor: pointer; border: 0; color: var(--accent-dark); }

/* ---------- Belgeler ---------- */
.doc { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.5rem); box-shadow: var(--shadow); }
.doc h1 { font-weight: 800; font-size: 1.8rem; }
.doc h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.5rem; }
.doc p, .doc li { line-height: 1.65; }

/* ---------- Oyun başlatma ---------- */
.start-form legend { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.level-picker, .mode-picker, .chip-picker, .theme-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.level-btn, .mode-btn { border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem .9rem; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; min-width: 92px; }
.level-btn b { font-size: 1.2rem; }
.level-btn span, .mode-btn span { font-size: .8rem; color: var(--muted); }
.mode-btn { min-width: 200px; max-width: 320px; }
.btn-check:checked + .level-btn, .btn-check:checked + .mode-btn, .btn-check:checked + .chip, .btn-check:checked + .theme-swatch { border-color: var(--accent); background: var(--accent-soft); }
.btn-check:disabled + .mode-btn { opacity: .45; cursor: not-allowed; }
.btn-check:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: .35rem .9rem; cursor: pointer; background: var(--surface); }
.theme-swatch { border: 1.5px solid var(--line); border-radius: 12px; padding: .45rem .8rem; cursor: pointer; display: flex; align-items: center; gap: .5rem; background: var(--surface); }
.theme-swatch span, .sw { width: 22px; height: 22px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.1); }
.sw-pembe span, .sw.sw-pembe { background: linear-gradient(135deg, #e9cdd3, #b88893); }
.sw-klasik span, .sw.sw-klasik { background: linear-gradient(135deg, #13704a, #0b3d2a); }
.sw-gece span, .sw.sw-gece { background: linear-gradient(135deg, #2b3a55, #121a2b); }
.sw-ahsap span, .sw.sw-ahsap { background: linear-gradient(135deg, #8a5a34, #4a2c17); }
.sw-lavanta span, .sw.sw-lavanta { background: linear-gradient(135deg, #e4dcf1, #a796c4); }
.sw-deniz span, .sw.sw-deniz { background: linear-gradient(135deg, #2f8f9d, #134e5a); }
.sw-acik span, .sw.sw-acik { background: linear-gradient(135deg, #ffffff, #d9dcdf); border: 1px solid #ccc; }
.undo-input { max-width: 140px; }
.resume-panel { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; background: var(--accent-soft); }

/* ---------- Sıralama ---------- */
.lb-table tr.me { background: var(--accent-soft); }
.rank { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: .9rem; background: #f1eaee; }
.rank.r1 { background: #f6d77a; } .rank.r2 { background: #dcdcdc; } .rank.r3 { background: #e7b98f; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.admin-nav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.8rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .9rem; }
.tr-table td.needs-check { background: #fff7e0; }
.tr-table td.missing { background: #fdecef; }
.word-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.word-chip { border: 1px solid var(--line); background: #faf5f7; border-radius: 999px; padding: .15rem .65rem; font-size: .85rem; }
.word-chip:hover { background: #fdecef; border-color: #f1c3cc; }
.game-settings { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.game-settings:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.history li { padding: .5rem 0; border-bottom: 1px dashed var(--line); }

/* ---------- Onay penceresi (site.js) ---------- */
.p-confirm { position: fixed; inset: 0; background: rgba(30, 20, 26, .45); display: grid; place-items: center; z-index: 2000; padding: 16px; }
.p-confirm-box { background: #fff; border-radius: 16px; max-width: 420px; width: 100%; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.p-confirm-box p { margin-bottom: 1.2rem; font-weight: 500; }
.p-confirm-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Skor kaynağı rozetleri */
.badge.src-normal { background: #e8f3ec; color: #2d6a45; }
.badge.src-admin { background: #efe5ea; color: #7a3b55; }
.badge.src-test { background: #fff1d6; color: #8a5a00; }

/* Admin: çoklu kullanıcı seçimi */
.user-pick { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; background: #fff; }
.user-pick-row { display: block; padding: .2rem 0 .2rem 1.6rem; margin: 0; }
.user-pick-row[hidden] { display: none; }

/* Bayraklar ve dil seçici */
.flags { display: inline-flex; gap: 3px; vertical-align: -2px; }
.flags .flag { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }
.lang-toggle, .lang-item { display: inline-flex; align-items: center; gap: .45rem; }
.lang-item { display: flex; }

/* Telefon üst çubuğu: bayrak · hamburger · giriş / takma ad */
.mobile-bar { gap: .35rem; }
.mobile-bar .btn-link { text-decoration: none; color: var(--ink, #2b1e25); padding: .35rem .4rem; }
.mobile-user { font-weight: 700; max-width: 5.5em; white-space: nowrap; overflow: hidden; }
.mobile-user .caret { font-size: .7em; opacity: .7; }
.mobile-login { font-weight: 700; text-decoration: none; color: var(--accent-dark, #7a3b55); padding: .35rem .25rem; white-space: nowrap; }
.mobile-bar .navbar-toggler { padding: .3rem .5rem; }
/* Gruplu etkinliklerde mod seçimi (Okey: Klasik / Eşli / 101 / Eşli 101) */
.mode-tabs a.chip { text-decoration: none; color: inherit; font-weight: 600; }
.mode-tabs a.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
/* v4 etkinlik kartı görselleri */
.art-uc-bes-sekiz { background: radial-gradient(ellipse at center, #e9c9d2 0%, #a97786 85%); }
.art-uc-bes-sekiz::before { content: "3 · 5 · 8"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 2rem; letter-spacing: 2px; color: #fff; text-shadow: 0 3px 10px rgba(80,30,50,.45); }
.art-okey { background: radial-gradient(ellipse at center, #e8d7c2 0%, #b8957a 90%); }
.art-okey::before { content: ""; position: absolute; left: 50%; top: 50%; width: 200px; height: 58px; transform: translate(-50%, -50%);
    background:
      linear-gradient(#fffaf0, #f3e7d3) 0 0 / 40px 58px no-repeat,
      linear-gradient(#fffaf0, #f3e7d3) 53px 0 / 40px 58px no-repeat,
      linear-gradient(#fffaf0, #f3e7d3) 106px 0 / 40px 58px no-repeat,
      linear-gradient(#fffaf0, #f3e7d3) 159px 0 / 40px 58px no-repeat;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); }
.art-okey::after { content: "7  8  9  10"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 200px; white-space: pre;
    font-weight: 900; font-size: 1.4rem; color: #c0392b; word-spacing: 26px; text-align: center; letter-spacing: 0; padding-left: 12px; }
.art-tavla { background: linear-gradient(#f2e1e6, #e3c7cf); }
.art-tavla::before { content: ""; position: absolute; inset: 14px 18px; border: 6px solid #7a3b55; border-radius: 8px;
    background:
      conic-gradient(from 150deg at 50% 0, #c99aa8 0 60deg, transparent 0) 0 0 / 16.66% 50% repeat-x,
      conic-gradient(from -30deg at 50% 100%, #b07a8a 0 60deg, transparent 0) 0 100% / 16.66% 50% repeat-x,
      #f7e9ed; }
.art-tavla::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; left: calc(50% - 30px); top: calc(50% - 11px);
    background: #fffaf3; border: 2px solid #b9a99a; box-shadow: 30px 0 0 0 #6b2d47; }
.art-king { background: radial-gradient(ellipse at center, #e9cbd4 0%, #a97786 85%); }
.art-king::before { content: "♔"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 4.2rem; color: #fff; text-shadow: 0 4px 12px rgba(80,30,50,.45); }
.art-maca-kizi { background: radial-gradient(ellipse at center, #eed4dc 0%, #b88893 85%); }
.art-maca-kizi::before { content: "Q♠"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.4rem; font-weight: 900; color: #2b1e25; text-shadow: 0 2px 0 rgba(255,255,255,.5); }
.art-altmisalti { background: radial-gradient(ellipse at center, #f1dde3 0%, #b9909c 85%); }
.art-altmisalti::before { content: "66"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.6rem; font-weight: 900; color: #fff; letter-spacing: 2px; text-shadow: 0 4px 12px rgba(80,30,50,.45); }

/* ---------- v8: açılış panelinde kurallar ---------- */
.start-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.25rem; align-items: start; }
.start-rules summary { cursor: pointer; font-weight: 700; display: flex; align-items: baseline; gap: .5rem; list-style: none; }
.start-rules summary::-webkit-details-marker { display: none; }
.start-rules summary::after { content: "▾"; margin-left: auto; color: var(--muted, #888); transition: transform .2s; }
.start-rules details[open] summary::after { transform: rotate(180deg); }
.start-rules .rules-body { margin-top: .75rem; font-size: .92rem; }
.start-rules .rules-body h2 { font-size: 1.05rem; margin-top: 1rem; }
.start-rules .rules-body h3 { font-size: 1rem; margin-top: 1rem; }
@media (min-width: 992px) {
    .start-layout { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    .start-rules { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}
.start-rules .rules-body ul { padding-left: 1.2rem; margin-bottom: .6rem; }
.start-rules .rules-body li { margin-bottom: .2rem; }
.art-bric { background: radial-gradient(ellipse at center, #e6d3da 0%, #9f7180 85%); }
.art-bric::before { content: "♠♥♦♣"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; letter-spacing: 4px; color: #fff; text-shadow: 0 4px 12px rgba(80,30,50,.45); }
