html, body {
    height: 100%;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(248, 250, 252, 0.78);
    backdrop-filter: blur(10px);
}

.portal-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.portal-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.portal-header-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.82);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.portal-logo-fallback-icon {
    flex-shrink: 0;
}

.portal-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portal-header-title {
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: rgb(15, 23, 42);
    white-space: nowrap;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.portal-bg {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0) 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(168, 85, 247, 0.14), rgba(168, 85, 247, 0) 55%),
        radial-gradient(1000px 600px at 50% 110%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 60%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 55%, #eef2ff 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .portal-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
}

.portal-col-main,
.portal-col-side {
    min-width: 0;
}

.portal-topbar {
    padding-top: 1.25rem;
}

.portal-topbar-inner {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1rem;
}

.portal-hero {
    display: grid;
    gap: 1.1rem;
    justify-items: center;
    text-align: center;
    padding: 0.5rem 0;
}

.portal-hero-logo {
    width: 8.25rem;
    height: 8.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.portal-hero-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portal-hero-search {
    width: clamp(320px, 60%, 660px);
}

.portal-hero-input {
    width: 100%;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.85);
    padding: 1rem 1.1rem;
    font-size: 1rem;
    line-height: 1.2;
    outline: none;
}

.portal-hero-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
    border-color: rgba(99, 102, 241, 0.55);
}

.portal-hero-tools {
    width: min(920px, 100%);
    display: flex;
    justify-content: center;
}

.portal-hero-tools-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    font-size: 0.95rem;
}

.portal-hero .portal-pill {
    padding: 0.55rem 1rem;
    border-radius: 9999px;
}

.portal-hero-meta {
    font-size: 0.8rem;
    color: rgb(100, 116, 139);
}

.portal-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.75);
}

.portal-pill:hover {
    background: rgba(248, 250, 252, 0.9);
}

.portal-action-btn {
    padding: 0.55rem 1rem;
    border-radius: 1.05rem;
}

.portal-card {
    border-radius: 1.125rem;
}

.portal-card-accent {
    position: relative;
    overflow: hidden;
}

.portal-card-accent::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    background: var(--portal-accent, rgba(59, 130, 246, 0.9));
}

.portal-card-accent::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--portal-accent-soft, rgba(59, 130, 246, 0.12)), rgba(255, 255, 255, 0) 140px);
    pointer-events: none;
}

.portal-card-accent > * {
    position: relative;
}

.md-content {
    color: rgb(15, 23, 42);
    line-height: 1.75;
    word-break: break-word;
}

.md-content h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 1.2rem 0 0.75rem;
}

.md-content h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 1.1rem 0 0.6rem;
}

.md-content h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 1rem 0 0.45rem;
}

.md-content p {
    margin: 0.5rem 0;
}

.md-content ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
    list-style: disc;
}

.md-content ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
    list-style: decimal;
}

.md-content li {
    margin: 0.25rem 0;
}

.md-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    background: rgba(148, 163, 184, 0.2);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.4rem;
    padding: 0.12rem 0.35rem;
}

.md-content pre {
    overflow: auto;
    background: rgba(15, 23, 42, 0.92);
    color: rgba(226, 232, 240, 0.96);
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    margin: 0.85rem 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.md-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.md-content a {
    color: rgb(67, 56, 202);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.md-content blockquote {
    margin: 0.8rem 0;
    padding: 0.6rem 0.9rem;
    border-left: 3px solid rgba(99, 102, 241, 0.6);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 0.75rem;
    color: rgb(51, 65, 85);
}

.portal-accent-sky {
    --portal-accent: rgba(14, 165, 233, 0.95);
    --portal-accent-soft: rgba(14, 165, 233, 0.14);
}

.portal-accent-violet {
    --portal-accent: rgba(139, 92, 246, 0.95);
    --portal-accent-soft: rgba(139, 92, 246, 0.14);
}

.portal-accent-amber {
    --portal-accent: rgba(245, 158, 11, 0.95);
    --portal-accent-soft: rgba(245, 158, 11, 0.14);
}

.portal-accent-emerald {
    --portal-accent: rgba(16, 185, 129, 0.95);
    --portal-accent-soft: rgba(16, 185, 129, 0.14);
}

.portal-accent-fuchsia {
    --portal-accent: rgba(217, 70, 239, 0.95);
    --portal-accent-soft: rgba(217, 70, 239, 0.14);
}

.portal-accent-indigo {
    --portal-accent: rgba(99, 102, 241, 0.95);
    --portal-accent-soft: rgba(99, 102, 241, 0.14);
}

.portal-accent-rose {
    --portal-accent: rgba(244, 63, 94, 0.95);
    --portal-accent-soft: rgba(244, 63, 94, 0.14);
}

.portal-subcard {
    border-radius: 1rem;
}

.portal-btn {
    border-radius: 0.75rem;
}

.portal-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}

.portal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.portal-status {
    border-radius: 9999px;
}

.portal-status.portal-status-bad {
    border-color: rgba(248, 113, 113, 0.4);
}

.portal-skeleton {
    border-radius: 0.75rem;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.25), rgba(226, 232, 240, 0.6), rgba(226, 232, 240, 0.25));
    background-size: 200% 100%;
    animation: portal-shimmer 1.2s ease-in-out infinite;
}

@keyframes portal-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.portal-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mythicstats-spec-link {
    -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.7);
    text-shadow:
        0 0 1px rgba(255, 255, 255, 0.35),
        -0.6px 0 rgba(0, 0, 0, 0.6),
        0.6px 0 rgba(0, 0, 0, 0.6),
        0 -0.6px rgba(0, 0, 0, 0.6),
        0 0.6px rgba(0, 0, 0, 0.6);
}
