/* ================================================
   DotOne Token Factory — Minimal Gold & Black v2
   ================================================ */
:root {
    --gold: #f0b90b;
    --gold-light: #ffd54f;
    --gold-dim: rgba(240,185,11,.10);
    --gold-border: rgba(240,185,11,.22);
    --gold-glow: rgba(240,185,11,.25);
    --bg: #09090b;
    --bg2: #111113;
    --bg3: #18181b;
    --surface: #141416;
    --border: #222225;
    --border-h: #333337;
    --text: #f0f0f2;
    --text2: #9a9aa0;
    --text3: #5a5a60;
    --green: #34d399;
    --red: #f87171;
    --blue: #60a5fa;
    --radius: 10px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; }

/* Subtle grain */
.noise {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .03;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: 780px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---- Header ---- */
.header {
    position: sticky; top: 0; z-index: 100; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    background: rgba(9,9,11,.78); border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), #c8900a); font-weight: 800; font-size: 13px; color: #0a0a0a;
    box-shadow: 0 0 12px var(--gold-glow), 0 0 3px rgba(240,185,11,.4);
}
.logo-mark span { font-size: 11px; }
.logo-text { font-weight: 700; font-size: 15px; line-height: 1.2; }
.logo-text span { display: block; font-size: 10px; font-weight: 500; color: var(--text3); letter-spacing: .04em; text-transform: uppercase; }

/* Nav tabs */
.nav-tabs { display: flex; gap: 4px; margin-left: auto; background: var(--bg3); border-radius: 10px; padding: 4px; border: 1px solid var(--border); }
.nav-tab {
    padding: 8px 22px; border: none; background: transparent; color: var(--text2); font-family: var(--font);
    font-size: 13.5px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all .3s; letter-spacing: .02em;
    position: relative;
}
.nav-tab:hover { color: var(--gold-light); background: rgba(240,185,11,.05); }
.nav-tab.active {
    background: linear-gradient(135deg, rgba(240,185,11,.15), rgba(240,185,11,.08));
    color: var(--gold);
    box-shadow: 0 2px 12px var(--gold-glow), inset 0 1px 0 rgba(240,185,11,.15);
    text-shadow: 0 0 12px var(--gold-glow);
    border: 1px solid var(--gold-border);
}

.header-right { display: flex; align-items: center; gap: 10px; }
.network-pill {
    display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--text3);
    background: var(--bg3); padding: 5px 12px; border-radius: 20px; font-family: var(--mono);
}
.pulse-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 6px rgba(52,211,153,.5); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{ opacity:1 } 50%{ opacity:.4 } }

.btn-connect {
    padding: 7px 16px; border: 1px solid var(--gold-border); border-radius: 8px;
    background: var(--gold-dim); color: var(--gold); font-family: var(--font);
    font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-connect:hover { background: rgba(240,185,11,.18); border-color: var(--gold); box-shadow: 0 0 14px var(--gold-glow); }
.btn-connect.connected { color: var(--green); border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.08); }

/* ---- Wallet Bar ---- */
.wallet-bar { background: var(--bg2); border-bottom: 1px solid var(--border); animation: slideDown .25s ease; }
.wallet-bar-inner { display: flex; gap: 32px; padding: 10px 0; }
.wb-item { display: flex; flex-direction: column; gap: 1px; }
.wb-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 500; }
.wb-value { font-size: 13px; font-weight: 600; color: var(--text); }
@keyframes slideDown { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:translateY(0) } }

/* ---- Main ---- */
.main { position: relative; z-index: 1; padding: 32px 0 64px; }

/* Tab panels */
.tab-panel { display: none; animation: fadeUp .3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:translateY(0) } }

/* Panel (card) */
.panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px;
}
.panel-head { margin-bottom: 24px; }
.panel-head h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.panel-head p { font-size: 13px; color: var(--text2); }
.panel-head .refresh-btn { position: absolute; top: 28px; right: 28px; }
.panel-head { position: relative; }

/* ---- Form ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select {
    padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: var(--mono); font-size: 13px; outline: none; transition: border .2s;
}
.field input::placeholder { color: var(--text3); font-family: var(--font); }
.field input:focus, .field select:focus { border-color: var(--gold); }
.field input.greyed-out {
    background: var(--bg3); color: var(--text3); border-color: var(--border); cursor: not-allowed; opacity: .55;
}
.field select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field select option { background: var(--bg); color: var(--text); }

.btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 12px 20px; background: linear-gradient(135deg, var(--gold-light), var(--gold), #c8900a); color: #0a0a0a;
    border: none; border-radius: 8px; font-family: var(--font); font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all .25s; box-shadow: 0 2px 16px var(--gold-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 28px rgba(240,185,11,.45), 0 0 8px rgba(240,185,11,.3); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    background: transparent; border: 1px solid var(--border); border-radius: 7px;
    color: var(--text2); font-family: var(--font); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--gold-border); color: var(--gold); text-shadow: 0 0 6px var(--gold-glow); }
.btn-ghost.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---- Deploy status ---- */
.deploy-box { margin-top: 20px; padding: 20px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.status-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.status-msg h3 { font-size: 15px; font-weight: 700; }
.status-msg p, .status-msg small { color: var(--text2); font-size: 13px; }
.status-msg small { font-size: 11px; color: var(--text3); }
.status-msg.success h3 { color: var(--green); }
.status-msg.error h3 { color: var(--red); }
.err-detail { background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.15); border-radius: 6px; padding: 8px 12px; font-size: 12px; word-break: break-all; width: 100%; }
.addr-box { display: flex; align-items: center; gap: 6px; width: 100%; }
.addr-box code { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--gold); background: var(--gold-dim); padding: 8px 12px; border-radius: 6px; word-break: break-all; text-align: center; text-shadow: 0 0 6px var(--gold-glow); }
.link-arrow { font-size: 13px; color: var(--gold); text-decoration: none; transition: opacity .2s; }
.link-arrow:hover { opacity: .7; }

.spinner {
    width: 28px; height: 28px; border: 2.5px solid var(--border); border-top-color: var(--gold);
    border-radius: 50%; animation: spin .7s linear infinite;
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Verify button */
.btn-verify {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    background: rgba(96,165,250,.1); color: var(--blue); border: 1px solid rgba(96,165,250,.22);
    border-radius: 8px; font-family: var(--font); font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn-verify:hover { background: rgba(96,165,250,.18); box-shadow: 0 0 12px rgba(96,165,250,.2); }
.btn-verify:disabled, .btn-verify.verifying { opacity: .5; cursor: not-allowed; }
.btn-verify .verify-spinner { width: 14px; height: 14px; border: 2px solid rgba(96,165,250,.3); border-top-color: var(--blue); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
.deploy-actions { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* ---- Manage Tab ---- */
.manage-info { margin-top: 20px; }
.info-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px; }
.info-card {
    display: flex; flex-direction: column; gap: 3px; padding: 12px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px;
}
.info-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); font-weight: 500; }
.info-val { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-val.small { font-size: 11px; }

.action-tabs { display: flex; gap: 2px; background: var(--bg); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.action-tab {
    flex: 1; padding: 7px 0; border: none; background: transparent; color: var(--text2); font-family: var(--font);
    font-size: 12.5px; font-weight: 600; border-radius: 6px; cursor: pointer; transition: all .2s; text-align: center;
}
.action-tab:hover { color: var(--text); }
.action-tab.active { background: var(--surface); color: var(--gold); box-shadow: 0 1px 3px rgba(0,0,0,.25); }

.action-panel { display: none; flex-direction: column; gap: 12px; animation: fadeUp .2s ease; }
.action-panel.active { display: flex; }

.owner-only-badge {
    align-self: flex-start; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    padding: 3px 10px; border-radius: 20px; background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2);
}

.btn-action {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 11px 20px; border: none; border-radius: 8px; font-family: var(--font); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-action.transfer { background: rgba(52,211,153,.12); color: var(--green); border: 1px solid rgba(52,211,153,.2); }
.btn-action.transfer:hover { background: rgba(52,211,153,.2); }
.btn-action.mint { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); }
.btn-action.mint:hover { background: rgba(212,168,67,.2); }
.btn-action.burn { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.btn-action.burn:hover { background: rgba(248,113,113,.18); }

/* ---- Token List Tab ---- */
.add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.add-row input {
    flex: 1; padding: 9px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: var(--mono); font-size: 12.5px; outline: none; transition: border .2s;
}
.add-row input::placeholder { color: var(--text3); font-family: var(--font); font-size: 12px; }
.add-row input:focus { border-color: var(--gold); }

.token-list-wrap { min-height: 120px; }
.center-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px; text-align: center; color: var(--text3); font-size: 13px; }
.center-msg small { font-size: 11.5px; }

.token-grid { display: flex; flex-direction: column; gap: 8px; }
.token-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    transition: border-color .2s; animation: fadeUp .25s ease;
}
.token-row:hover { border-color: var(--border-h); }
.token-icon {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--gold-dim); border: 1px solid var(--gold-border); font-family: var(--mono);
    font-size: 11px; font-weight: 700; color: var(--gold); flex-shrink: 0;
    box-shadow: 0 0 8px var(--gold-glow);
}
.token-detail { flex: 1; min-width: 0; }
.token-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.token-top-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.token-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--gold); background: var(--gold-dim); padding: 1px 7px; border-radius: 10px; white-space: nowrap; text-shadow: 0 0 5px var(--gold-glow); }
.token-bottom { display: flex; gap: 14px; font-size: 11px; color: var(--text3); font-family: var(--mono); }
.token-bottom span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.token-acts { display: flex; gap: 4px; flex-shrink: 0; }
.token-act {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text3);
    cursor: pointer; transition: all .2s; text-decoration: none;
}
.token-act:hover { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); box-shadow: 0 0 8px var(--gold-glow); }

/* ---- Toast ---- */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
    padding: 10px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    font-size: 13px; color: var(--text); z-index: 1000; transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52,211,153,.3); }
.toast.error { border-color: rgba(248,113,113,.3); }

/* ---- Footer ---- */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 11.5px; color: var(--text3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text3); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--gold); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .container { max-width: 100%; padding: 0 16px; }
}
@media (max-width: 700px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .logo { flex-shrink: 0; }
    .nav-tabs { order: 3; width: 100%; justify-content: center; }
    .header-right { order: 2; margin-left: auto; }
    .network-pill { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .field.span-2 { grid-column: span 1; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .wallet-bar-inner { flex-direction: column; gap: 6px; }
    .add-row { flex-direction: column; }
    .token-bottom { flex-wrap: wrap; gap: 6px; }
    .panel { padding: 18px; }
    .panel-head h2 { font-size: 16px; }
    .btn-primary { font-size: 13px; padding: 11px 16px; }
    .deploy-actions { flex-direction: column; }
    .token-row { flex-wrap: wrap; gap: 8px; }
    .token-acts { width: 100%; justify-content: flex-end; }
    .action-tabs { flex-wrap: wrap; }
    .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
    .main { padding: 20px 0 40px; }
}
@media (max-width: 400px) {
    .header-inner { gap: 8px; }
    .nav-tab { padding: 6px 10px; font-size: 12px; }
    .btn-connect { padding: 6px 12px; font-size: 11px; }
    .info-grid { grid-template-columns: 1fr; }
    .panel { padding: 14px; border-radius: 10px; }
}
