/* ========== RESET & BASE ========== */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }

:root {
    --primary:       #f5b342;
    --primary-dark:  #d48d2b;
    --primary-light: #fcc45a;
    --bg-dark:       #0b0e1a;
    --bg-card:       rgba(18,25,40,0.92);
    --bg-input:      #0d1628;
    --text-light:    #f0e9d0;
    --text-muted:    #8892b0;
    --border-glow:   rgba(245,179,66,0.2);
    --shadow-heavy:  0 25px 50px rgba(0,0,0,0.8);
    --radius:        20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(245,179,66,0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(245,179,66,0.05) 0%, transparent 60%),
        linear-gradient(145deg, #0b0e1a 0%, #141b2b 100%);
}

/* Page-level override for full-page layouts (withdraw, etc.) */
body.page-full {
    display: block;   /* critical: kills the auth-page flex so children aren't flex items */
    padding: 0;
    min-height: 100vh;
}

/* ═══════════════════════════
   CASINO LOGO MARK
═══════════════════════════ */
.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-emblem {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, #f5b342, #c47d0a);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 900; font-size: 14px; color: #0a0500;
    letter-spacing: -1px; flex-shrink: 0;
    box-shadow: 0 0 18px rgba(245,179,66,0.5);
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.lt-top {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 14px; font-weight: 700; letter-spacing: 2px;
    background: linear-gradient(90deg, #ffe07c, #f5b342);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lt-bot { font-size: 9px; color: #5a6a88; letter-spacing: 3px; text-transform: uppercase; }

/* Auth page logo wrapper */
.auth-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-bottom: 20px;
}
.auth-logo .logo-emblem { width: 52px; height: 52px; font-size: 17px; }
.auth-logo .lt-top { font-size: 18px; }
.auth-logo .lt-bot { font-size: 10px; }

/* ═══════════════════════════
   AUTH PAGES
═══════════════════════════ */
.auth-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.auth-box {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 40px 36px 36px;
    border: 1px solid rgba(245,179,66,0.12);
    box-shadow: var(--shadow-heavy);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute; top: -2px; left: -2px; right: -2px; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
    border-radius: 32px 32px 0 0;
}

.auth-box h2 {
    text-align: center;
    color: var(--text-light);
    font-size: 22px; font-weight: 700;
    margin-bottom: 4px;
}

.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
    background: rgba(245,179,66,0.07);
    padding: 7px 16px;
    border-radius: 40px;
    display: block;
    border: 1px solid rgba(245,179,66,0.1);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px; font-weight: 500;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}
.alert-error   { background:rgba(255,59,48,0.1);  border:1px solid rgba(255,59,48,0.2);  color:#ff6b6b; }
.alert-success { background:rgba(48,209,88,0.1);  border:1px solid rgba(48,209,88,0.2);  color:#69db7c; }

/* Forms */
.auth-form { display:flex; flex-direction:column; gap:16px; }

.form-group { display:flex; flex-direction:column; gap:6px; }

.form-group label {
    color: var(--text-muted);
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 7px;
    text-transform: uppercase; letter-spacing: 0.8px;
}
.form-group label i { color:var(--primary); width:14px; font-size:12px; }

.form-group input {
    background: var(--bg-input);
    border: 1px solid #2a3852;
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--text-light);
    font-size: 15px; font-weight: 400;
    transition: all 0.3s ease;
    outline: none;
    width: 100%;
}
.form-group input::placeholder { color:#4a5a7a; font-weight:300; }
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245,179,66,0.1);
    background: #101b30;
}
.input-hint { font-size:11px; color:var(--text-muted); opacity:0.7; }

/* Auth Button */
.auth-btn {
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 15px 24px;
    border-radius: 14px;
    color: var(--bg-dark);
    font-size: 16px; font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 6px;
    position: relative; overflow: hidden;
    letter-spacing: 0.5px; width: 100%;
}
.auth-btn::after {
    content:''; position:absolute; top:0; left:-100%; width:100%; height:100%;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,0.2),transparent);
    transition:0.5s;
}
.auth-btn:hover::after { left:100%; }
.auth-btn:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(245,179,66,0.35); }
.auth-btn:active { transform:translateY(0); }

.auth-link {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.auth-link a { color:var(--primary); text-decoration:none; font-weight:600; }
.auth-link a:hover { color:var(--primary-light); text-decoration:underline; }

/* ═══════════════════════════
   WITHDRAW PAGE HEADER
═══════════════════════════ */
.w-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    height: 62px; width: 100%;
    background: rgba(7,11,18,0.97);
    border-bottom: 1px solid #1c2a40;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center;
    padding: 0 16px; gap: 10px;
    box-sizing: border-box;
}
.w-back-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid #1c2a40;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 14px;
    text-decoration: none; transition: 0.2s; flex-shrink: 0;
}
.w-back-btn:hover { border-color:var(--primary); color:var(--primary); }
.w-header .logo-mark { flex: 1; justify-content: center; }
.w-header-right {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.balance-pill-w {
    display: flex; align-items: center; gap: 6px;
    background: rgba(245,179,66,0.1);
    border: 1px solid rgba(245,179,66,0.25);
    padding: 6px 12px; border-radius: 50px;
    font-size: 13px; font-weight: 700; color: var(--primary);
}
.balance-pill-w i { font-size:11px; }
.w-logout {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.04); border: 1px solid #1c2a40;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-muted);
    text-decoration: none; transition: 0.2s;
}
.w-logout:hover { border-color:#ff6b6b; color:#ff6b6b; }

/* Withdraw page main area */
.w-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 82px 14px 48px;   /* 82px = 62px header + 20px breathing room */
    min-height: 100vh;
}

/* ═══════════════════════════
   WITHDRAW FORM COMPONENTS
═══════════════════════════ */
.form-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0 18px;
    color: var(--text-muted); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
}
.form-divider::before,
.form-divider::after { content:''; flex:1; height:1px; background:#1f2f49; }
.form-divider i { color:var(--primary); }

.balance-banner {
    background: linear-gradient(135deg, rgba(245,179,66,0.1), rgba(245,179,66,0.04));
    border: 1px solid rgba(245,179,66,0.22);
    border-radius: 18px; padding: 16px 20px;
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin-bottom: 22px;
}
.balance-banner .bb-left { display:flex; align-items:center; gap:12px; }
.balance-banner .bb-icon {
    width: 44px; height: 44px;
    background: rgba(245,179,66,0.12); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--primary); flex-shrink: 0;
}
.balance-banner .bb-label { font-size:11px; color:var(--text-muted); font-weight:600; margin-bottom:2px; text-transform:uppercase; letter-spacing:1px; }
.balance-banner .bb-amount {
    font-size: 24px; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg,#f7d875,#f5b342);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.balance-banner .bb-min {
    font-size: 11px; color: #4a5a7a;
    background: #0d1628; border: 1px solid #2a3852;
    padding: 5px 12px; border-radius: 30px;
}

.form-card {
    background: linear-gradient(160deg,#0d1a2e,#111b2b);
    border: 1px solid rgba(245,179,66,0.18);
    border-radius: 24px; padding: 24px 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.form-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

.form-group select {
    background: var(--bg-input); border:1px solid #2a3852;
    border-radius: 12px; padding:13px 16px;
    color: var(--text-light); font-size:14px;
    outline: none; transition: all 0.3s; width:100%;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238892b0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    cursor: pointer;
}
.form-group select:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(245,179,66,0.1); background-color:#101b30; }
.form-group select option { background:#0d1628; color:var(--text-light); }

.amount-input-wrap { position:relative; }
.amount-input-wrap .currency-prefix {
    position:absolute; left:16px; top:50%; transform:translateY(-50%);
    color:var(--primary); font-weight:700; font-size:17px; pointer-events:none;
}
.amount-input-wrap input { padding-left:34px !important; font-size:19px !important; font-weight:700 !important; }

.form-group input.is-invalid,
.form-group select.is-invalid { border-color:#ff6b6b; box-shadow:0 0 0 3px rgba(255,107,107,0.1); }
.field-error { color:#ff6b6b; font-size:11px; margin-top:3px; display:none; }
.field-error.show { display:block; }

.routing-hint {
    display:flex; align-items:center; gap:7px;
    margin-top:5px; padding:7px 11px;
    background:rgba(245,179,66,0.05); border-radius:9px;
    font-size:10px; color:var(--text-muted);
}
.routing-hint i { color:var(--primary); flex-shrink:0; }

.method-toggle { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:6px; }
.method-btn {
    display:flex; flex-direction:column; align-items:center; gap:5px;
    padding:16px 10px;
    background:#0d1628; border:2px solid #2a3852; border-radius:16px;
    color:var(--text-muted); cursor:pointer; transition:0.25s;
    font-family:'Inter',sans-serif;
}
.method-btn i { font-size:24px; color:var(--text-muted); transition:color 0.25s; }
.method-btn .method-label { font-size:13px; font-weight:700; color:var(--text-light); }
.method-btn .method-desc  { font-size:10px; color:#4a5a7a; }
.method-btn.active { border-color:var(--primary); background:rgba(245,179,66,0.07); box-shadow:0 0 16px rgba(245,179,66,0.1); }
.method-btn.active i, .method-btn:hover i { color:var(--primary); }
.method-btn:hover:not(.active) { border-color:#3b4b6b; background:#0f1e35; }

.crypto-notice {
    display:flex; align-items:center; gap:9px; padding:10px 14px;
    background:rgba(255,165,0,0.07); border:1px solid rgba(255,165,0,0.18);
    border-radius:10px; font-size:11px; color:#ffa94d; margin-top:12px;
}
.crypto-notice i { flex-shrink:0; font-size:13px; }

.submit-section { margin-top:24px; }
.submit-btn {
    background:linear-gradient(145deg,var(--primary),var(--primary-dark));
    border:none; padding:16px 0; width:100%; border-radius:50px;
    font-size:17px; font-weight:800; color:var(--bg-dark);
    box-shadow:0 8px 24px -4px rgba(245,179,66,0.4);
    transition:all 0.3s; cursor:pointer; letter-spacing:1px;
    display:flex; justify-content:center; align-items:center; gap:12px;
    text-transform:uppercase; position:relative; overflow:hidden;
}
.submit-btn::after {
    content:''; position:absolute; top:0; left:-100%; width:100%; height:100%;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,0.2),transparent);
    transition:0.5s;
}
.submit-btn:hover:not(:disabled)::after { left:100%; }
.submit-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 12px 32px -4px rgba(245,179,66,0.55); }
.submit-btn:disabled { opacity:0.55; cursor:not-allowed; }

.result-msg {
    margin-top:12px; padding:12px 16px; border-radius:12px;
    font-size:13px; font-weight:500; display:none;
}
.result-msg.success {
    display:flex; gap:9px; align-items:flex-start;
    background:rgba(48,209,88,0.08); border:1px solid rgba(48,209,88,0.2); color:#69db7c;
}
.result-msg.error {
    display:flex; gap:9px; align-items:flex-start;
    background:rgba(255,59,48,0.08); border:1px solid rgba(255,59,48,0.2); color:#ff6b6b;
}

/* Success panel */
.success-panel { display:none; text-align:center; padding:40px 16px; }
.success-panel.show { display:block; }
.form-body.hidden { display:none; }
.success-panel .success-icon { font-size:56px; color:#69db7c; margin-bottom:14px; }
.success-panel h3 { font-size:22px; font-weight:700; color:var(--text-light); margin-bottom:8px; }
.success-panel p { color:var(--text-muted); font-size:13px; line-height:1.6; margin-bottom:5px; }
.success-ref {
    font-family:monospace; font-size:12px;
    background:#0d1628; border:1px solid #2a3852; border-radius:9px;
    padding:7px 14px; color:var(--text-muted);
    display:inline-block; margin:12px 0 24px;
}
.back-dash-btn {
    display:inline-flex; align-items:center; gap:9px;
    background:linear-gradient(145deg,var(--primary),var(--primary-dark));
    color:var(--bg-dark); font-weight:700; font-size:14px;
    padding:13px 28px; border-radius:50px; text-decoration:none; transition:0.3s;
}
.back-dash-btn:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(245,179,66,0.35); }

/* ═══════════════════════════
   LEGACY / DASHBOARD CLASSES
   (kept for backward compat)
═══════════════════════════ */
.dashboard {
    max-width: 1300px; width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 24px 28px 36px;
    box-shadow: var(--shadow-heavy);
    border: 1px solid rgba(245,179,66,0.07);
}
.header {
    display:flex; justify-content:space-between; align-items:center;
    flex-wrap:wrap; gap:14px; margin-bottom:24px;
}
.logo h1 {
    font-size:26px; font-weight:700;
    background:linear-gradient(135deg,#f7d875,#f5b342);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.logo h1 i { -webkit-text-fill-color:var(--primary); margin-right:8px; }
.logo span { font-size:13px; color:var(--text-muted); margin-left:10px; }
.header-actions { display:flex; align-items:center; gap:12px; }
.balance-card {
    background:#1f2a41; padding:9px 20px; border-radius:50px;
    border:1px solid #3b4b6b; display:flex; align-items:center; gap:10px;
}
.balance-card i { color:var(--primary); font-size:18px; }
.bal-label { color:#aab4d0; font-weight:500; font-size:13px; }
.bal-amount { font-size:22px; font-weight:700; color:var(--text-light); transition:0.3s; }
.logout-btn {
    background:rgba(255,59,48,0.08); border:1px solid rgba(255,59,48,0.18);
    color:#ff6b6b; width:40px; height:40px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    transition:0.3s; text-decoration:none; font-size:16px;
}
.logout-btn:hover { background:rgba(255,59,48,0.16); }

.grid-2 { display:grid; grid-template-columns:1.2fr 0.8fr; gap:24px; }

.history-item {
    display:flex; justify-content:space-between; align-items:center;
    padding:9px 0; border-bottom:1px solid rgba(255,255,255,0.04);
}
.history-item:last-child { border-bottom:none; }
.history-empty { color:var(--text-muted); font-size:13px; text-align:center; padding:16px 0; }
.result-win     { color:#69db7c; font-weight:600; font-size:12px; }
.result-lose    { color:#ff6b6b; font-weight:600; font-size:12px; }
.result-spin_again { color:var(--primary); font-weight:600; font-size:12px; }
.win-amount { color:#69db7c; font-weight:600; font-size:12px; }
.time { color:var(--text-muted); font-size:11px; }

/* Admin panel */
.admin-actions { display:flex; gap:12px; flex-wrap:wrap; }
.save-btn, .reset-btn, .back-btn {
    padding:12px 24px; border-radius:14px; font-weight:600;
    cursor:pointer; transition:0.3s; display:flex; align-items:center; gap:8px;
    border:none; font-size:14px; text-decoration:none;
}
.save-btn  { background:linear-gradient(145deg,var(--primary),var(--primary-dark)); color:var(--bg-dark); }
.save-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 8px 24px rgba(245,179,66,0.3); }
.save-btn:disabled { opacity:0.6; cursor:not-allowed; }
.reset-btn { background:#2a1f2a; color:#ff6b6b; border:1px solid rgba(255,59,48,0.2); }
.back-btn  { background:#1f2a41; color:var(--text-light); border:1px solid #3b4b6b; }
.back-btn:hover  { background:#2a3852; }
.reset-btn:hover { background:#3a2f3a; }

.prize-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.prize-card {
    background:#0d1628; border-radius:14px; padding:16px;
    border:1px solid #1f2f49; transition:0.3s;
}
.prize-card:hover { border-color:var(--primary); }
.prize-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.prize-amount-label { color:var(--text-light); font-size:18px; font-weight:700; }
.chance-label { color:var(--text-muted); font-size:11px; background:#1f2a41; padding:3px 10px; border-radius:20px; }
.prize-input {
    background:#0b1424; border:1px solid #2a3852; border-radius:9px;
    padding:9px 13px; color:var(--text-light); font-size:15px; font-weight:600;
    outline:none; transition:0.3s; width:100%;
}
.prize-input:focus { border-color:var(--primary); }

/* ═══════════════════════════
   RESPONSIVE — AUTH PAGES
═══════════════════════════ */
@media (max-width: 500px) {
    body { padding: 12px; }
    .auth-box { padding:28px 18px 24px; border-radius:24px; }
    .auth-box h2 { font-size:19px; }
    .auth-logo .logo-emblem { width:44px; height:44px; font-size:14px; }
    .auth-logo .lt-top { font-size:15px; }
    .auth-btn { font-size:15px; padding:13px; }
    .form-group input { padding:12px 14px; font-size:14px; }
}
@media (max-width: 360px) {
    body { padding: 8px; }
    .auth-box { padding:22px 14px 20px; border-radius:18px; }
    .auth-logo .logo-emblem { width:38px; height:38px; font-size:12px; }
    .auth-logo .lt-top { font-size:13px; letter-spacing:1px; }
}

/* ═══════════════════════════
   RESPONSIVE — WITHDRAW
═══════════════════════════ */
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns:1fr; }
    .form-card { padding:18px 14px; border-radius:18px; }
    .balance-banner { flex-direction:column; gap:12px; }
    .method-toggle { grid-template-columns:1fr 1fr; }
    .submit-btn { font-size:15px; padding:14px; }
    .w-header .logo-text { display:none; }
    .balance-pill-w span { max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}
@media (max-width: 400px) {
    .w-main { padding:14px 10px 32px; }
    .balance-banner .bb-label { display:none; }
    .method-btn .method-desc { display:none; }
    .balance-banner .bb-amount { font-size:20px; }
}

/* ═══════════════════════════
   RESPONSIVE — LEGACY DASHBOARD / ADMIN
═══════════════════════════ */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns:1fr; }
    .dashboard { padding:16px; border-radius:24px; }
}
@media (max-width: 600px) {
    .dashboard { padding:12px; border-radius:18px; }
    .header { flex-direction:column; align-items:stretch; gap:10px; }
    .header-actions { justify-content:space-between; }
    .balance-card { flex:1; justify-content:center; padding:7px 12px; }
    .bal-amount { font-size:18px; }
    .bal-label { display:none; }
    .logo span { display:none; }
    .prize-grid { grid-template-columns:1fr; }
    .admin-actions { flex-direction:column; }
    .admin-actions button, .admin-actions a { justify-content:center; }
}
