/* Shared styles for API-driven pages */
/* Legacy purple body — only for standalone api-page shells, NEVER on Godlike Mir */
.api-page body, body.api-page:not(.mir-evolved) {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}
body.mir-evolved.api-page {
    background: transparent !important;
    color: inherit !important;
}
.api-card {
    max-width: 960px;
    margin: 100px auto 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    padding: 28px;
}
/* Dark defaults when nested in Godlike Mir shell (avoids white FOUC) */
.mir-app .api-card,
body.mir-evolved .mir-app .api-card {
    max-width: none;
    margin: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: #e8e8e8;
}
.api-card h1 { margin: 0 0 8px; text-align: center; }
.api-card .sub { text-align: center; color: #666; margin-bottom: 20px; }
.api-form { display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 420px; margin: 0 auto; }
.api-form label { font-weight: 600; font-size: 14px; display: block; }
.api-form input, .api-form select {
    display: block; width: 100%; box-sizing: border-box;
    padding: 12px 14px; border: 2px solid #c7d2fe; border-radius: 8px; font-size: 15px;
}
.api-form.hidden, .api-form[hidden] { display: none !important; }
.api-form button, .api-btn {
    padding: 12px 18px; border: none; border-radius: 8px; cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; font-weight: 700; font-size: 15px;
}
.api-btn.secondary { background: #eef2ff; color: #4338ca; }
.mir-app .api-btn,
body.mir-evolved .api-btn {
    background: #b42828;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.mir-app .api-btn.secondary,
body.mir-evolved .api-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.api-msg { text-align: center; margin: 12px 0; font-size: 14px; }
.api-msg.err { color: #c62828; }
.api-msg.ok { color: #2e7d32; }
.api-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.api-table th, .api-table td { padding: 10px 8px; border-bottom: 1px solid #eee; text-align: left; }
.api-table th { background: #f5f3ff; position: sticky; top: 0; }
/* Godlike Mir dark override for sticky white thead flash */
body.mir-evolved .mir-app .api-table th {
    background: rgba(0, 0, 0, 0.45) !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}
.api-search {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    border: 2px solid #667eea; border-radius: 8px; margin-bottom: 16px; font-size: 15px;
}
.api-links { text-align: center; margin-top: 16px; font-size: 14px; }
.api-links a { color: #667eea; font-weight: 600; margin: 0 8px; }

/* Account dashboard */
.dash-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:16px 0 12px; border-bottom:1px solid #e2e8f0; padding-bottom:8px; }
.dash-tabs button {
    border:0; background:#f1f5f9; color:#334155; padding:8px 12px; border-radius:8px;
    font-weight:700; font-size:13px; cursor:pointer;
}
.dash-tabs button.active { background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; }
.dash-panel { min-height:180px; }
.dash-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:10px; }
.dash-toolbar input[type=search] {
    flex:1; min-width:160px; padding:10px 12px; border:2px solid #c7d2fe; border-radius:8px;
}
.item-row { display:flex; gap:12px; align-items:center; padding:10px; border-bottom:1px solid #f1f5f9; cursor:pointer; }
.item-row:hover { background:#f8fafc; }
.item-row img { width:40px; height:40px; object-fit:contain; background:#f8fafc; border-radius:8px; }
.item-row .meta { flex:1; min-width:0; }
.item-row .muted { color:#94a3b8; font-size:12px; margin-left:6px; }
.item-row .item-stats-inline {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
    white-space: normal;
}
.item-name { font-weight:700; }
.grade-None, .grade-none { color:#334155; }
.grade-Common, .grade-common { color:#ca8a04; }
.grade-Rare, .grade-rare { color:#0284c7; }
.grade-Legendary, .grade-legendary { color:#ea580c; }
.grade-Mythical, .grade-mythical { color:#9333ea; }
.grade-Godly, .grade-godly { color:#dc2626; }
.grade-Ancient, .grade-ancient { color:#92400e; }
.item-sockets { margin-top:10px; }
.sock-label { font-weight:700; font-size:13px; margin-bottom:6px; }
.sock-grid { display:grid; gap:6px; }
.sock { display:flex; gap:8px; align-items:center; padding:6px 8px; border-radius:8px; background:#f8fafc; font-size:13px; }
.sock.empty { color:#94a3b8; }
.sock img { width:28px; height:28px; object-fit:contain; }
.item-awake { margin-top:10px; background:#fff7ed; border-radius:8px; padding:8px 10px; font-size:13px; }
.item-awake ul { margin:6px 0 0; padding-left:18px; }
.item-flags { margin-top:8px; display:flex; flex-wrap:wrap; gap:6px; }
.item-flags span { background:#fee2e2; color:#991b1b; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; }
.char-pick tr.selected { background:#ede9fe; }
.char-pick tr { cursor:pointer; }
.mir-modal-backdrop {
    display:none; position:fixed; inset:0; z-index:3000;
    background:rgba(15,23,42,.55); align-items:center; justify-content:center; padding:20px;
}
.mir-modal-backdrop.open { display:flex; }
.mir-modal-panel {
    display:block; background:#fff; border-radius:16px; width:min(520px,100%);
    box-shadow:0 24px 60px rgba(0,0,0,.35); overflow:hidden;
}
.modal-head { display:flex; justify-content:space-between; gap:12px; padding:18px 20px 10px; border-bottom:1px solid #e2e8f0; }
.modal-head h2 { margin:0; font-size:1.2rem; }
.modal-close { border:0; background:#f1f5f9; width:36px; height:36px; border-radius:10px; font-size:1.2rem; cursor:pointer; }
.mir-modal-body { padding:16px 20px 20px; display:grid; gap:12px; }
.modal-top { display:flex; gap:14px; }
.modal-img { width:72px; height:72px; object-fit:contain; background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:6px; }
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; background:#f8fafc; border-radius:12px; padding:12px; font-size:.9rem; }
.modal-field label { display:block; font-weight:700; font-size:.85rem; margin-bottom:6px; color:#475569; }
.modal-field input {
    width:100%; padding:10px 12px; border:2px solid #c7d2fe; border-radius:10px; font-size:1rem; box-sizing:border-box;
}
.modal-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }



