/* Spisáreň - the look of the original 2017 design (Bootstrap 3), without any library. */

:root {
	--primary: #337ab7;
	--success: #5cb85c;
	--info: #45abcd;
	--stamp: #7b2d8b;
	--text: #333;
	--muted: #777;
	--border: #ddd;
	--input-border: #ccc;
	--soft-bg: #f5f5f5;
	--radius: 4px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;
	color-scheme: light;
}

/* Base */

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

/* Titles, nicks and pieces are typed by people, sometimes as one long word
   without spaces. It may break anywhere, or it would stretch its column (on
   phones the whole page) sideways. */
body {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	margin: 0;
	font: 14px/1.42857 var(--font);
	color: var(--text);
	background: #fff;
	overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
	font-weight: 500;
	line-height: 1.1;
}

p {
	margin: 0 0 10px;
}

a {
	color: var(--primary);
	text-decoration: none;

	&:hover {
		color: #23527c;
		text-decoration: underline;
	}
}

img {
	vertical-align: middle;
}

button,
input,
select,
textarea {
	font: inherit;
}

/* Also hides the SVG icon sprite, which the browser's own [hidden] rule does not cover. */
[hidden] {
	display: none !important;
}

:focus-visible {
	outline: 2px solid rgb(51 122 183 / .6);
	outline-offset: 2px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.icon {
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Layout */

.container {
	width: 100%;
	max-width: 1170px;
	margin-inline: auto;
	padding-inline: 15px;
}

.page-header {
	margin: 40px 0 20px;
	padding-bottom: 9px;
	border-bottom: 1px solid #eee;

	h1 {
		margin: 0 0 10px;
		font-size: 36px;
	}
}

.logo {
	display: inline-block;

	&:hover {
		text-decoration: none;
	}

	kbd {
		display: inline-flex;
		align-items: center;
		gap: .35em;
		padding: 2px 6px;
		font: 32px/1.1 var(--mono);
		color: #fff;
		background: #333;
		border-radius: 3px;
		box-shadow: inset 0 -1px 0 rgb(0 0 0 / .25);
		transition: background-color .15s;
	}

	&:hover kbd {
		background: #1a1a1a;
	}

	.icon {
		width: .85em;
		height: .85em;
		stroke-width: 2;
	}
}

.dashboard {
	display: grid;
	gap: 0 30px;
	align-items: start;
}

/* On wide screens the sidebar goes left; on phones the story comes first. */
@media (min-width: 992px) {
	.dashboard {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);

		> .sidebar {
			grid-area: 1 / 1;
		}

		> .story {
			grid-area: 1 / 2;
		}
	}
}

/* Panels */

.panel {
	margin-bottom: 20px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: 0 1px 1px rgb(0 0 0 / .05);
}

.panel-heading {
	margin: 0;
	padding: 10px 15px;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	background: var(--soft-bg);
	border-bottom: 1px solid var(--border);
	border-radius: 3px 3px 0 0;
}

.panel-body {
	padding: 15px;
}

.panel-footer {
	padding: 10px 15px;
	background: var(--soft-bg);
	border-top: 1px solid var(--border);
	border-radius: 0 0 3px 3px;
}

.panel-primary {
	border-color: var(--primary);

	> .panel-heading {
		color: #fff;
		background: var(--primary);
		border-color: var(--primary);
	}
}

/* Buttons */

.btn {
	display: inline-block;
	padding: 9px 15px;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	color: var(--text);
	background: #fff;
	border: 1px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	user-select: none;
	transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;

	&:hover {
		text-decoration: none;
	}

	&:active:not(:disabled) {
		box-shadow: inset 0 3px 5px rgb(0 0 0 / .125);
	}

	/* Inactive has to look inactive: faded, no hover, a "no" cursor. */
	&:disabled {
		cursor: not-allowed;
		opacity: .5;
		box-shadow: none;
	}
}

.btn-default {
	color: var(--text);
	background: #fff;
	border-color: #ccc;

	&:hover:not(:disabled),
	details[open] > & {
		color: var(--text);
		background: #e6e6e6;
		border-color: #adadad;
	}
}

.btn-primary {
	color: #fff;
	background: var(--primary);
	border-color: #2e6da4;

	&:hover:not(:disabled) {
		color: #fff;
		background: #286090;
		border-color: #204d74;
	}
}

.btn-success {
	color: #fff;
	background: var(--success);
	border-color: #4cae4c;

	&:hover:not(:disabled) {
		color: #fff;
		background: #449d44;
		border-color: #398439;
	}
}

.btn-warning {
	color: #fff;
	background: #f0ad4e;
	border-color: #eea236;

	&:hover:not(:disabled) {
		color: #fff;
		background: #ec971f;
		border-color: #d58512;
	}
}

.btn-lg {
	padding: 11px 18px;
	font-size: 18px;
	line-height: 1.33333;
	border-radius: 6px;
}

.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
	line-height: 1.5;
	border-radius: var(--radius);
}

/* Loading: a spinner in front of the label until the next page or an error. */
.btn.is-loading {
	cursor: progress;

	&::before {
		content: "";
		display: inline-block;
		width: .95em;
		height: .95em;
		margin-right: .5em;
		vertical-align: -.15em;
		border: 2px solid currentColor;
		border-right-color: transparent;
		border-radius: 50%;
		animation: spin .65s linear infinite;
	}

	&:disabled {
		opacity: .8;
	}
}

@keyframes spin {
	to {
		rotate: 360deg;
	}
}

/* A form is on its way: the rest of the page rests until the next one arrives. */
.is-submitting {
	cursor: progress;

	.btn:not(.is-loading),
	.btn-icon,
	.suggestion,
	.close {
		opacity: .5;
		pointer-events: none;
	}

	.is-loading {
		pointer-events: none;
	}
}

.btn-block {
	display: block;
	width: 100%;
}

.btn-group {
	display: inline-flex;

	> .btn {
		position: relative;

		&:hover,
		&:focus-visible {
			z-index: 1;
		}
	}

	> .btn + .btn {
		margin-left: -1px;
	}

	> .btn:not(:first-child) {
		border-top-left-radius: 0;
		border-bottom-left-radius: 0;
	}

	> .btn:not(:last-child) {
		border-top-right-radius: 0;
		border-bottom-right-radius: 0;
	}
}

.close {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 18px;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: .7;
	transition: opacity .15s, background-color .15s;

	&:hover {
		opacity: 1;
		background: rgb(0 0 0 / .07);
	}
}

/* Badges, labels, lists */

.badge {
	display: inline-block;
	min-width: 10px;
	padding: 3px 7px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: middle;
	background: var(--muted);
	border-radius: 10px;
}

.label {
	padding: .2em .6em .3em;
	font-size: 75%;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: .25em;
}

.label-primary {
	background: var(--primary);
}

.label-success {
	background: var(--success);
}

.list-group-item {
	display: block;
	padding: 10px 15px;
	margin-bottom: -1px;
	color: #555;
	background: #fff;
	border: 1px solid var(--border);
	transition: background-color .15s;

	&:first-child {
		border-top-left-radius: var(--radius);
		border-top-right-radius: var(--radius);
	}

	&:last-child {
		margin-bottom: 0;
		border-bottom-left-radius: var(--radius);
		border-bottom-right-radius: var(--radius);
	}

	&:hover {
		color: #555;
		text-decoration: none;
		background: var(--soft-bg);
	}

	&[aria-current] {
		background: var(--soft-bg);
		box-shadow: inset 3px 0 0 var(--primary);
	}
}

.stories .btn-block {
	margin-bottom: 15px;
}

/* Notices */

.notice {
	position: relative;
	padding: 15px;
	margin-bottom: 10px;
	background: var(--soft-bg);
	border-left: 6px solid #7f7f84;
	border-radius: 0 0 3px 3px;
	box-shadow: 0 4px 8px rgb(0 0 0 / .16);

	&[data-dismissible] {
		padding-right: 50px;
	}

	.close {
		position: absolute;
		top: 50%;
		right: 14px;
		translate: 0 -50%;
	}
}

.notice-info {
	border-left-color: var(--info);

	> strong {
		color: var(--info);
	}
}

/* Story */

.story-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	font-size: 18px;

	h2 {
		margin: 0;
		font-size: inherit;
		font-weight: inherit;
		line-height: 1.42857;
	}

	.badge {
		color: var(--primary);
		background: #fff;
		white-space: normal;
	}
}

.turn-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 0 40px;
	font-size: 18px;
	color: #fff;
	background: var(--success) linear-gradient(45deg, rgb(255 255 255 / .15) 25%, transparent 25% 50%, rgb(255 255 255 / .15) 50% 75%, transparent 75%) 0 0 / 40px 40px;
	box-shadow: inset 0 -1px 0 rgb(0 0 0 / .15);
	animation: stripes 2s linear infinite;

	/* The whole bar leads down to the box for the piece. */
	> a {
		display: flex;
		flex: 1;
		align-self: stretch;
		align-items: center;
		justify-content: center;
		gap: 6px;
		color: inherit;

		&:hover {
			color: inherit;
		}

		.icon {
			width: .8em;
			height: .8em;
		}
	}

	.close {
		position: absolute;
		top: 50%;
		right: 4px;
		translate: 0 -50%;

		&:hover {
			background: rgb(255 255 255 / .2);
		}
	}
}

@keyframes stripes {
	from {
		background-position: 40px 0;
	}

	to {
		background-position: 0 0;
	}
}

.story-timeline {
	max-height: 480px;
	overflow-y: auto;
	scrollbar-width: thin;

	> :last-child {
		margin-bottom: 0;
	}
}

/* Phones: the timeline takes under half of the screen, so the box for the piece
   under it shows up on the first screen too. */
@media (max-width: 991px) {
	.story-timeline {
		max-height: max(200px, 40dvh);
	}
}

.story-part {
	position: relative; /* keeps .sr-only text inside the scrolling timeline */
	padding: 19px;
	margin-bottom: 20px;
	background: var(--soft-bg);
	border: 1px solid #e3e3e3;
	border-radius: var(--radius);
	box-shadow: inset 0 1px 1px rgb(0 0 0 / .05);
	text-wrap: pretty;

	&.is-hidden {
		color: transparent;
		text-shadow: 0 0 15px rgb(0 0 0 / .5);
		cursor: default;
		user-select: none;
	}
}

.story-form {
	> label:not(.check) {
		display: inline-block;
		margin-bottom: 5px;
		font-weight: 700;
	}

	textarea {
		min-height: calc(5lh + 20px);
		max-height: 60vh;
		margin-bottom: 10px;
		field-sizing: content;
	}

	/* How much of the piece is used up; the box takes no more than the limit. */
	.char-count {
		margin: -6px 0 10px;
		font-family: var(--mono);
		font-size: 12px;
		color: var(--muted);
		text-align: right;

		&.is-full {
			color: #c77c11;
		}
	}

	/* The final piece closes the story, so it wears the stamp colour. */
	.final-piece {
		margin-bottom: 15px;

		&:has(:checked) {
			background: #f8f1fa;
			border-color: #cfa8d8;
		}

		input:hover:not(:disabled),
		input:checked {
			border-color: var(--stamp);
		}

		input:checked {
			background-color: var(--stamp);
		}
	}
}

.story-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* Passing the piece on is the main button. With the final piece ticked it closes
   the story instead, says so and wears the stamp colour. */
.piece-actions .btn-publish {
	margin-left: auto;
}

.story-form .when-final {
	display: none;
}

.story-form:has(.final-piece :checked) {
	.when-pass {
		display: none;
	}

	.when-final {
		display: inline;
	}

	.btn-publish {
		background: var(--stamp);
		border-color: #6a2678;

		&:hover:not(:disabled) {
			background: #63246f;
			border-color: #4f1d59;
		}
	}
}

/* Phones: the main button goes on top across the whole width, the others share a row under it. */
@media (max-width: 479px) {
	.piece-actions {
		> .btn {
			flex: 1;
		}

		.btn-publish {
			order: -1;
			flex-basis: 100%;
			margin-left: 0;
			padding: 11px 18px;
			font-size: 18px;
		}
	}
}

/* Why the button below waits, or what to do meanwhile. */
.story-hint {
	margin: 0 0 12px;
	color: #555;

	&.is-blocking {
		padding: 9px 12px;
		color: #8a6d3b;
		background: #fcf8e3;
		border: 1px solid #faebcc;
		border-radius: var(--radius);
	}
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Forms */

/* 16px text also keeps phones from zooming in on every field. */
.form-control {
	display: block;
	width: 100%;
	padding: 9px 12px;
	font-size: 16px;
	line-height: 1.375;
	color: #444;
	background: #fff;
	border: 1px solid var(--input-border);
	border-radius: var(--radius);
	box-shadow: inset 0 1px 1px rgb(0 0 0 / .075);
	transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out, background-color .15s;

	&:focus {
		border-color: #66afe9;
		outline: 0;
		box-shadow: inset 0 1px 1px rgb(0 0 0 / .075), 0 0 8px rgb(102 175 233 / .6);
	}

	&::placeholder {
		color: #999;
	}

	&:disabled {
		color: #888;
		background: #f4f4f4;
		box-shadow: none;
		cursor: not-allowed;
	}
}

textarea.form-control {
	resize: vertical;
}

select.form-control {
	appearance: none;
	padding-right: 38px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") no-repeat right 13px center / 14px;
	cursor: pointer;
}

/* Checkbox: a rounded box that fills with the primary colour and a tick. */
input[type="checkbox"] {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 0 0;
	border: 2px solid #b9c3cd;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s, background-size .15s ease-out, border-color .15s;

	&:hover:not(:disabled) {
		border-color: var(--primary);
	}

	&:checked {
		background-color: var(--primary);
		background-size: 16px 16px;
		border-color: var(--primary);
	}

	&:disabled {
		background-color: #eee;
		border-color: #d6d6d6;
		cursor: not-allowed;
	}

	&:checked:disabled {
		background-color: #a9c0d6;
		border-color: #a9c0d6;
	}
}

/* Inputs and a button glued into one block (profile forms). Hidden labels and
   fields stay out of the way: no gaps between the inputs, rounded top on the first one. */
.form-stack {
	max-width: 330px;
	margin: 0 auto;

	> :not(.sr-only) {
		position: relative;
		border-radius: 0;
	}

	> * + * {
		margin-top: -1px;
	}

	> :nth-child(1 of :not([type="hidden"], .sr-only)) {
		border-top-left-radius: var(--radius);
		border-top-right-radius: var(--radius);
	}

	> :last-child {
		border-bottom-left-radius: var(--radius);
		border-bottom-right-radius: var(--radius);
	}

	> :focus {
		z-index: 1;
	}

	> .form-control {
		padding: 11px 12px;
	}
}

/* Profile: photo and a stack of buttons that open drawers */

.profile {
	> * + * {
		margin-top: -1px;
	}

	> details > summary,
	> .btn {
		display: block;
		width: 100%;
		border-radius: 0;
	}

	> :last-child {
		border-bottom-left-radius: var(--radius);
		border-bottom-right-radius: var(--radius);
	}
}

.profile-photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--border);
	border-bottom: 0;
	border-radius: var(--radius) var(--radius) 0 0;
}

summary {
	list-style: none;

	&::-webkit-details-marker {
		display: none;
	}
}

/* A drawer button carries a chevron that turns when the drawer opens. */
summary.btn {
	position: relative;
	padding-inline: 36px;

	&::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 16px;
		width: 8px;
		height: 8px;
		border: solid currentColor;
		border-width: 0 2px 2px 0;
		opacity: .55;
		rotate: 45deg;
		translate: 0 -70%;
		transition: rotate .2s, translate .2s;
	}

	details[open] > &::after {
		rotate: 225deg;
		translate: 0 -25%;
	}
}

.drawer {
	padding: 15px;
	border-inline: 1px solid var(--input-border);
}

@media (prefers-reduced-motion: no-preference) {
	@supports (interpolate-size: allow-keywords) {
		.profile details {
			interpolate-size: allow-keywords;

			&::details-content {
				height: 0;
				overflow: clip;
				transition: height .25s ease, content-visibility .25s allow-discrete;
			}

			&[open]::details-content {
				height: auto;
			}
		}
	}
}

.upload {
	> label:first-child {
		display: block;
		margin-bottom: 5px;
	}
}

.upload-row {
	display: flex;
	align-items: center;
	gap: 8px;

	input {
		flex: 1;
		min-width: 0;
		font-size: 13px;

		&::file-selector-button {
			margin-right: 8px;
			padding: 7px 12px;
			font: inherit;
			color: var(--text);
			background: #fff;
			border: 1px solid var(--input-border);
			border-radius: 3px;
			cursor: pointer;
			transition: background-color .15s, border-color .15s;
		}

		&::file-selector-button:hover {
			background: #e6e6e6;
			border-color: #adadad;
		}
	}
}

.upload-hint {
	margin: 20px 0 10px;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.1;
}

.drop-zone {
	display: grid;
	place-items: center;
	height: 200px;
	padding: 10px;
	color: #ccc;
	text-align: center;
	border: 2px dashed currentColor;
	cursor: pointer;
	transition: color .15s;

	&:hover {
		color: #999;
	}

	&.is-over {
		color: #222;
	}
}

/* Touch screens have nothing to drag around, the file button is enough there. */
@media (hover: none) {
	.upload-hint,
	.drop-zone {
		display: none;
	}
}

/* Dialog (notepad) */

.modal {
	width: min(600px, 100% - 20px);
	max-width: none;
	max-height: calc(100% - 20px);
	margin: 10px auto;
	padding: 0;
	color: inherit;
	border: 1px solid rgb(0 0 0 / .2);
	border-radius: 6px;
	box-shadow: 0 5px 15px rgb(0 0 0 / .5);

	&::backdrop {
		background: rgb(0 0 0 / .5);
	}

	.close {
		font-size: 20px;
		color: #000;
		opacity: .35;

		&:hover {
			opacity: .7;
		}
	}
}

@media (min-width: 768px) {
	.modal {
		max-height: calc(100% - 60px);
		margin-top: 30px;
	}
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 15px;
	border-bottom: 1px solid #e5e5e5;
}

.modal-title {
	margin: 0;
	font-size: 18px;
	line-height: 1.42857;
}

.modal-body {
	padding: 15px;
}

.modal-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 5px;
	padding: 15px;
	border-top: 1px solid #e5e5e5;
}

/* Author bubble created by app.js */

.tooltip {
	position: fixed;
	z-index: 10;
	width: 200px;
	padding: 6px 8px;
	font-size: 12px;
	line-height: 1.4;
	color: #fff;
	text-align: center;
	background: #000;
	border-radius: var(--radius);
	opacity: .9;
	pointer-events: none;
	transition: opacity .15s;

	@starting-style {
		opacity: 0;
	}

	img {
		display: block;
		width: 100%;
		aspect-ratio: 3 / 2;
		object-fit: cover;
		margin: 5px 0;
		padding: 4px;
		background: #fff;
		border-radius: var(--radius);
	}

	&::after {
		content: "";
		position: absolute;
		border: 5px solid transparent;
	}

	&[data-placement="left"]::after {
		top: 50%;
		left: 100%;
		margin-top: -5px;
		border-left-color: #000;
	}

	&[data-placement="top"]::after {
		top: 100%;
		left: 50%;
		margin-left: -5px;
		border-top-color: #000;
	}
}

/* Footer */

.site-footer {
	margin-top: auto;
	background: #edeff1;
	border-top: 1px solid var(--border);
}

.footer-bottom {
	padding: 15px 0;
	background: #e3e3e3;
	border-top: 1px solid #ccc;

	.container {
		display: flex;
		justify-content: space-between;
		gap: 15px;
	}
}

/* 404 */

.not-found {
	padding: 40px 15px;
	text-align: center;

	h2 {
		margin: 0 0 10px;
		font-size: 24px;
	}
}

/* Live redraw: what just arrived in the story fades in. */
.is-new {
	animation: appear .6s ease-out;
}

@keyframes appear {
	from {
		opacity: 0;
		translate: 0 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.turn-bar,
	.is-new,
	.landing-sample-pen::after {
		animation: none;
	}
}

/* Hlavička s navigáciou */

.page-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 20px;
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;

	a:not(.btn) {
		color: var(--text);

		&:hover {
			color: var(--primary);
			text-decoration: none;
		}
	}
}

.site-nav-me {
	font-family: var(--mono);
	color: var(--muted);
}

/* Phones: a smaller logo and the menu on a single line under it. The nick and
   the registration button make room (the profile panel, the landing page and
   the login page have their own). */
@media (max-width: 479px) {
	.page-header {
		margin-top: 20px;
	}

	.logo kbd {
		font-size: 26px;
	}

	.site-nav-me,
	.site-nav-wide {
		display: none;
	}
}

/* How many stories are waiting for your piece, kept fresh by app.js. */
.badge-turn {
	margin-left: 5px;
	vertical-align: 1px;
	background: var(--stamp);
}

/* Pomocníci */

.muted {
	color: var(--muted);
}

.small {
	font-size: 12px;
}

.page-panel {
	max-width: 760px;
	margin-inline: auto;
}

.empty-state {
	padding: 40px 15px;
	text-align: center;

	> p {
		font-size: 16px;
	}

	.btn {
		margin: 4px;
	}

	/* A newcomer's empty desk explains the game. */
	.landing-steps {
		margin: 30px 0 0;
	}
}

/* Oznamy */

.notice-success {
	border-left-color: var(--success);

	> strong {
		color: var(--success);
	}
}

.notice-warning {
	border-left-color: #f0ad4e;

	> strong {
		color: #c77c11;
	}
}

.label-default {
	background: var(--muted);
}

.label-turn {
	background: var(--stamp);
}

.label-open {
	background: #8a6d3b;
}

/* Zápisnica: úradný záznam strojopisom */

.zapis {
	margin: 0 0 10px;
	padding: 8px 12px;
	font-family: var(--mono);
	font-size: 12px;
	color: #444;
	background: #fcfcf7;
	border: 1px dashed #c9c4ae;
	border-radius: var(--radius);

	> strong {
		color: #8a6d3b;
		letter-spacing: 1px;
		text-transform: uppercase;
		margin-right: 6px;
	}
}

/* Kúsky: príbeh v pätkovom písme */

.story-part {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 15px;
	line-height: 1.55;
}

.waiting-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 0 15px;
	font-size: 16px;
	color: #fff;
	background: var(--muted);
	box-shadow: inset 0 -1px 0 rgb(0 0 0 / .15);
}

.piece-header {
	margin: -8px 0 8px;
	font-family: var(--mono);
	font-size: 11px;
	color: #666;
	letter-spacing: .5px;
}

/* Who wrote a hidden part is no secret, only what. */
.story-part.is-hidden .piece-header {
	color: #888;
	text-shadow: none;
}

/* Uzavretý spis: pečiatka a odhalenie */

.stamp {
	margin-left: auto;
	padding: 3px 10px;
	font-family: var(--mono);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 3px;
	color: #fff;
	border: 3px double #fff;
	rotate: -6deg;
	opacity: .95;
}

.story-closed.panel-primary {
	border-color: var(--stamp);
}

.story-closed > .panel-heading {
	background: var(--stamp);
	border-color: var(--stamp);
}

.reveal-header {
	padding: 12px 15px 2px;
	border-bottom: 1px solid var(--border);

	h3 {
		margin: 0 0 4px;
		font-family: var(--mono);
		font-size: 16px;
	}

	p {
		color: var(--muted);
		font-size: 13px;
	}
}

.story-revealed {
	max-height: none;
}

.story-revealed .story-part {
	border-left-width: 5px;
	border-left-style: solid;
}

/* Bočný panel spisu */

.meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 12px;
	margin: 0 0 15px;

	dt {
		font-family: var(--mono);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: .5px;
		color: var(--muted);
		padding-top: 2px;
	}

	dd {
		margin: 0;
	}
}

.sidebar-subhead {
	margin: 18px 0 8px;
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--muted);
}

.member-list {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
}

.member {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	padding: 6px 8px;
	border: 1px solid var(--border);
	margin-bottom: -1px;

	&:first-child {
		border-radius: var(--radius) var(--radius) 0 0;
	}

	&:last-child {
		border-radius: 0 0 var(--radius) var(--radius);
	}

	&.has-turn {
		background: #f3fbf3;
		box-shadow: inset 3px 0 0 var(--success);
	}

	&.is-left {
		color: var(--muted);

		.member-nick {
			text-decoration: line-through;
		}
	}
}

.member-order {
	font-family: var(--mono);
	font-size: 12px;
	min-width: 18px;
	color: var(--muted);
	text-align: right;
}

.member-photo {
	width: 30px;
	height: 20px;
	object-fit: cover;
	border: 1px solid var(--border);
	border-radius: 2px;
	background: #fff;
}

.member-nick {
	flex: 1;
	min-width: 0;

	a {
		color: inherit;
	}
}

.member-founder .icon {
	width: 12px;
	height: 12px;
	color: #c9a227;
	fill: currentColor;
	stroke: none;
}

.member-note {
	font-size: 11px;
	font-family: var(--mono);
	color: var(--muted);
}

.member-tools {
	display: inline-flex;
	gap: 4px;

	form {
		display: inline-flex;
		gap: 4px;
	}
}

/* Small square tool buttons, big enough for a finger and visible without hover. */
.btn-icon {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 15px;
	color: #666;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	transition: color .15s, background-color .15s, border-color .15s;

	&:hover {
		color: var(--text);
		background: #f0f0f0;
		border-color: #bbb;
	}

	/* First up, last down: nowhere to go, the button only keeps its place. */
	&:disabled {
		opacity: .35;
		pointer-events: none;
	}
}

.btn-icon-warning:hover {
	color: #fff;
	background: #f0ad4e;
	border-color: #eea236;
}

.invite-form .form-control {
	margin-bottom: 6px;
}

.invite-form .small {
	margin-top: 6px;
}

.story-settings {
	margin-top: 15px;

	> summary {
		display: block;
		width: 100%;
	}

	.drawer {
		border: 1px solid var(--input-border);
		border-top: 0;
		border-radius: 0 0 var(--radius) var(--radius);
	}
}

.leave-form {
	margin-top: 15px;
}

/* Formuláre so štítkami a prepínačmi */

.form-plain {
	label:not(.check) {
		display: block;
		margin: 10px 0 5px;
		font-weight: 700;
	}

	> .btn {
		margin-top: 12px;
	}

	select.form-control {
		height: auto;
	}

	.form-control + .check {
		margin-top: 12px;
	}
}

/* A checkbox with its label is a whole clickable card that lights up when ticked. */
.check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 8px;
	padding: 11px 12px;
	font-size: 15px;
	font-weight: 400;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s, border-color .15s;

	&:hover {
		background: #f8fbfd;
		border-color: #b9cde0;
	}

	&:has(:checked) {
		background: #f1f7fc;
		border-color: #9fc0de;
	}

	&:has(:disabled) {
		color: var(--muted);
		background: #fafafa;
		border-color: var(--border);
		cursor: not-allowed;
	}
}

.check-text {
	display: grid;
	gap: 1px;
	min-width: 0;
	padding-top: 1px;
	line-height: 1.35;

	strong {
		font-weight: 600;
	}

	small {
		font-size: 13px;
		color: var(--muted);
	}
}

.check-indent {
	margin-left: 34px;
}

.form-stack-check {
	margin: -1px 0 0;
	padding: 12px;
	border-color: var(--input-border);
	border-radius: 0;
}

/* Who goes along into a new story with the same party. */
.party-pick {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px;
	margin-bottom: 10px;

	.check {
		align-items: center;
		gap: 10px;
		margin: 0;
	}

	.member-photo {
		width: 42px;
		height: 28px;
	}

	.check-text {
		padding: 0;
	}
}

/* Prihlasovacie stránky */

.auth-page {
	max-width: 360px;
	margin: 20px auto 40px;
	text-align: center;

	h2 {
		margin: 0 0 15px;
		font-size: 28px;
	}

	.form-stack {
		text-align: left;
	}

	.notice {
		text-align: left;
	}
}

.auth-intro {
	color: var(--muted);
	margin-bottom: 15px;
}

.auth-links {
	margin-top: 15px;
	color: var(--muted);
}

/* Úradná tabuľa a spisári */

.board-item {
	display: block;
}

.board-title {
	display: block;
	font-size: 15px;
}

.board-meta {
	display: block;
	margin-top: 2px;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
}

.writer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.writer-card {
	display: block;
	padding: 8px;
	color: inherit;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: box-shadow .15s;

	&:hover {
		color: inherit;
		text-decoration: none;
		box-shadow: 0 2px 6px rgb(0 0 0 / .12);
	}

	img {
		width: 100%;
		aspect-ratio: 3 / 2;
		object-fit: cover;
		border-radius: 2px;
		background: var(--soft-bg);
	}
}

.writer-nick {
	display: block;
	margin-top: 6px;
	font-weight: 700;
}

.writer-meta {
	display: block;
	font-family: var(--mono);
	font-size: 11px;
	color: var(--muted);
}

.writer-head {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: flex-start;

	.writer-photo {
		width: 180px;
		max-width: 100%;
		aspect-ratio: 3 / 2;
		object-fit: cover;
		padding: 4px;
		background: #fff;
		border: 1px solid var(--border);
		border-radius: var(--radius);
	}
}

/* Návrhy názvov z generátora */

.suggestions {
	margin-top: 8px;
	color: var(--muted);
}

.suggestion {
	display: inline-block;
	margin: 3px 3px 3px 0;
	padding: 6px 13px;
	font: inherit;
	font-size: 14px;
	color: var(--text);
	background: var(--soft-bg);
	border: 1px solid var(--border);
	border-radius: 999px;
	cursor: pointer;
	transition: color .15s, background-color .15s, border-color .15s;

	&:hover {
		background: #e9f2fa;
		border-color: var(--primary);
		color: var(--primary);
	}

	/* The one now in the title field. */
	&[aria-pressed="true"] {
		color: #fff;
		background: var(--primary);
		border-color: var(--primary);
	}
}

[data-more-suggestions] {
	margin-left: 4px;
}

.suggestions-error {
	margin-left: 6px;
	font-size: 13px;
	color: #c77c11;
}

/* Profil: tlačidlo odhlásenia je vo formulári */

.profile > form > .btn {
	border-radius: 0 0 var(--radius) var(--radius);
}

/* Úvod pre neprihlásených */

.landing {
	max-width: 720px;
	margin: 30px auto 50px;
	text-align: center;
}

.landing-slogan {
	margin: 0 0 20px;
	font-family: var(--mono);
	font-size: clamp(22px, 5vw, 34px);
	font-weight: 700;
	line-height: 1.3;
	text-wrap: balance;
}

.landing-intro {
	max-width: 540px;
	margin: 0 auto 25px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 17px;
	line-height: 1.6;
	text-wrap: pretty;
}

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

.landing-login {
	margin-bottom: 40px;
	color: var(--muted);
}

/* A sample story: what it looks like when you have the word. */
.landing-sample {
	max-width: 540px;
	margin: 0 auto 35px;
	text-align: left;

	.panel {
		margin-bottom: 8px;
		box-shadow: 0 6px 18px rgb(0 0 0 / .08);
	}

	figcaption {
		font-size: 13px;
		color: var(--muted);
		text-align: center;
		text-wrap: balance;
	}
}

/* The piece being typed, with a blinking caret. */
.landing-sample-pen {
	padding: 19px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 15px;
	line-height: 1.55;
	background: #fff;
	border: 1px solid #66afe9;
	border-radius: var(--radius);
	box-shadow: inset 0 1px 1px rgb(0 0 0 / .075), 0 0 8px rgb(102 175 233 / .6);

	&::after {
		content: "";
		display: inline-block;
		width: 2px;
		height: 1.1em;
		margin-left: 2px;
		vertical-align: text-bottom;
		background: currentColor;
		animation: blink 1.1s steps(1) infinite;
	}
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

.landing-steps {
	display: grid;
	gap: 15px;
	margin-bottom: 35px;
	text-align: left;
}

@media (min-width: 680px) {
	.landing-steps {
		grid-template-columns: repeat(3, 1fr);
	}
}

.landing-step {
	position: relative;
	padding: 15px;
	background: #fcfcf7;
	border: 1px dashed #c9c4ae;
	border-radius: var(--radius);

	h3 {
		margin: 0 0 6px;
		font-size: 16px;
	}

	p {
		margin: 0;
		font-size: 13px;
		color: #555;
	}
}

.landing-step-no {
	display: block;
	margin-bottom: 4px;
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	color: var(--stamp);
}

.landing-secret {
	font-family: var(--mono);
	font-size: 13px;
	color: var(--muted);
}

/* Pätička */

.footer-moto {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--muted);
}

.footer-bottom .container {
	flex-wrap: wrap;
	align-items: center;
}
