/* =================================================================
   STYLE.CSS — HORS.TR ortak stil (tek stil sistemi, tüm sayfalar)
   ================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg-deep: #0a0d09;
    --bg-panel: #151c11;
    --bg-panel2: #1d2618;
    --bg-card: #1a2115;
    --gold: #d4af37;
    --gold-bright: #f0c419;
    --track-green: #223a26;
    --track-green2: #2c4a30;
    --text: #ede6d6;
    --text-dim: #9aa392;
    --danger: #e0574f;
    --success: #4ade80;
    --line: rgba(212,175,55,0.20);
    --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    overflow: hidden;
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none; user-select: none;
}

/* Tüm tıklanabilir öğeler: touch-action:none üst katmandan miras kalınca bazı mobil
   tarayıcılarda (ör. Samsung Internet) dokunuşun click olayına dönüşmesini geciktirip
   engelleyebiliyor. Bu yüzden tüm interaktif öğelerde dokunuşun anında "click"e
   dönüşmesini garanti eden touch-action:manipulation tanımlanıyor. */
button, a, input, select, textarea, label,
.hz-btn, .hz-buy-btn, .hz-danger-btn, .hz-badge-btn, .hz-wallet,
.hz-horse-item, .hz-market-card, .hz-stall, .hz-lucky-card,
.hz-race-start-btn, .hz-bet-slider {
    touch-action: manipulation;
}

h1, h2, h3, .hz-display { font-family: 'Playfair Display', serif; }

.hz-page {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    background:
        radial-gradient(ellipse at top, rgba(212,175,55,0.06), transparent 60%),
        var(--bg-deep);
    overflow: hidden;
}

/* ---------- SWIPE INDICATOR (scrollbar yerine) ---------- */
.hz-swipe-indicator {
    position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%);
    z-index: 999999; font-size: 13px; letter-spacing: 2px;
    opacity: 0; transition: opacity .3s;
    background: rgba(10,14,10,0.7); border: 1px solid var(--line);
    padding: 4px 12px; border-radius: 20px; pointer-events: none;
}
.hz-swipe-indicator.show { opacity: 0.85; animation: hzPulse 1.8s infinite; }
@keyframes hzPulse { 0%,100%{opacity:.55;} 50%{opacity:1;} }

/* ---------- CÜZDAN ---------- */
.hz-topbar {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; padding: 14px 60px 10px 60px; flex-shrink: 0;
}
.hz-badge-btn {
    background: none; border: none; font-size: 20px; cursor: pointer;
    padding: 4px 8px; position: relative; color: var(--text);
}
.hz-badge-btn .hz-badge-count {
    position: absolute; top: -4px; right: -2px; background: var(--gold);
    color: #161200; font-size: 10px; font-weight: 800; border-radius: 10px;
    padding: 1px 5px; min-width: 14px;
}
.hz-wallet {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: linear-gradient(160deg, #2a2410, #1a1608);
    border: 1px solid var(--gold); border-radius: 24px;
    padding: 7px 18px; box-shadow: 0 4px 14px rgba(212,175,55,0.15);
}
.hz-wallet .hz-coin { font-size: 16px; }
.hz-wallet-value {
    font-family: 'Playfair Display', serif; font-weight: 800; font-size: 19px;
    color: var(--gold-bright); letter-spacing: 0.5px;
}

/* ---------- ANASAYFA ---------- */
.hz-home {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 10px 24px; gap: 14px;
}
.hz-home-icon { font-size: 58px; filter: drop-shadow(0 4px 10px rgba(212,175,55,0.35)); }
.hz-home-title { font-size: 34px; font-weight: 800; color: var(--gold-bright); letter-spacing: 1px; }
.hz-home-sub { color: var(--text-dim); font-size: 14.5px; max-width: 300px; line-height: 1.5; }
.hz-home-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; margin-top: 10px; }
.hz-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(160deg, var(--gold-bright), var(--gold));
    color: #1b1400; font-weight: 800; font-size: 15px; padding: 14px 20px;
    border: none; border-radius: 12px; cursor: pointer; text-decoration: none;
    box-shadow: 0 6px 16px rgba(212,175,55,0.25);
}
.hz-btn:active { transform: scale(0.97); }
.hz-btn.hz-btn-ghost {
    background: transparent; border: 1.5px solid var(--gold); color: var(--gold-bright);
    box-shadow: none;
}
.hz-clock { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ---------- LİSTE / KART ORTAK ---------- */
.hz-scroll-viewport { flex: 1; overflow: hidden; position: relative; }
.hz-scroll-content { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 26px; will-change: transform; }

.hz-horse-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 10px 12px; cursor: pointer;
}
.hz-horse-item.hz-glow { box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(240,196,25,0.25); }
.hz-avatar {
    width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
    background: var(--bg-panel2); display: flex; align-items: center; justify-content: center;
}
.hz-avatar img { width: 100%; height: 100%; object-fit: contain; }
.hz-horse-info { flex: 1; min-width: 0; }
.hz-horse-name-row { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14.5px; }
.hz-horse-name-row span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-stars { font-size: 11px; color: var(--gold); }
.hz-meta-preview { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.hz-odds { font-family: 'Playfair Display', serif; font-weight: 800; color: var(--gold-bright); font-size: 15px; }
.hz-mini-tag { font-size: 15px; }

.hz-empty { text-align: center; color: var(--text-dim); padding: 40px 24px; line-height: 1.6; font-size: 14px; }

/* ---------- MODAL ---------- */
.hz-modal-overlay {
    position: fixed; inset: 0; z-index: 500000; background: rgba(4,6,3,0.72);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .18s;
    padding: 16px;
}
.hz-modal-overlay.active { opacity: 1; pointer-events: auto; }
.hz-modal-panel {
    width: 100%; max-width: 360px; max-height: 88vh; max-height: 88dvh; overflow: hidden;
    background: var(--bg-panel); border: 1px solid var(--line); border-radius: 18px;
    padding: 18px; position: relative;
    display: flex; flex-direction: column; gap: 12px;
}
.hz-modal-close {
    position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.06);
    border: none; color: var(--text); width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 15px;
}
.hz-modal-header { display: flex; align-items: center; gap: 12px; }
.hz-modal-avatar {
    width: 68px; height: 68px; border-radius: 12px; background: var(--bg-panel2);
    display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.hz-modal-avatar img { width: 100%; height: 100%; object-fit: contain; }
.hz-modal-title h3 { margin: 0 0 4px; font-size: 18px; color: var(--gold-bright); }

.hz-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hz-stat-box { background: var(--bg-panel2); border-radius: 10px; padding: 8px 10px; }
.hz-stat-label { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.hz-stat-value { font-size: 14px; font-weight: 700; margin-top: 2px; }

.hz-bet-slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.hz-bet-slider { width: 100%; accent-color: var(--gold); }
.hz-bet-amount { text-align: center; font-family: 'Playfair Display', serif; font-weight: 800; color: var(--gold-bright); font-size: 17px; }
.hz-modal-actions { display: flex; gap: 8px; }
.hz-btn-confirm { flex: 1; background: linear-gradient(160deg,var(--gold-bright),var(--gold)); color:#1b1400; border:none; font-weight:800; padding: 12px; border-radius: 10px; cursor:pointer; }
.hz-btn-cancel { flex: 1; background: rgba(224,87,79,0.15); color: var(--danger); border: 1px solid var(--danger); font-weight: 700; padding: 12px; border-radius: 10px; cursor: pointer; }

.hz-mini-parent-modal {
    position: fixed; inset: 0; z-index: 600000; background: rgba(4,6,3,0.82);
    display: flex; align-items: center; justify-content: center; opacity:0; pointer-events:none; transition: opacity .15s;
}
.hz-mini-parent-modal.active { opacity: 1; pointer-events: auto; }
.hz-mini-parent-box { background: var(--bg-panel); border: 1px solid var(--gold); border-radius: 16px; padding: 18px; display:flex; gap:18px; }
.hz-parent-col { text-align: center; width: 90px; }
.hz-parent-role { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }
.hz-parent-col img { width: 72px; height: 72px; object-fit: contain; background: var(--bg-panel2); border-radius: 10px; }
.hz-parent-col.dead img { filter: grayscale(1) brightness(0.8); }
.hz-parent-col .pn { font-size: 11px; margin-top: 6px; color: var(--text-dim); }

/* ---------- YARIŞ PİSTİ ---------- */
.hz-race-wrap { flex: 1; position: relative; overflow: hidden; background: #21351f; }
.hz-track { position: absolute; inset: 0; overflow: hidden; background: #4f7a3b; padding: 10px 0; }
.hz-track-content {
    position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-around;
    background-image: repeating-linear-gradient(90deg, #5f9047 0px, #5f9047 40px, #4f7a3b 40px, #4f7a3b 80px);
}
.hz-lane {
    position: relative; flex: 1; min-height: 30px; margin: 3px 8px;
    background: rgba(0,0,0,0.08); border-radius: 40px;
    border-bottom: 2px dashed rgba(255,255,200,0.16);
}
.hz-lane.hz-lane-glow { background: rgba(240,196,25,0.14); box-shadow: inset 0 0 16px rgba(240,196,25,0.3); border-bottom-color: rgba(255,255,255,0.4); }
.hz-lane-label {
    position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; gap: 7px; z-index: 4;
    background: rgba(255,255,220,0.9); color: #241b0c; border: 1px solid #b3976c;
    padding: 3px 12px 3px 8px; border-radius: 40px; font-size: 11px; font-weight: 800;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3); max-width: 42%;
}
.hz-lane-num { display:none; }
.hz-lane-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #2d1f0e; flex-shrink:0; }
.hz-lane-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hz-lane-badge {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 4;
    background: #1f140a; color: #f7e9c3; border: 1px solid #b3976c; font-weight: 800; font-size: 10.5px;
    padding: 3px 10px; border-radius: 30px; opacity: 0.9;
}
.hz-lane-figure { position: absolute; top: 50%; transform: translateY(-50%); width: 100px; height: auto; image-rendering: pixelated; transition: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); z-index: 3; }
.hz-winner-glow { animation: hzWinPulse .6s ease-in-out infinite alternate; }
@keyframes hzWinPulse {
    0% { filter: drop-shadow(0 0 8px gold) drop-shadow(0 0 16px gold); }
    100% { filter: drop-shadow(0 0 18px #ffd700) drop-shadow(0 0 34px #ffaa00); }
}
.hz-finish-flag {
    position: absolute; right: 16px; top: 8px; bottom: 8px; width: 6px; z-index: 5;
    background: repeating-conic-gradient(#000 0% 25%, #fff 0% 50%) 0 0 / 6px 12px;
    opacity: 0.9; box-shadow: 0 0 12px rgba(255,215,0,0.5); pointer-events: none;
}

.hz-race-start-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 96px; height: 96px; border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.7); background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
    box-shadow: 0 0 40px rgba(255,215,0,0.3); z-index: 20;
    display:flex; align-items:center; justify-content:center; text-align:center; line-height:1.2;
}
.hz-race-start-btn:active { transform: translate(-50%,-50%) scale(0.92); }
.hz-race-start-btn:disabled { opacity: 0.3; filter: grayscale(0.7); pointer-events: none; }
.hz-race-result {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(0.9);
    background: var(--bg-panel); border: 1px solid var(--gold); border-radius: 16px;
    padding: 18px 20px; min-width: 240px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 30;
}
.hz-race-result.show { opacity: 1; transform: translate(-50%,-50%) scale(1); pointer-events: auto; }

/* ---------- HARA ---------- */
.hz-hara-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px 26px; }
.hz-stall {
    background: var(--bg-card); border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 150px; justify-content: center;
    cursor: pointer; text-align: center;
}
.hz-stall.filled { border-style: solid; }
.hz-stall.reserved { opacity: 0.55; }
.hz-stall .hz-avatar { width: 60px; height: 60px; }
.hz-stall .sn { font-size: 12.5px; font-weight: 700; }
.hz-stall .ss { font-size: 10px; color: var(--gold); }
.hz-stall .empty-plus { font-size: 26px; color: var(--text-dim); }
.hz-stall .empty-txt { font-size: 11px; color: var(--text-dim); }

/* ---------- PAZARYERI ---------- */
.hz-market-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px 26px; }
.hz-market-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; cursor: pointer; }
.hz-market-card .hz-avatar { width: 100%; height: 76px; margin: 0 auto 6px; }
.hz-market-card .mn { font-size: 12.5px; font-weight: 700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hz-market-card .mp { font-family:'Playfair Display',serif; font-weight:800; color: var(--gold-bright); font-size: 13.5px; margin-top: 4px; }
.hz-buy-btn { margin-top: 6px; width: 100%; padding: 8px; border: none; border-radius: 8px; background: var(--gold); color:#1b1400; font-weight: 800; font-size: 12px; cursor: pointer; }

/* ---------- AYARLAR ---------- */
.hz-settings-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.hz-settings-row { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.hz-danger-btn { background: rgba(224,87,79,0.15); border: 1px solid var(--danger); color: var(--danger); padding: 8px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* ---------- REKLAM ---------- */
.hz-ad-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
.hz-ad-box { width: 100%; max-width: 320px; aspect-ratio: 9/13; background: linear-gradient(160deg, #221a08, #14100a); border: 1px solid var(--gold); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.hz-ad-timer { font-size: 44px; font-weight: 800; color: var(--gold-bright); font-family:'Playfair Display',serif; }
.hz-ad-close { display:none; background: var(--gold); color:#1b1400; border:none; padding: 12px 28px; border-radius: 10px; font-weight: 800; cursor: pointer; }

/* ---------- ŞANS KARTI ---------- */
.hz-cards-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.hz-cards-row { display: flex; gap: 14px; }
.hz-lucky-card {
    width: 84px; height: 118px; border-radius: 12px; background: linear-gradient(160deg,#2a2410,#1a1608);
    border: 1.5px solid var(--gold); display: flex; align-items: center; justify-content: center;
    font-size: 30px; cursor: pointer; transition: transform .15s;
}
.hz-lucky-card.flipped { transform: rotateY(180deg); pointer-events: none; }
.hz-lucky-result { text-align: center; font-size: 15px; font-weight: 700; color: var(--gold-bright); min-height: 24px; }

/* ---------- BAHİS ÇUBUĞU ---------- */
.hz-chip-hint { font-size: 11px; color: var(--text-dim); display:flex; justify-content:space-between; }

/* ---------- Kula (Buckskin) yaklaşık görsel filtresi ---------- */
.hz-filter-buckskin { filter: sepia(0.55) saturate(1.6) hue-rotate(-8deg) brightness(1.08); }
.hz-dead-figure { filter: grayscale(1) brightness(0.85); }

/* ---------- FORM ---------- */
.hz-input {
    width: 100%; background: var(--bg-panel2); border: 1px solid var(--line); color: var(--text);
    padding: 10px 12px; border-radius: 10px; font-size: 14px; font-family: 'Manrope', sans-serif;
}
.hz-field-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; display:block; }

@media (min-width: 480px) {
    .hz-modal-panel { max-width: 380px; }
}
