/* draft.ogreclan.com. The colours (--bg, --accent and so on) are in theme.css, one set per colour scheme. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Verdana, sans-serif;
	background: var(--bg);
	color: var(--text);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 24px 0 10px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
p { margin: 8px 0; }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.boot { text-align: center; color: #667085; margin-top: 30vh; font-family: sans-serif; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.spacer { flex: 1; }

/* the frame */
.top {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 20px;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.brand img { width: 44px; height: 44px; margin: -4px 0; }
.hero { display: flex; align-items: center; gap: 24px; }
.hero > img { width: 168px; height: 168px; flex: none; }
@media (max-width: 640px) { .hero { flex-direction: column; text-align: center; } .hero > img { width: 140px; height: 140px; } }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.who img { width: 28px; height: 28px; border-radius: 50%; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 20px 60px; }
footer { max-width: 1180px; margin: 0 auto; padding: 0 20px 30px; color: var(--muted); font-size: 12px; }

/* pieces */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack > * + * { margin-top: 10px; }
button, .button, select, input, textarea {
	font: inherit;
	color: inherit;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 7px;
	padding: 6px 12px;
}
textarea { width: 100%; font: 13px ui-monospace, Menlo, Consolas, monospace; }
button, .button { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.55; cursor: default; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); }
button.small, .button.small { padding: 2px 8px; font-size: 13px; }
button.link { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
input[type="checkbox"] { width: auto; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { color: var(--text); font-size: 15px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.badge.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); margin: 10px 0; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--good-bg); color: var(--good); }
.empty { color: var(--muted); font-style: italic; }
.code-big { font: 700 30px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 600; }
tr.you td { background: var(--you); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Pokémon */
.mon { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mon img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; margin: -6px -2px; }
.mon .name { font-weight: 600; }
.mon.stacked .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mon.stacked img { margin: -4px -2px; }
.types { display: inline-flex; gap: 3px; }
.type { display: inline-block; min-width: 46px; padding: 0 4px; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700; text-align: center; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.type-Normal { background: #a8a878; } .type-Fire { background: #f08030; } .type-Water { background: #6890f0; }
.type-Electric { background: #e0b820; } .type-Grass { background: #78c850; } .type-Ice { background: #78c8c8; }
.type-Fighting { background: #c03028; } .type-Poison { background: #a040a0; } .type-Ground { background: #d0a848; }
.type-Flying { background: #a890f0; } .type-Psychic { background: #f85888; } .type-Bug { background: #a8b820; }
.type-Rock { background: #b8a038; } .type-Ghost { background: #705898; } .type-Dragon { background: #7038f8; }
.type-Dark { background: #705848; } .type-Steel { background: #a8a8c0; } .type-Fairy { background: #e890a8; }
.roster { list-style: none; padding: 0; margin: 8px 0 0; }
.roster li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); }
.roster li:first-child { border-top: none; }
.pts { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.star { color: #d4a017; }

/* league */
.league-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.viewing-as { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 12px;
	flex-wrap: wrap; padding: 8px 16px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--border); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.guides .card h2 { margin-top: 24px; }
.guides .card h3 { margin-top: 18px; }
.guides li { margin: 4px 0; }
.guide-table td { vertical-align: top; }
.guide-table td:first-child { min-width: 120px; }
.guide-table code { white-space: normal; overflow-wrap: anywhere; }
.clock { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 16px; }
.clock.yours { background: var(--good-bg); }
.clock .big { font-size: 18px; font-weight: 700; }
.board td { min-width: 120px; }
.board td.skipped { color: var(--muted); font-style: italic; }
.board td.next { outline: 2px solid var(--accent); outline-offset: -2px; }
.picker-list { max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.picker-list table td { border-bottom-color: var(--border); }
.picker-list tr.cant td { opacity: 0.5; }
.history li { margin: 4px 0; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.15); white-space: pre-line; }
.toast.bad { border-color: var(--bad); }
.toast.good { border-color: var(--good); }

/* the planner, from the extension, in its own box */
.planner-host { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-height: 70vh; }

@media (max-width: 700px) {
	.top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
	main { padding: 14px 12px 50px; }
	.card { padding: 12px; }
	h1 { font-size: 22px; }
}
ol.queue { padding-left: 22px; margin: 6px 0; }
ol.queue li { margin: 4px 0; }
.tier { margin-top: 14px; }
.tier h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tier-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.tier-mon { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.tier-mon.taken { opacity: 0.55; }
.tier-mon.mine { opacity: 1; border-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-picker select { padding: 3px 6px; font-size: 13px; max-width: 170px; }
.board td.choosable { cursor: pointer; }
.board td.choosable:hover { outline: 2px solid var(--accent); outline-offset: -2px; }

/* OgreClan AI's chat (pages/chat.tsx) */
.chat { max-width: 760px; margin: 0 auto; min-width: 0; }
/* the conversations beside the chat; on a phone, behind the Conversations button */
.chat-app { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; max-width: 1120px; margin: 0 auto; align-items: start; }
.chat-app .chat { max-width: none; width: 100%; }
.chat-list { position: sticky; top: 12px; display: grid; gap: 10px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 12px;
	border-radius: 12px; border: 1px solid var(--border); background: var(--panel); }
.chat-list nav { display: grid; gap: 2px; }
.chat-list nav a { display: grid; gap: 1px; padding: 7px 9px; border-radius: 8px; color: var(--text); text-decoration: none; }
.chat-list nav a:hover { background: var(--accent-soft); }
.chat-list nav a.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.chat-list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-privacy { margin: 4px 0 0; line-height: 1.45; }
.chat-head { justify-content: space-between; flex-wrap: nowrap; }
.chat-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 1.5rem; }
.chat-context { gap: 14px; flex-wrap: wrap; }
.chat-context input { width: 230px; max-width: 100%; }
.chat-list-toggle { display: none; }
@media (max-width: 760px) {
	.chat-app { grid-template-columns: minmax(0, 1fr); }
	.chat-list { display: none; position: static; max-height: none; }
	.chat-app.show-list .chat-list { display: grid; }
	.chat-list-toggle { display: inline-flex; }
}
.chat-log { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; min-height: 120px; }
.chat-message { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); max-width: 92%; }
.chat-message.user { align-self: flex-end; background: var(--accent-soft); }
.chat-message.assistant { align-self: flex-start; background: var(--panel); }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; padding: 8px 0; background: var(--bg); }
.chat-form textarea { flex: 1; min-width: 0; }

/* OCDL's divisions (src/divisions.tsx): each one's artwork as a banner, a tile or a card's header, and its mask colour */
[data-division="teal"] { --division: #52d69e; }
[data-division="wellspring"] { --division: #4fc8ea; }
[data-division="hearthflame"] { --division: #ff8a3d; }
[data-division="cornerstone"] { --division: #bba8f2; }
.mask { width: 1em; height: 1em; flex: none; color: var(--division, var(--accent)); }
.division-banner, .division-tile, .division-card-art {
	background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--division, var(--accent)) 45%, transparent), transparent 70%), #101614;
}
.division-banner img.missing, .division-tile img.missing, .division-card-art.missing { visibility: hidden; }
.league-head > div:has(> .division-banner) { flex: 1 1 100%; }
.division-banner {
	position: relative; margin: 6px 0 10px; border-radius: 12px; overflow: hidden;
	box-shadow: 0 0 0 1px var(--border), 0 0 0 3px color-mix(in srgb, var(--division) 55%, transparent);
}
.division-banner img { display: block; width: 100%; height: clamp(130px, 22vw, 230px); object-fit: cover; object-position: center 55%; }
.division-banner-title {
	position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 12px; padding: 48px 18px 14px;
	background: linear-gradient(transparent, rgb(6 10 9 / 0.86) 62%); color: #f4efe4;
}
.division-banner-title .mask { width: 56px; height: 56px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.5)); }
.division-banner-title h1 { margin: 0; color: #f8f3e8; text-shadow: 0 1px 3px rgb(0 0 0 / 0.5); }
.division-banner-title p { margin: 2px 0 0; font-size: 13px; font-style: italic; color: rgb(244 239 228 / 0.78); }
.division-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 0 0 16px; }
@media (max-width: 640px) { .division-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } }
.division-tile {
	position: relative; display: block; aspect-ratio: 834 / 467; border-radius: 10px; overflow: hidden; color: #f4efe4; text-decoration: none;
	box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgb(0 0 0 / 0.18); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.division-tile:hover, .division-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--division), 0 10px 24px rgb(0 0 0 / 0.25); }
.division-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.division-tile-label {
	position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 8px; padding: 24px 12px 9px;
	background: linear-gradient(transparent, rgb(6 10 9 / 0.86));
}
.division-tile-label .mask { width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.5)); }
.division-tile-label strong { display: block; font-size: 16px; }
.division-tile-label small { color: rgb(244 239 228 / 0.75); font-size: 12px; }
.division-card { position: relative; overflow: hidden; padding-top: 104px; }
.division-card-art { position: absolute; top: 0; left: 0; width: 100%; height: 90px; object-fit: cover; object-position: center 55%; }
.division-card-mask { position: absolute; left: 12px; top: 54px; width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.5)); }
img.mask { object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .division-tile { transition: none; } .division-tile:hover { transform: none; } }

/*
 * The four division schemes (theme.css) put the division's artwork behind the page. Here: a frosted top bar,
 * shrine-corner brackets on cards, calligraphic titles, and a soft shadow on text that sits straight on the picture.
 */
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) {
	--display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) .top {
	background: color-mix(in srgb, var(--panel) 84%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) :is(h1, h2, .brand) {
	font-family: var(--display);
	font-weight: 700;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) .card { position: relative; }
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) .card::before {
	content: "";
	position: absolute;
	inset: 5px;
	pointer-events: none;
	border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
	-webkit-mask: linear-gradient(#000 0 0) top left / 14px 14px no-repeat, linear-gradient(#000 0 0) top right / 14px 14px no-repeat,
		linear-gradient(#000 0 0) bottom left / 14px 14px no-repeat, linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat;
	mask: linear-gradient(#000 0 0) top left / 14px 14px no-repeat, linear-gradient(#000 0 0) top right / 14px 14px no-repeat,
		linear-gradient(#000 0 0) bottom left / 14px 14px no-repeat, linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat;
	border-radius: 6px;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) main {
	text-shadow: 0 1px 3px rgb(0 0 0 / 0.65);
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) main
	:is(.card, .notice, .clock, table, input, select, textarea, button, .button, .badge, .chat-message, .tier-mon) {
	text-shadow: none;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) footer {
	color: color-mix(in srgb, var(--text) 70%, transparent);
	text-shadow: 0 1px 3px rgb(0 0 0 / 0.65);
}
/* their division's mask on primary buttons and beside the colour scheme picker */
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) :is(button.primary, .button.primary)::before {
	content: "";
	flex: none;
	width: 1.3em;
	height: 1.3em;
	margin: -2px 0;
	background: var(--mask) center / contain no-repeat;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) .theme-picker {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
:root:is([data-theme="teal"], [data-theme="hearthflame"], [data-theme="wellspring"], [data-theme="cornerstone"]) .theme-picker::before {
	content: "";
	width: 26px;
	height: 26px;
	background: var(--mask) center / contain no-repeat;
}
