/*
 * The public pages: login, logout, registration, account activation and password recovery.
 * Loaded by templates/public/shell.php, which every one of those pages calls. Nothing in the
 * game shell reads this file, and nothing here assumes Bootstrap.
 *
 * Mobile first. The only breakpoints are 600px (form rows go side by side) and 820px (the
 * registration steps put their drawing beside the form).
 */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600&display=swap');

:root {
	--pub-ink: #2c2417;
	--pub-ink-soft: #6b5b45;
	--pub-ink-faint: #8f7f68;
	--pub-link: #8b1a0e;
	--pub-link-hover: #b3281a;
	--pub-line: #867a6a;
	--pub-paper: rgba(255, 252, 244, .88);
	--pub-paper-solid: #fbf6ea;
	--pub-field: #fff;
	--pub-gold-1: #ffec64;
	--pub-gold-2: #ffab23;
	--pub-gold-edge: #d98d12;
	--pub-error-bg: #f7d1cd;
	--pub-error-ink: #a61a0c;
	--pub-ok-bg: #e3efd2;
	--pub-ok-ink: #3d5a1c;
	--pub-radius: 6px;
	--pub-shadow: 0 0 12px 2px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.pub {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--pub-ink);
	font-family: 'Jost', 'Segoe UI', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	background-color: #d9d2c8;
	background-image: url('/templates/layout-default/img/bg_lemn.jpg');
}

.pub a { color: var(--pub-link); text-decoration: none; }
.pub a:hover { color: var(--pub-link-hover); text-decoration: underline; }

.pub h1, .pub h2, .pub h3 {
	font-family: Georgia, 'Times New Roman', serif;
	font-weight: normal;
	color: var(--pub-ink);
	margin: 0 0 .4em;
	line-height: 1.2;
}
.pub h1 { font-size: 26px; }
.pub h2 { font-size: 22px; }
.pub h3 { font-size: 18px; }

.pub-main { flex: 1 0 auto; width: 100%; }

/* ------------------------------------------------------------------ the parchment card */

.pub-card {
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	padding: 18px 16px;
	background: var(--pub-paper);
	border: 1px solid var(--pub-line);
	border-radius: var(--pub-radius);
	box-shadow: var(--pub-shadow);
}
.pub-card.wide { max-width: 640px; }
.pub-card > :last-child { margin-bottom: 0; }
@media (min-width: 600px) {
	.pub-card { padding: 22px 24px; }
}

.pub-center { text-align: center; }
.pub-muted { color: var(--pub-ink-soft); }
.pub-small { font-size: 13px; }
.pub-p { margin: 0 0 12px; }

/* a plain centred column for the pages that are just one card */
.pub-page {
	padding: 40px 16px;
}
@media (min-width: 600px) {
	.pub-page { padding: 80px 16px; }
}

/* ------------------------------------------------------------------ forms */

.pub-field { margin: 0 0 12px; }
.pub-field label,
.pub-label {
	display: block;
	margin: 0 0 3px;
	font-size: 14px;
	color: var(--pub-ink-soft);
}
.pub-input,
.pub-select {
	display: block;
	width: 100%;
	min-height: 42px;
	padding: 8px 10px;
	font: inherit;
	font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
	color: #5c170e;
	background: var(--pub-field);
	border: 1px solid #c9bfae;
	border-radius: 5px;
	box-shadow: inset 0 1px 3px rgba(66, 66, 66, .15);
}
.pub-input:focus,
.pub-select:focus {
	outline: none;
	border-color: var(--pub-gold-edge);
	box-shadow: 0 0 0 3px rgba(255, 171, 35, .3);
}
.pub-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--pub-ink-faint); }

/* label left, input right, once there is room */
@media (min-width: 600px) {
	.pub-row {
		display: flex;
		align-items: center;
		gap: 12px;
	}
	.pub-row > .pub-label { flex: 0 0 90px; margin: 0; }
	.pub-row > .pub-input { flex: 1 1 auto; }
}

.pub-pair { display: flex; gap: 10px; }
.pub-pair > * { flex: 1 1 0; min-width: 0; }

.pub-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 12px;
	cursor: pointer;
}
.pub-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }

.pub-captcha {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}
.pub-captcha img { display: block; border-radius: 4px; background: #fff; }
.pub-captcha .pub-input { width: 90px; flex: 0 0 90px; text-align: center; }
.pub-captcha-reload { font-size: 13px; }

.pub-btn {
	display: inline-block;
	min-height: 42px;
	padding: 9px 22px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	color: #333;
	text-align: center;
	text-decoration: none;
	text-shadow: 0 1px 0 #ffee66;
	cursor: pointer;
	background: linear-gradient(to bottom, var(--pub-gold-1) 5%, var(--pub-gold-2) 100%);
	border: 1px solid var(--pub-gold-edge);
	border-radius: 6px;
	box-shadow: inset 0 1px 0 0 #fff6af;
}
.pub-btn:hover {
	color: #222;
	text-decoration: none;
	background: linear-gradient(to bottom, var(--pub-gold-2) 5%, var(--pub-gold-1) 100%);
}
.pub-btn:active { transform: translateY(1px); }
.pub-btn.block { display: block; width: 100%; }
.pub-btn.quiet {
	color: var(--pub-ink);
	text-shadow: none;
	background: rgba(255, 255, 255, .6);
	border-color: var(--pub-line);
	box-shadow: none;
}
.pub-btn.quiet:hover { background: #fff; }

.pub-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 0; }

.pub-links {
	margin: 12px 0 0;
	font-size: 14px;
	text-align: center;
}
.pub-links .sep { color: var(--pub-ink-faint); margin: 0 6px; }

.pub-msg {
	margin: 0 0 12px;
	padding: 8px 10px;
	border-radius: 4px;
	font-size: 14px;
}
.pub-msg.error { background: var(--pub-error-bg); color: var(--pub-error-ink); }
.pub-msg.ok { background: var(--pub-ok-bg); color: var(--pub-ok-ink); }
.pub-msg.warn { background: #710000; color: #fff; }
.pub-msg.warn a { color: #ffcc00; }
.pub-msg:empty { display: none; }

/* ------------------------------------------------------------------ footer */

.pub-foot {
	flex: 0 0 auto;
	padding: 18px 16px 22px;
	text-align: center;
	font-size: 12px;
	color: var(--pub-ink-soft);
}
.pub-foot a { color: var(--pub-ink-soft); text-decoration: underline; }
.pub-foot .sep { margin: 0 6px; }

.pub-foot.dark {
	margin-top: 30px;
	color: #b9a488;
	background: linear-gradient(to bottom, #2a1606, #0e0000);
}
.pub-foot.dark a { color: #d9c3a0; }
.pub-foot .pub-manifest {
	max-width: 760px;
	margin: 12px auto 0;
	font-size: 11px;
	color: #7a6552;
}

/* ================================================================== LOGIN */

/* the strip of online player names across the top */
.pub-online {
	padding: 6px 16px;
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
	color: var(--pub-ink);
	background: rgba(255, 255, 255, .6);
	border-bottom: 1px solid rgba(134, 122, 106, .6);
	max-height: 4.6em;      /* three lines on a phone, then it scrolls */
	overflow-y: auto;
}

/* the 30 day graph after the last name: players (dark) and activity (gold), two curves, no text */
.pub-actgraph {
	display: inline-block;
	width: 80px;
	height: 12px;
	margin-left: 8px;
	vertical-align: -1px;
	overflow: visible;
}
.pub-actgraph path { fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.pub-actgraph .p { stroke: #6b5b45; opacity: .75; }
.pub-actgraph .a { stroke: #d98d12; opacity: .9; }
.pub-actwrap { display: inline-block; margin-left: 8px; cursor: default; outline: none; }
.pub-actwrap .pub-actgraph { margin-left: 0; }
/* the hover card. position: fixed and placed by script (authentication.php), because the online
   strip scrolls and would clip anything positioned inside it */
.pub-acttip {
	position: fixed;
	z-index: 50;
	display: none;
	min-width: 220px;
	max-width: calc(100vw - 16px);
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.5;
	text-align: left;
	white-space: nowrap;
	color: var(--pub-ink);
	background: var(--pub-paper-solid);
	border: 1px solid var(--pub-line);
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	pointer-events: none;
}
.pub-acttip.on { display: block; }
.pub-acttip-title {
	display: block;
	margin: 0 0 4px;
	padding-bottom: 3px;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 14px;
	border-bottom: 1px solid rgba(134, 122, 106, .35);
}
.pub-acttip-row { display: block; }
/* the legend bar in front of each row: the colour of that series' line in the graph */
.pub-acttip-key {
	display: inline-block;
	width: 12px;
	height: 3px;
	margin-right: 7px;
	vertical-align: middle;
	border-radius: 2px;
}
.pub-acttip-key.p { background: #6b5b45; opacity: .75; }
.pub-acttip-key.a { background: #d98d12; opacity: .9; }
.pub-acttip-up { color: #1e6b1e; font-weight: 600; }
.pub-acttip-down { color: #8b0000; font-weight: 600; }
.pub-acttip-same { color: var(--pub-ink-faint); }

/* the random scene with the form on top of it */
.pub-stage {
	position: relative;
	width: 100%;
	max-width: 750px;
	margin: 0 auto;
	padding: 28px 16px 20px;
}
.pub-stage::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--pub-scene);
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
	pointer-events: none;
	z-index: 0;
}
.pub-stage > * { position: relative; z-index: 1; }
@media (min-width: 600px) {
	.pub-stage {
		min-height: 550px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 40px 16px;
	}
}
/* on a phone the scene is a soft wash behind the card, not a picture to read */
@media (max-width: 599px) {
	.pub-stage::before { opacity: .75; }
}

.pub-login { max-width: 360px; }
.pub-login .pub-btn { flex: 0 0 auto; }

.pub-demo {
	width: max-content;
	max-width: 100%;
	margin: 12px auto 0;
	padding: 3px 14px;
	font-size: 12px;
	text-align: center;
	background: #fbda55;
	border: 1px solid #fff;
	border-radius: 999px;
}
.pub-demo b { margin-right: 8px; }

.pub-tip { margin: 12px 0 0; font-size: 13px; color: var(--pub-ink-soft); text-align: center; }

/* ------------------------------------------------------------------ below the fold sections */

.pub-section {
	width: 100%;
	max-width: 980px;
	margin: 0 auto;
	padding: 26px 16px 6px;
	text-align: center;
}
.pub-section-title {
	margin: 0 0 14px;
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 20px;
	color: var(--pub-ink);
}
.pub-section-note {
	margin: 14px auto 0;
	max-width: 520px;
	font-size: 13px;
	color: var(--pub-ink-soft);
}

/* the showcase row: one line, scrolls sideways on a phone */
.pub-shelf {
	display: flex;
	gap: 14px;
	justify-content: safe center;
	overflow-x: auto;
	padding: 8px 2px 10px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.pub-shelf-item {
	flex: 0 0 auto;
	width: 104px;
	padding: 0;
	font: inherit;
	color: inherit;
	text-align: center;
	background: none;
	border: 0;
	cursor: pointer;
	scroll-snap-align: start;
}
.pub-shelf-item img {
	display: block;
	width: 104px;
	height: 104px;
	object-fit: contain;
	transition: transform .18s ease;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
}
.pub-shelf-item:hover img,
.pub-shelf-item:focus-visible img { transform: translateY(-3px) scale(1.04); }
.pub-shelf-item:focus-visible { outline: 2px solid var(--pub-gold-edge); outline-offset: 2px; border-radius: 4px; }
.pub-shelf-name {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.25;
	color: var(--pub-ink);
}
.pub-shelf-age {
	display: block;
	margin-top: 1px;
	font-size: 11px;
	color: var(--pub-ink-faint);
}
@media (min-width: 600px) {
	.pub-shelf { gap: 12px; }
	.pub-shelf-item, .pub-shelf-item img { width: 120px; }
	.pub-shelf-item img { height: 120px; }
}

/* the latest updates list: "<b>7h ago :</b> headline", one per line. The column is centred on the
   page, at most twice as wide as the login card (.pub-login, 360px), and its lines read left aligned. */
.pub-updates-list {
	max-width: 720px;
	margin: 0 auto;
	text-align: left;
	padding: 0;
	list-style: none;
	font-size: 14px;
}
.pub-updates-list li { margin: 0 0 6px; }
.pub-updates-list b { font-weight: 600; color: var(--pub-ink-soft); white-space: nowrap; }
.pub-updates-list a.pub-update-text { color: var(--pub-ink); }
.pub-updates-list a.pub-update-text:hover { color: var(--pub-link); }

/* room at the end of the login page */
body.pub-loginpage { padding-bottom: 100px; }

/* ------------------------------------------------------------------ the dossier dialog */

.pub-dialog {
	width: calc(100% - 24px);
	max-width: 760px;
	max-height: calc(100% - 24px);
	padding: 0;
	overflow: hidden;
	color: var(--pub-ink);
	background: var(--pub-paper-solid);
	border: 1px solid var(--pub-line);
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.pub-dialog::backdrop { background: rgba(10, 6, 2, .6); backdrop-filter: blur(2px); }
.pub-dialog-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 36px;
	height: 36px;
	font-size: 24px;
	line-height: 1;
	color: var(--pub-ink-soft);
	background: none;
	border: 0;
	cursor: pointer;
	z-index: 2;
}
.pub-dialog-close:hover { color: var(--pub-ink); }
.pub-dialog-body { padding: 16px; max-height: calc(100vh - 26px); max-height: calc(100dvh - 26px); overflow-y: auto; }
.pub-dialog-loading { padding: 40px; text-align: center; color: var(--pub-ink-soft); }

.pubpet { display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.pubpet-big {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	width: 100%;
	max-width: 330px;
	margin: 0 auto;
	background: #efe6cd;
	border: 1px solid #ddd0ab;
	border-radius: 6px;
	overflow: hidden;
}
.pubpet-big img { max-width: 97%; max-height: 97%; }
.pubpet-film { display: flex; gap: 4px; justify-content: safe center; overflow-x: auto; padding: 6px 0 0; }
.pubpet-film button {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	padding: 0;
	background: #efe6cd;
	border: 1px solid #c9b57e;
	border-radius: 5px;
	cursor: pointer;
}
.pubpet-film button.now { border: 2px solid #8a6d2f; }
.pubpet-film img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pubpet-info { min-width: 0; }
.pubpet-name { margin: 0 34px 2px 0; font-family: 'Monotype Corsiva', Georgia, serif; font-size: 26px; color: #463320; }
.pubpet-note { color: #7a6a4d; font-size: 13px; margin: 0 0 6px; }
.pubpet-line { font-size: 13px; color: #5a4a2d; margin: 2px 0; }
.pubpet-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 6px 0; }
.pubpet-bar b { width: 78px; font-size: 12px; font-weight: 600; }
.pubpet-outer { width: 140px; height: 10px; background: #ddd0ab; border-radius: 5px; overflow: hidden; }
.pubpet-inner { display: block; height: 100%; background: #8a9a5b; }
.pubpet-bar .pubpet-note { margin: 0; font-size: 12px; flex-basis: 100%; }
.pubpet-swatch { width: 16px; height: 16px; border: 1px solid #463320; border-radius: 4px; }
@media (min-width: 700px) {
	.pubpet { flex-direction: row; align-items: flex-start; }
	.pubpet-media { flex: 0 0 330px; width: 330px; }
	.pubpet-info { flex: 1 1 auto; padding-right: 4px; }
	.pub-dialog-body { padding: 20px; }
}

/* ================================================================== REGISTRATION */

.pub-head {
	height: 10px;
	background: linear-gradient(to bottom, #0e0000, #3a2210);
}

.pub-reg {
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 24px 16px 8px;
}
.pub-reg-title { font-size: 26px; margin-bottom: 6px; }
.pub-reg-lead { margin: 0 0 18px; font-style: italic; color: var(--pub-ink-soft); }
@media (min-width: 600px) {
	.pub-reg { padding-top: 40px; }
	.pub-reg-title { font-size: 34px; }
}

.pub-step {
	display: flex;
	flex-direction: column;
	gap: 18px;
	align-items: center;
}
.pub-step-art { text-align: center; }
.pub-step-art img {
	display: block;
	width: 220px;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	mix-blend-mode: multiply;
}
.pub-step-art .pub-links { margin-top: 10px; }
.pub-step .pub-card { max-width: 440px; }
/* on a phone the form comes first and the drawing follows it, smaller */
@media (max-width: 819px) {
	.pub-step .pub-card { order: 1; }
	.pub-step .pub-step-art { order: 2; }
	.pub-step-art img { width: 160px; }
}
@media (min-width: 820px) {
	.pub-step { flex-direction: row; align-items: center; justify-content: center; gap: 36px; }
	.pub-step-art { flex: 0 0 380px; }
	.pub-step-art img { width: 380px; }
	.pub-step .pub-card { flex: 1 1 auto; }
}

.pub-progress {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 0 0 12px;
}
.pub-progress span {
	width: 28px;
	height: 4px;
	border-radius: 2px;
	background: rgba(134, 122, 106, .35);
}
.pub-progress span.on { background: var(--pub-gold-edge); }

.pub-fineprint { font-size: 12px; color: var(--pub-ink-soft); margin: 0 0 12px; }

.pub-rating { margin: 26px auto 0; max-width: 680px; }

/* a ?pag= content page (terms, privacy, partners...) inside the same shell */
.pub-content {
	max-width: 900px;
	margin: 0 auto;
	overflow-x: auto;
}
.pub-content img { max-width: 100%; height: auto; }
.pub-content table { max-width: 100%; }
