/* Browse rules ported from prototype/src/directory.css, scoped to the realm application. */
:where(.realms-app) .realm-directory {
 padding-bottom:36px;
 --dir-well:#171a18;
 --dir-frame:#9ba19d;
 --dir-shadow:#050b07;
}
:where(.realms-app) .realm-directory p { line-height:1.5; }
:where(.realms-app) .realm-directory h1,:where(.realms-app) .realm-directory h2,:where(.realms-app) .realm-directory h3 { font-family:var(--heading); }
:where(.realms-app) .realm-directory.realm-directory-home { max-width:none; padding:0; }
:where(.realms-app) .dir-section-heading { display:flex; justify-content:space-between; align-items:baseline; gap:16px; margin:0 0 var(--page-flow-gap); }
:where(.realms-app) .dir-section-heading h1 { font-size:var(--page-title-size); margin:0; }
:where(.realms-app) #dir-result-count { font-size:1rem; color:var(--muted); }
:where(.realms-app) .dir-columns,:where(.realms-app) .dir-realm-row { display:grid; grid-template-columns:minmax(250px,1fr) 76px 96px 128px 115px 16px; gap:16px; align-items:center; }
:where(.realms-app) .dir-columns { padding:0 20px 9px; color:var(--muted); font-size:.875rem; }
:where(.realms-app) .dir-columns span:not(:first-child) { text-align:center; }
:where(.realms-app) .dir-realm-list { padding:10px; margin:0; list-style:none; display:grid; gap:8px; border:2px solid var(--line); background:#0e100f; box-shadow:inset 0 0 0 3px var(--dir-well); }
:where(.realms-app) .dir-realm-row { position:relative; min-height:106px; padding:16px 18px; border:2px solid var(--dir-frame); border-radius:2px; background:var(--panel); box-shadow:inset 0 0 0 3px var(--dir-well),3px 3px 0 var(--dir-shadow); transition:background .12s,border-color .12s; }
:where(.realms-app) .dir-realm-row:hover,:where(.realms-app) .dir-realm-row:focus-within { background:var(--chrome); border-color:var(--color-accent-gold); }
:where(.realms-app) .dir-realm-art { flex:0 0 54px; height:54px; display:grid; place-items:center; background:#d6dfcf; border:3px solid #111411; outline:1px solid #606d60; border-radius:2px; }
:where(.realms-app) .dir-realm-art.rapid { background:#dfd2cd; }
:where(.realms-app) .dir-realm-art.rich { background:#cde0c7; }
:where(.realms-app) .dir-realm-art .game-icon { width:35px; height:35px; }
:where(.realms-app) .dir-realm-art.large { flex-basis:68px; height:68px; }
:where(.realms-app) .dir-realm-copy { min-width:0; }
:where(.realms-app) .dir-realm-link { font-size:1.125rem; font-weight:800; color:var(--color-accent-gold); line-height:1.3; }
:where(.realms-app) .dir-realm-link::after { content:''; position:absolute; inset:0; z-index:1; }
:where(.realms-app) .dir-realm-link:hover { text-decoration:none; }
:where(.realms-app) .dir-realm-link:focus-visible { outline:none; }
:where(.realms-app) .dir-realm-row:has(.dir-realm-link:focus-visible) { outline:3px solid var(--color-accent-gold); outline-offset:3px; }
:where(.realms-app) .dir-realm-copy p { margin:5px 0 6px; color:var(--muted); font-size:.875rem; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
:where(.realms-app) .dir-status { display:inline-flex; align-items:center; gap:7px; font-size:.875rem; white-space:nowrap; line-height:1.25; color:var(--muted); }
:where(.realms-app) .dir-status i { width:6px; height:6px; background:var(--muted); border-radius:50%; flex-shrink:0; }
:where(.realms-app) .dir-status.active { color:#99dfac; }
:where(.realms-app) .dir-status.active i { background:var(--accent); }
:where(.realms-app) .dir-status.offline { color:#f1b4a4; }
:where(.realms-app) .dir-status.offline i { background:var(--color-primary); }
:where(.realms-app) .dir-empty { text-align:center; padding:70px 24px; border:1px dashed var(--line); background:var(--panel); }
:where(.realms-app) .dir-empty h1 { font-size:2rem; }
:where(.realms-app) .dir-empty h3 { font-size:1.375rem; margin:0 0 10px; }
:where(.realms-app) .dir-empty p { color:var(--muted); margin:0 0 20px; }
:where(.realms-app) .dir-readonly-rule { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px, 220px) 140px; gap:16px; align-items:center; min-height:48px; font-size:1rem; }
:where(.realms-app) .dir-readonly-rule strong { display:block; width:100%; text-align:right; justify-self:end; font-variant-numeric:tabular-nums; white-space:nowrap; }
@media (max-width:1100px) {
:where(.realms-app) .dir-columns,:where(.realms-app) .dir-realm-row { grid-template-columns:minmax(230px,1fr) 60px 80px 110px 104px 14px; gap:10px; }
}
@media (max-width:900px) {
:where(.realms-app) .dir-columns { display:none; }
:where(.realms-app) .dir-realm-row { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 12px; }
:where(.realms-app) .dir-realm-copy p { white-space:normal; }
:where(.realms-app) .dir-realm-list li:nth-child(n) { margin-right:0; margin-left:0; }
}
@media (max-width:600px) {
:where(.realms-app) .realm-directory { padding:var(--page-top) 16px 30px; }
:where(.realms-app) .dir-realm-row { padding:18px 16px; }
:where(.realms-app) .dir-realm-art { flex-basis:46px; height:46px; }
:where(.realms-app) .dir-realm-art.large { flex-basis:48px; height:48px; margin-top:4px; }
:where(.realms-app) .dir-readonly-rule { grid-template-columns:minmax(0,1fr) auto; padding:10px 0; gap:8px 12px; }
:where(.realms-app) .dir-readonly-rule strong { text-align:right; }
}
@media (prefers-reduced-motion:reduce) {
:where(.realms-app) .dir-realm-row { transition:none; }
}
:where(.realms-app) .realm-directory { container-type:inline-size; container-name:directory; }
@container directory (max-width:52rem) {
:where(.realms-app) .dir-columns { display:none; }
:where(.realms-app) .dir-realm-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
:where(.realms-app) .dir-realm-copy p { white-space:normal; }
:where(.realms-app) .dir-realm-list li:nth-child(n) { margin-right:0; margin-left:0; }
}
@container directory (max-width:30rem) {
:where(.realms-app) .dir-readonly-rule { grid-template-columns:1fr auto; }
}
:where(.realms-app) .dir-official-section { margin:0 0 40px; }
:where(.realms-app) .dir-subsection-heading { display:flex; align-items:baseline; justify-content:space-between; gap:18px; margin:0 0 12px; }
:where(.realms-app) .dir-subsection-heading h2 { margin:0; font-size:1.5rem; }
:where(.realms-app) .dir-subsection-heading>span { color:var(--muted); font-size:.875rem; }
:where(.realms-app) .dir-custom-heading { margin-bottom:14px; padding-top:4px; }
:where(.realms-app) .dir-official-realms {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;background:transparent}
:where(.realms-app) [data-official-realm] {--official-accent:var(--accent)}
:where(.realms-app) [data-official-realm=chaos] {--official-accent:var(--color-accent-gold)}
:where(.realms-app) .dir-official-realm {min-width:0;padding:24px;background:#102319}
:where(.realms-app) .dir-official-realm > p.dir-official-description {margin:24px 0 0;color:var(--muted);line-height:1.6}
:where(.realms-app) .dir-official-identity {display:flex;align-items:center;gap:24px;min-width:0}
:where(.realms-app) .dir-official-identity>div {min-width:0}
:where(.realms-app) .dir-official-thumbnail {flex:0 0 104px;width:104px;aspect-ratio:1;margin:0;padding:3px;border:1px solid var(--line);background:#000018;box-shadow:4px 4px 0 var(--dir-shadow)}
:where(.realms-app) .dir-official-thumbnail img {display:block;width:100%;height:100%;object-fit:cover}
:where(.realms-app) .dir-official-eyebrow {margin:0 0 6px;color:var(--muted);font-size:.875rem}
:where(.realms-app) .dir-official-identity h3,:where(.realms-app) .dir-official-identity h1 {margin:0;font-family:'Fredoka',var(--heading);font-weight:600;line-height:1.15}
:where(.realms-app) .dir-official-identity h3 {font-size:2.5rem}
:where(.realms-app) .dir-official-identity h3 a {color:var(--official-accent);text-decoration:none}
:where(.realms-app) .dir-official-identity h3 a:hover {text-decoration:underline;text-underline-offset:6px}
:where(.realms-app) .dir-official-counters {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:28px 0 24px}
:where(.realms-app) .dir-official-counters>div {min-width:0}
:where(.realms-app) .dir-official-counters dt {display:flex;align-items:flex-start;gap:8px;min-height:44px;color:var(--muted);font-size:1rem;line-height:1.35}
:where(.realms-app) .dir-official-counters .game-icon {width:20px;height:20px;flex-shrink:0;filter:brightness(0) invert(.84)}
:where(.realms-app) .dir-official-counters dd {text-align:left;margin:8px 0 0 28px;font-family:'Fredoka',var(--heading);font-size:clamp(1.375rem,2.2vw,2rem);font-weight:500;line-height:1.1;font-variant-numeric:tabular-nums;color:var(--text)}
:where(.realms-app) .dir-official-footer {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
:where(.realms-app) .dir-official-availability {display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:.875rem;line-height:1.5}
:where(.realms-app) .dir-official-availability:before {content:'';width:7px;height:7px;flex-shrink:0;border:1px solid currentColor;border-radius:50%}
:where(.realms-app) .dir-official-more-stats {display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:1rem;font-weight:700;text-decoration:none;min-height:44px}
:where(.realms-app) .dir-official-more-stats:hover {text-decoration:underline;text-underline-offset:5px}
:where(.realms-app) .dir-official-more-stats svg {width:20px;height:20px}
:where(.realms-app) .dir-official-statistics {padding:16px 0 24px}
:where(.realms-app) .dir-official-statistics .dir-official-identity {gap:32px;margin-bottom:48px}
:where(.realms-app) .dir-official-statistics .dir-official-thumbnail {flex-basis:144px;width:144px}
:where(.realms-app) .dir-official-statistics h1 {font-size:clamp(2rem,4vw,3.5rem);color:var(--official-accent)}
:where(.realms-app) .dir-official-statistics-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:20px;border-bottom:0}
:where(.realms-app) .dir-official-activity {padding:24px;background:rgba(255,255,255,.025)}
:where(.realms-app) .dir-official-statistics-heading h2 {margin:0;font-size:1.5rem;line-height:1.3}
:where(.realms-app) .dir-official-statistics .dir-official-counters {gap:24px;margin:0;padding:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters>div {padding:0;text-align:left}
:where(.realms-app) .dir-official-statistics .dir-official-counters>div+div {border-left:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters dt {justify-content:flex-start;min-height:44px;color:var(--text)}
:where(.realms-app) .dir-official-statistics .dir-official-counters dd {margin:12px 0 16px 28px;font-size:3rem}
:where(.realms-app) .dir-official-statistics dd.dir-official-counter-description {text-align:left;max-width:28ch;margin:0;color:var(--muted);font-family:var(--font-sans);font-size:1rem;font-weight:400;line-height:1.6}
:where(.realms-app) .dir-official-statistics .dir-official-footer {padding-top:20px;border-top:0}
:where(.realms-app) .dir-official-footer p {max-width:62ch;margin:0;color:var(--muted);font-size:1rem}
@media(max-width:600px) {
:where(.realms-app) .dir-official-realms {gap:20px}
:where(.realms-app) .dir-official-realm {padding:20px}
:where(.realms-app) .dir-official-identity {gap:20px}
:where(.realms-app) .dir-official-thumbnail {flex-basis:88px;width:88px}
:where(.realms-app) .dir-official-realm .dir-official-counters {grid-template-columns:1fr;gap:0;margin:20px 0 12px}
:where(.realms-app) .dir-official-realm .dir-official-counters>div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:12px 0}
:where(.realms-app) .dir-official-realm .dir-official-counters dt {align-items:center;min-height:0}
:where(.realms-app) .dir-official-realm .dir-official-counters dd {margin:0;font-size:1.75rem;text-align:right}
:where(.realms-app) .dir-official-statistics .dir-official-identity {gap:20px;margin-bottom:32px}
:where(.realms-app) .dir-official-statistics .dir-official-thumbnail {flex-basis:88px;width:88px}
:where(.realms-app) .dir-official-statistics .dir-official-counters {grid-template-columns:1fr;gap:0;padding:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters>div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px;text-align:left;padding:24px 0}
:where(.realms-app) .dir-official-statistics .dir-official-counters>div+div {border-left:0;border-top:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters dt {display:flex;justify-content:flex-start;grid-column:1;min-height:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters .game-icon {margin:0}
:where(.realms-app) .dir-official-statistics .dir-official-counters dd:not(.dir-official-counter-description) {grid-column:2;grid-row:1/3;margin:0;font-size:2rem;text-align:right}
:where(.realms-app) .dir-official-statistics dd.dir-official-counter-description {grid-column:1;max-width:none;margin:0}
}
/* Let the grid grow when its panels need more height, keeping the footer below them. */
:where(.realms-app) .dir-library { display:grid; grid-template-columns:minmax(300px,.42fr) minmax(0,.58fr); gap:12px; height:clamp(430px,58vh,620px); min-height:min-content; }
:where(.realms-app) .dir-library-list,:where(.realms-app) .dir-discovery-preview { min-width:0; border:2px solid var(--dir-frame); background:var(--dir-well); box-shadow:inset 0 0 0 3px #0e100f; }
:where(.realms-app) .dir-library-list { display:grid; grid-template-rows:auto minmax(0,1fr); padding:8px; overflow:hidden; }
:where(.realms-app) .dir-columns { display:grid; grid-template-columns:minmax(0,1fr) 64px; gap:12px; padding:2px 10px 8px; font-weight:700; }
:where(.realms-app) .dir-columns span:last-child { text-align:right; }
:where(.realms-app) .dir-realm-list { min-height:0; padding:2px 8px 2px 0; display:flex; flex-direction:column; gap:14px; border:0; background:transparent; box-shadow:none; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:var(--dir-frame) #0e100f; scrollbar-width:auto; }
:where(.realms-app) .dir-realm-list::-webkit-scrollbar { width:14px; }
:where(.realms-app) .dir-realm-list::-webkit-scrollbar-track { background:#0e100f; border-left:1px solid var(--dir-frame); }
:where(.realms-app) .dir-realm-list::-webkit-scrollbar-thumb { min-height:44px; border:3px solid #0e100f; background:var(--dir-frame); }
:where(.realms-app) .dir-realm-list::-webkit-scrollbar-thumb:hover { background:var(--text); }
:where(.realms-app) .dir-realm-list li:nth-child(n) { margin:0; }
:where(.realms-app) .dir-realm-row { display:block; flex:0 0 auto; min-height:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
:where(.realms-app) .dir-realm-row:hover,:where(.realms-app) .dir-realm-row:focus-within { background:transparent; border-color:transparent; }
:where(.realms-app) .dir-realm-select { width:100%; display:grid; grid-template-columns:32px minmax(0,1fr) 52px; gap:9px; align-items:center; min-height:46px; padding:4px 8px; color:var(--text); text-align:left; border:1px solid var(--dir-frame); border-radius:1px; background:var(--panel); box-shadow:none; }
:where(.realms-app) .dir-realm-select:hover { border-color:var(--color-accent-gold); background:var(--chrome); }
:where(.realms-app) .dir-realm-select[aria-pressed=true] { border-color:var(--color-accent-gold); background:var(--chrome); }
:where(.realms-app) .dir-realm-select .dir-realm-art { width:30px; height:30px; border-width:1px; }
:where(.realms-app) .dir-realm-select .dir-realm-art .game-icon { width:20px; height:20px; }
:where(.realms-app) .dir-realm-select .dir-realm-copy { display:grid; gap:1px; }
:where(.realms-app) .dir-realm-select .dir-realm-copy small,:where(.realms-app) .dir-list-population small { color:var(--muted); font-size:.75rem; line-height:1.1; }
:where(.realms-app) .dir-realm-link { color:var(--text); font-size:1rem; line-height:1.1; }
:where(.realms-app) .dir-realm-link::after { content:none; }
:where(.realms-app) .dir-list-population { display:grid; justify-items:end; font-variant-numeric:tabular-nums; }
:where(.realms-app) .dir-list-population strong { font-size:1.125rem; }
:where(.realms-app) .dir-discovery-preview { display:flex; flex-direction:column; padding:12px; background:var(--panel); }
:where(.realms-app) .dir-preview-top { display:flex; gap:16px; align-items:flex-start; padding:4px 4px 10px; border-bottom:0; }
:where(.realms-app) .dir-preview-title { flex:1; min-width:0; }
:where(.realms-app) .dir-preview-title h3 { margin:0; font-size:1.5rem; overflow-wrap:anywhere; }
:where(.realms-app) .dir-preview-top>.dir-status { flex-shrink:0; margin-top:5px; }
:where(.realms-app) .dir-preview-top p { margin:6px 0 0; color:var(--muted); font-size:.875rem; }
:where(.realms-app) .dir-preview-layout { display:grid; grid-template-columns:minmax(150px,40%) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:10px; min-height:0; flex:1; padding-top:10px; }
:where(.realms-app) .dir-preview-world { min-width:0; }
:where(.realms-app) .dir-preview-preset { margin:12px 0 0; font-family:var(--heading); font-size:1.5rem; font-weight:700; text-align:center; color:var(--accent); }
:where(.realms-app) .dir-preview-preset[data-preview-preset=chaos] { color:var(--color-accent-gold); }
:where(.realms-app) .dir-preview-thumbnail { position:relative; aspect-ratio:1; min-width:0; align-self:start; margin:0; padding:4px; border:2px solid var(--line); background:#000018; box-shadow:inset 0 0 0 2px #0e100f; }
:where(.realms-app) .dir-preview-thumbnail>img { display:block; width:100%; height:100%; object-fit:cover; }
:where(.realms-app) .dir-preview-thumbnail .dir-realm-art { position:absolute; right:10px; bottom:10px; width:38px; height:38px; border:2px solid var(--line); box-shadow:2px 2px 0 rgba(0,0,0,.7); }
:where(.realms-app) .dir-preview-rules { min-width:0; margin:0; padding:10px 12px; border:2px solid var(--line); background:var(--dir-well); }
:where(.realms-app) .dir-preview-rules { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
:where(.realms-app) .dir-highlight-note { display:block; margin-top:3px; color:var(--muted); font-size:.75rem; font-weight:400; line-height:1.4; }
:where(.realms-app) .dir-preview-rules h4 { margin:0 0 8px; color:var(--text); font-size:1rem; }
:where(.realms-app) .dir-preview-rules .dir-readonly-rule.compact { grid-template-columns:minmax(0,1fr) auto; min-height:34px; padding:4px 0; gap:12px; }
:where(.realms-app) .dir-preview-rules .dir-readonly-rule.compact strong { min-width:70px; }
:where(.realms-app) .dir-preview-footer { display:flex; grid-column:1 / -1; justify-content:flex-end; align-items:center; align-self:end; gap:12px; margin:0; }
:where(.realms-app) .dir-readonly-rule { display:grid; grid-template-columns:minmax(0,1fr) 150px 140px; gap:18px; align-items:center; min-height:42px; padding:7px 0; color:#f2f2f2; font-size:1rem; }
:where(.realms-app) .dir-readonly-rule>span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
:where(.realms-app) .dir-readonly-rule strong { display:block; width:100%; color:#f2f2f2; text-align:right; justify-self:end; font-variant-numeric:tabular-nums; white-space:nowrap; }
@media (max-width:900px) {
:where(.realms-app) .dir-official-realms { grid-template-columns:1fr; }
:where(.realms-app) .dir-library { grid-template-columns:1fr; height:auto; }
:where(.realms-app) .dir-library-list { height:min(520px,65vh); }
:where(.realms-app) .dir-discovery-preview { min-height:360px; }
:where(.realms-app) .dir-preview-footer { align-items:stretch; flex-direction:column; }
:where(.realms-app) .dir-preview-footer .btn { width:100%; white-space:nowrap; }
}
@media (max-width:600px) {
:where(.realms-app) .dir-section-heading h1 { font-size:var(--page-title-size); }
:where(.realms-app) .dir-library { min-height:0; }
:where(.realms-app) .dir-library-list { height:min(430px,62vh); }
:where(.realms-app) .dir-preview-footer { align-items:flex-start; flex-direction:column; }
:where(.realms-app) .dir-preview-footer .btn { width:100%; }
}
@container directory (max-width:62rem) {
:where(.realms-app) .dir-library { grid-template-columns:1fr; }
:where(.realms-app) .dir-library { height:auto; }
:where(.realms-app) .dir-library-list { height:min(520px,65vh); }
}

@container directory (max-width:52rem) {
:where(.realms-app) .dir-official-realms { grid-template-columns:1fr; }
}

:where(.realms-app) .dir-realm-mobile-link { display:none; }
@media (max-width:600px) {
    :where(.realms-app) .dir-library-list { height:auto; overflow:visible; }
    :where(.realms-app) .dir-realm-list { overflow:visible; padding-right:0; overscroll-behavior:auto; }
    :where(.realms-app) .dir-discovery-preview,
    :where(.realms-app) .dir-realm-desktop-select { display:none; }
    :where(.realms-app) .dir-realm-mobile-link { display:grid; text-decoration:none; }
    :where(.realms-app) .dir-preview-top { flex-wrap:wrap; }
    :where(.realms-app) .dir-preview-title { flex-basis:100%; }
    :where(.realms-app) .dir-preview-layout { grid-template-columns:minmax(0,1fr); }
    :where(.realms-app) .dir-preview-world { width:min(100%,240px); justify-self:center; }
    :where(.realms-app) .dir-preview-rules { overflow:visible; }
    :where(.realms-app) .dir-preview-rules .dir-readonly-rule>span:first-child { white-space:normal; overflow-wrap:anywhere; }
    :where(.realms-app) .dir-section-heading,
    :where(.realms-app) .dir-subsection-heading { flex-wrap:wrap; }
    :where(.realms-app) .dir-official-identity { gap:16px; }
    :where(.realms-app) .dir-official-identity h3 { font-size:clamp(1.75rem,7vw,2.5rem); overflow-wrap:anywhere; }
}
