/* =============================================
   LANDING PAGE — Luxury Gold · Mobile-first
   Stable on all devices
   ============================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }

:root {
    --bg: #0a0a0a;
    --card: rgba(255,215,150,0.04);
    --border: rgba(212,175,110,0.15);
    --text: #f5f0e8;
    --muted: #9a917e;
    --gold1: #d4af6e;
    --gold2: #f0d48a;
    --gradient: linear-gradient(135deg, #c9953c, #f0d48a, #d4af6e);
    --gradient-bg: linear-gradient(160deg, #0a0a0a 0%, #1a1308 40%, #0d0b06 70%, #0a0a0a 100%);
    --glow: rgba(212,175,110,0.25);
    --r: 14px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    background-image: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
    line-height: 1.5;
}

/* === Background Orbs === */
.bg-orbs {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
}
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); opacity: .3;
    will-change: transform;
    animation: drift 20s ease-in-out infinite alternate;
}
.orb-1 { width: 300px; height: 300px; background: rgba(201,149,60,.25); top: -8%; left: -5%; }
.orb-2 { width: 220px; height: 220px; background: rgba(240,212,138,.15); bottom: 5%; right: -3%; animation-delay: -7s; }

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -15px) scale(1.08); }
}

/* === Page Layout === */
.page {
    position: relative; z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 60px 24px calc(40px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    min-height: 100vh;
    min-height: 100dvh;
    text-align: center;
}

/* === Hero === */
.hero {
    text-align: center;
    width: 100%;
}

.badge {
    display: inline-block;
    background: rgba(201,149,60,.1);
    border: 1px solid rgba(212,175,110,.25);
    color: var(--gold2);
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: .4px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,110,.3); }
    50% { box-shadow: 0 0 0 8px rgba(212,175,110,0); }
}

h1 {
    font-size: clamp(28px, 7vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.3px;
    margin-bottom: 12px;
    color: #f5e6c8;
    word-break: keep-all;
}

.highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.desc {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
.desc strong { color: var(--gold2); }

/* === Buttons === */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: var(--r);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    text-decoration: none;
    text-align: center;
    letter-spacing: .4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.btn-primary {
    background: var(--gradient);
    color: #0a0a0a;
    box-shadow: 0 4px 15px rgba(201,149,60,.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--glow);
}
.btn-primary:active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 2px 8px rgba(201,149,60,.15);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid rgba(212,175,110,.3);
    color: var(--gold2);
}
.btn-secondary:hover {
    border-color: var(--gold1);
    background: rgba(212,175,110,.06);
}
.btn-secondary:active {
    background: rgba(212,175,110,.1);
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-sm {
    width: auto;
    padding: 9px 18px;
    font-size: 13px;
}

.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(10,10,10,.15);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Result Card === */
.result-card {
    width: 100%;
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 20px;
    text-align: center;
    animation: fadeUp .4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: pop .5s ease;
}
@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.result-card h2 {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.result-card p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(201,149,60,.06);
    border: 2px dashed rgba(212,175,110,.3);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.code-box span {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: all;
    word-break: break-all;
}
.copy-btn {
    padding: 8px 16px;
    background: var(--gradient);
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.copy-btn:active { transform: scale(.95); }

.warn { color: #e8825c !important; font-size: 12px !important; }

/* === Footer === */
footer {
    font-size: 12px;
    color: rgba(154,145,126,.4);
    margin-top: auto;
    padding-bottom: var(--safe-bottom);
}
footer a {
    color: var(--gold1);
    text-decoration: none;
}

/* === FAB Admin Toggle === */
.fab {
    position: fixed;
    bottom: calc(14px + var(--safe-bottom));
    right: 14px;
    width: 40px; height: 40px;
    background: rgba(10,10,10,.6);
    border: 1px solid rgba(212,175,110,.1);
    border-radius: 50%;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: .3s;
    -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(.9); }

/* === Admin Panel === */
.panel {
    position: fixed; inset: 0;
    z-index: 9999;
    overflow: hidden;
}
.panel-bg {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.panel-body {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 100%;
    max-width: 400px;
    background: #0c0a06;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    position: sticky;
    top: 0;
    background: #0c0a06;
    padding: 4px 0 12px;
    z-index: 1;
}
.panel-head h3 { font-size: 17px; color: #f5e6c8; }
.panel-head button {
    width: 32px; height: 32px;
    background: rgba(212,175,110,.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    transition: .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.panel-head button:active { background: rgba(232,130,92,.15); color: #e8825c; }

.section input, .section textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(212,175,110,.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    margin-bottom: 8px;
    -webkit-appearance: none;
    appearance: none;
}
.section textarea {
    font-family: 'SF Mono', 'Fira Code', monospace;
    resize: vertical;
    min-height: 100px;
}
.section input:focus, .section textarea:focus {
    border-color: var(--gold1);
    box-shadow: 0 0 0 2px rgba(212,175,110,.1);
}

.a-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.a-stats > div {
    background: rgba(212,175,110,.04);
    border: 1px solid rgba(212,175,110,.08);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
}
.a-stats b {
    display: block;
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.a-stats small {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.a-block {
    background: rgba(212,175,110,.02);
    border: 1px solid rgba(212,175,110,.06);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}
.a-block h4 {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--gold2);
}

.table-wrap {
    overflow-x: auto;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 8px;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th {
    background: rgba(201,149,60,.08);
    padding: 6px 8px;
    text-align: left;
    color: var(--gold2);
    font-weight: 700;
    position: sticky; top: 0;
    white-space: nowrap;
}
td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(212,175,110,.05);
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 130px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.tags .tag {
    padding: 4px 10px;
    background: rgba(201,149,60,.08);
    border: 1px solid rgba(212,175,110,.15);
    border-radius: 6px;
    font-family: monospace;
    font-size: 11px;
    color: var(--gold2);
}

.danger { border-color: rgba(232,130,92,.15) !important; }
.btn-danger {
    background: linear-gradient(135deg, #c0392b, #96281b) !important;
    color: #fff !important;
    width: 100%;
}

/* === Toast === */
.toast {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 99999;
    animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    max-width: calc(100vw - 32px);
    text-align: center;
    white-space: nowrap;
}
.toast.success { background: #0d1f0d; color: #6bcf7f; border: 1px solid #2d8044; }
.toast.error { background: #1f0d0d; color: #e8825c; border: 1px solid #96281b; }
.toast.info { background: #0d1520; color: #7eb8e0; border: 1px solid #2d5a80; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* === Responsive === */
@media (max-width: 380px) {
    .page { padding: 48px 16px 32px; gap: 22px; }
    h1 { font-size: 26px; }
    .badge { font-size: 11px; padding: 6px 14px; }
    .btn { padding: 14px 16px; font-size: 15px; }
    .result-card { padding: 24px 16px; }
    .code-box span { font-size: 18px; letter-spacing: 2px; }
    .a-stats b { font-size: 18px; }
}

@media (min-width: 381px) and (max-width: 480px) {
    .page { padding: 52px 20px 36px; }
    h1 { font-size: 30px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .page { padding: 64px 24px 40px; }
}

@media (min-width: 769px) {
    .page { padding: 80px 24px 48px; }
    h1 { font-size: 42px; }
    .btn { padding: 18px 24px; font-size: 17px; }
    .result-card { padding: 36px 28px; border-radius: 24px; }
    .code-box span { font-size: 26px; letter-spacing: 4px; }
    .fab:hover { border-color: var(--gold1); transform: rotate(90deg); }
    .copy-btn:hover { transform: scale(1.05); }
}

/* iOS safe areas */
@supports (padding: max(0px)) {
    .page { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
    .fab { bottom: max(14px, env(safe-area-inset-bottom)); }
}
