:root { color-scheme: light; --ink: #243e39; --paper: #faf8e6; --green: #28694f; --line: #526b59; }
body { background: #ced7b5 !important; color: var(--ink); font-family: "Courier New", monospace; }
button, input, textarea, select { font: inherit; }
.emerurd-home { max-width: 1120px; margin: auto; padding: 24px; box-sizing: border-box; }
.emerurd-title { text-align: center; position: relative; padding: 28px 16px 40px; }
.emerurd-kicker { letter-spacing: .22em; font-size: 12px; }
.emerurd-title h1 { color: #246448; font-size: clamp(40px, 8vw, 76px); letter-spacing: .08em; margin: 8px 0; text-shadow: 3px 3px #f8efba, 5px 5px #647955; }
.emerurd-title p { margin: 12px 0; }
.emerurd-connection { display: inline-block; border: 2px solid var(--line); padding: 5px 10px; background: #eee6cd; font-size: 12px; }
.emerurd-connection.online { background: #e0eed1; }
.emerurd-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.emerurd-columns > div > .emerurd-roster-card { margin-bottom: 16px; }
.emerurd-card { background: var(--paper); border: 3px solid var(--line); outline: 2px solid #e5e6bf; box-shadow: 4px 4px #9aa984; padding: 20px; margin: 0 0 24px; border-radius: 2px; }
.emerurd-card h2 { margin: -20px -20px 18px; padding: 12px 18px; background: #e0e6c9; border-bottom: 2px solid var(--line); font-size: 19px; }
.emerurd-card h2 span { display: block; font-weight: normal; font-size: 13px; margin-top: 5px; }
.emerurd-card p { font-size: 14px; line-height: 1.65; }
.emerurd-card label { display: block; font-size: 14px; font-weight: bold; }
.emerurd-card input, .emerurd-card textarea { display: block; box-sizing: border-box; width: 100%; margin: 8px 0 14px; padding: 12px; border: 2px solid #8a987c; background: #fffef4; color: var(--ink); border-radius: 0; }
.emerurd-card textarea { resize: vertical; font-size: 13px; line-height: 1.45; }
.emerurd-home .button, .battle-controls .button { background: #e5eacb; border: 2px solid #536952; border-radius: 2px; box-shadow: 2px 2px #b6c09b; color: #233d32; padding: 9px 13px; text-shadow: none; cursor: pointer; font-family: inherit; }
.emerurd-home .button:hover:not(:disabled) { background: #c8ddb6; }
.emerurd-home button:disabled { opacity: .5; cursor: default; }
.emerurd-home button:focus-visible, .emerurd-home a:focus-visible { outline: 3px solid #af622d; outline-offset: 3px; }
.emerurd-home .emerurd-hint { font-size: 12px; color: #5b695b; }
.emerurd-preview article { display: flex; align-items: center; border-top: 1px dashed #b9c0a2; padding: 8px 0; }
.emerurd-preview img { width: 64px; height: 64px; flex-shrink: 0; }
.emerurd-preview span, .emerurd-preview small { display: block; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.emerurd-players { padding: 0; list-style: none; }
.emerurd-players li { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #b9c0a2; gap: 12px; }
.emerurd-players small { display: block; margin-top: 5px; font-size: 11px; }
.emerurd-match, .emerurd-invite { background: #edf0d9; border: 2px solid #a5b18e; padding: 12px; margin: 12px 0; }
.emerurd-match h3 { font-size: 15px; margin: 0; }
.emerurd-match h3 span { display: inline-block; padding: 5px 10px; background: var(--green); color: white; }
.emerurd-game-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; margin-bottom: 14px; }
.emerurd-home a { color: #265d48; }
.emerurd-error { white-space: pre-wrap; background: #ffecce; border: 3px solid #a75d34; padding: 16px; margin-bottom: 24px; }
.emerurd-home footer { text-align: center; font-size: 11px; line-height: 1.8; padding: 10px; }
.header { background: #e1e6cb !important; border-color: var(--line) !important; }
.emerurd-brand { font-size: 18px; font-weight: bold; padding: 12px; color: var(--green); }
.header .logo, .header .options, .header .userbar button[data-href="options"], .header .userbar button[name="openUserOptions"] { display: none; }
.ps-room { background: #d4ddc0; }
.battle { border: 3px solid #526b59; background: #abc68a; }
.battle .statbar { font-family: "Courier New", monospace; border-radius: 0; }
.battle .statbar .hpbar, .battle .statbar .hpbar .hp { border-radius: 0; }
.battle .statbar .hpbar { border: 2px solid #3d5544; background: #f5f0d4; }
.battle .statbar .hpbar .hp { background: #50ba79; border-color: #3f9261; }
.battle-log, .battle-log-add { background: #faf8e6; font-family: "Courier New", monospace; }
.battle-log-add, .battle-controls .openteamsheets, .battle-controls button[name="openSheet"] { display: none; }
.chat-log-add { display: none; }
.emerurd-category { display: inline-block; border: 1px solid #68775e; background: #e0e6c9; padding: 1px 3px; font: 10px monospace; }
.battle-controls { background: #d4ddc0; font-family: "Courier New", monospace; }
@media (max-width: 760px) { .emerurd-columns { grid-template-columns: 1fr; gap: 0; } .emerurd-home { padding: 16px; } .emerurd-title { padding-top: 12px; } }

.emerurd-graphics .battle img, .emerurd-graphics .pokemonicon, .emerurd-graphics .emerurd-preview img { image-rendering: pixelated; }
.emerurd-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
.emerurd-home .emerurd-trainer { width: 64px; height: 64px; object-fit: contain; vertical-align: middle; image-rendering: pixelated; flex-shrink: 0; }
.emerurd-team-card h2 { display: flex; align-items: center; gap: 12px; }
.emerurd-export { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.emerurd-home input, .emerurd-home select, .emerurd-home textarea { box-sizing: border-box; max-width: 100%; }
.emerurd-home input[type="password"], .emerurd-home input[type="search"], .emerurd-home select { display: block; width: 100%; margin: 8px 0 16px; padding: 10px; font: inherit; }
.emerurd-admin form { margin: 20px 0; }
.emerurd-sprite-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; margin: 16px 0; }
.emerurd-sprite-picker button { background: #edf0d9; border: 2px solid #a5b18e; cursor: pointer; padding: 6px; color: #243e31; }
.emerurd-sprite-picker button.selected { border: 3px solid #265d48; background: #c5e2ae; }
.emerurd-sprite-picker img { display: block; width: 64px; height: 64px; margin: auto; image-rendering: pixelated; }
.emerurd-sprite-picker span { display: block; font-size: 11px; }
.emerurd-notice { padding: 16px; background: #d5edc1; border: 2px solid #527747; }
.emerurd-team-card, .emerurd-columns > div { min-width: 0; }
.emerurd-preview small { overflow-wrap: anywhere; }

/* Public team directory */
.emerurd-roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.emerurd-roster-card { min-width: 0; background: #faf8e6; border: 2px solid #526b59; box-shadow: 4px 4px #a8b89a; }
.emerurd-roster-card > header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #265d48; color: #faf8e6; }
.emerurd-roster-card > header img { width: 64px; height: 64px; image-rendering: pixelated; }
.emerurd-roster-card > header span { font-size: 10px; letter-spacing: .18em; color: #c8ddb6; }
.emerurd-roster-card h3 { margin: 5px 0 0; font-size: 21px; overflow-wrap: anywhere; }
.emerurd-roster-details > summary { display: block; cursor: pointer; padding: 18px 12px 0; list-style: none; }
.emerurd-roster-details > summary::-webkit-details-marker { display: none; }
.emerurd-roster-six { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 4px; text-align: center; }
.emerurd-roster-six img { width: 64px; height: 64px; image-rendering: pixelated; }
.emerurd-roster-six span { display: block; font-size: 11px; overflow-wrap: anywhere; }
.emerurd-roster-toggle { display: block; margin: 18px -12px 0; padding: 12px 18px; border-top: 1px solid #bec8ac; background: #e0e6c9; font-size: 13px; font-weight: bold; color: #265d48; }
.emerurd-roster-details .when-open, .emerurd-roster-details[open] .when-closed { display: none; }
.emerurd-roster-details[open] .when-open { display: inline; }
.emerurd-roster-details summary:focus-visible { outline: 3px solid #af622d; outline-offset: -3px; }
.emerurd-roster-details > summary:hover .emerurd-roster-toggle { background: #c8ddb6; }
.emerurd-roster-panels { display: grid; gap: 14px; padding: 16px; }
.emerurd-roster-mon { padding: 14px; background: #fffef4; border: 1px solid #bec8ac; min-width: 0; }
.emerurd-roster-mon-heading { display: flex; gap: 12px; align-items: center; }
.emerurd-roster-mon-heading img { width: 64px; height: 64px; flex-shrink: 0; image-rendering: pixelated; }
.emerurd-roster-mon h4 { font-size: 16px; margin: 0 0 6px; overflow-wrap: anywhere; }
.emerurd-roster-mon-heading p { font-size: 11px; margin: 0; overflow-wrap: anywhere; }
.emerurd-roster-fields { display: grid; gap: 9px; margin: 16px 0; }
.emerurd-roster-fields > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.emerurd-roster-fields dt { color: #596950; }
.emerurd-roster-fields dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.emerurd-roster-mon h5 { display: flex; justify-content: space-between; margin: 0; font-size: 11px; color: #596950; }
.emerurd-roster-mon h5 span { font-weight: normal; }
.emerurd-roster-moves { list-style: none; padding: 0; margin: 6px 0 16px; }
.emerurd-roster-moves li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e0e6c9; font-size: 12px; }
.emerurd-roster-moves li span { overflow-wrap: anywhere; }
.emerurd-roster-moves small { white-space: nowrap; color: #596950; }
.emerurd-roster-ivs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; background: #edf0d9; padding: 10px 0; text-align: center; }
.emerurd-roster-ivs dt { font-size: 9px; color: #596950; }
.emerurd-roster-ivs dd { margin: 5px 0 0; font-size: 13px; font-weight: bold; }
.emerurd-roster-meta { font-size: 10px; color: #596950; margin: 10px 0 0; line-height: 1.6; }
.emerurd-roster-export { margin: 0 16px 16px; font-size: 12px; }
.emerurd-roster-export summary { padding: 12px 0; cursor: pointer; }
.emerurd-roster-empty { padding: 24px; color: #596950; }
@media (max-width: 760px) { .emerurd-roster-grid { grid-template-columns: 1fr; } }

.emerurd-roster-portrait { position: relative; flex-shrink: 0; width: 76px; height: 72px; }
.emerurd-roster-item { position: absolute; bottom: 0; right: 0; width: 24px; height: 24px; image-rendering: pixelated; }
.emerurd-roster-moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.emerurd-roster-moves li { display: flex; flex-direction: column; gap: 6px; padding: 9px; border: 2px solid #82967b; border-radius: 5px; background: #edf0d9; box-shadow: inset 0 0 0 2px #fffef4; }
.emerurd-roster-moves small { align-self: flex-end; font-size: 10px; }
.emerurd-move-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.emerurd-move-heading img { width: 32px; height: 16px; flex-shrink: 0; image-rendering: pixelated; }
.emerurd-roster-stats { display: grid; gap: 7px; }
.emerurd-stat-row { display: grid; grid-template-columns: 55px minmax(0, 1fr) 30px 39px; gap: 7px; align-items: center; font-size: 11px; }
.emerurd-stat-row strong { text-align: right; }
.emerurd-stat-row small { color: #596950; font-size: 10px; }
.emerurd-stat-track { height: 8px; background: #e0e6c9; border-radius: 2px; overflow: hidden; }
.emerurd-stat-track > span { display: block; height: 100%; background: #548768; }
.stat-band-1 .emerurd-stat-track > span { background: #f34444; }
.stat-band-2 .emerurd-stat-track > span { background: #ff7f0f; }
.stat-band-3 .emerurd-stat-track > span { background: #ffdd57; }
.stat-band-4 .emerurd-stat-track > span { background: #a0e515; }
.stat-band-5 .emerurd-stat-track > span { background: #23cd5e; }
.stat-band-6 .emerurd-stat-track > span { background: #00c2b8; }

.emerurd-archive { margin-top: 64px; padding-top: 36px; border-top: 8px solid #b95b20; }
.emerurd-archive-logo { display: block; width: min(100%, 520px); height: auto; margin: 0 auto 28px; border: 4px solid #b95b20; image-rendering: pixelated; box-sizing: border-box; }
.emerurd-archive > h2 { color: #914019; }
.emerurd-archive .emerurd-roster-card { border-color: #b95b20; background: #fff6e4; box-shadow: 4px 4px #dfaa77; }
.emerurd-archive .emerurd-roster-card > header { background: #a94c1b; }
.emerurd-archive .emerurd-roster-card > header span { color: #ffdfaa; }
.emerurd-archive .emerurd-roster-toggle { background: #f6d6aa; border-color: #d6a276; color: #78320e; }
.emerurd-archive .emerurd-roster-details > summary:hover .emerurd-roster-toggle { background: #eec18d; }

.emerurd-title .emerurd-account-link { display: block; width: max-content; margin-left: auto; }
