/* Global Black & White Theme */
:root {
	--bg: #fff;
	--text: #000;
	--muted: #555;
	--panel: #fff;
	--border: #e5e5e5;
	--link: #000;
	--link-hover: #222;
	--accent: #000; /* buttons */
	--accent-contrast: #fff;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	margin: 0;
	padding: 2rem;
	background: var(--bg);
	color: var(--text);
}

h1, h2, h3 { margin-top: 1.2rem; }

/* Links */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* Muted text */
.muted { color: var(--muted); }

/* Content containers */
.card {
	max-width: 720px;
	margin: 10vh auto;
	padding: 2rem;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.panel {
	max-width: 920px;
	margin: 0 auto;
	padding: 1.5rem;
	background: var(--panel);

}

/* Footer */
.site-footer {
	max-width: 920px;
	margin: 0 auto;
	padding: 1.5rem;
	text-align: center;
	color: var(--muted);
}
.site-footer a { color: var(--link); }
.site-footer a:hover { color: var(--link-hover); }

/* Inline code */
code { background: #f5f5f5; border: 1px solid var(--border); padding: 0.1rem 0.3rem; border-radius: 4px; color: var(--text); }

/* Nav spacing */
nav a { margin-right: 1rem; }

/* Forms (Contact) */
label { display: block; margin: .75rem 0 .25rem; }
input[type="text"], input[type="email"], textarea {
	width: 100%;
	padding: .6rem .7rem;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
}
textarea { min-height: 160px; }
button {
	margin-top: 1rem;
	background: var(--accent);
	color: var(--accent-contrast);
	border: 1px solid var(--accent);
	padding: .7rem 1rem;
	border-radius: 8px;
	cursor: pointer;
}
button:hover { background: #111; }

/* /create drag-and-drop affordances */
#cardsList .cc-card-row {
	transition: transform .12s ease, opacity .12s ease, outline-color .12s ease;
}
#cardsList .cc-card-row.cc-dragging {
	opacity: .55;
}
#cardsList .cc-card-row.cc-drop-target {
	outline: 2px dashed var(--border);
	outline-offset: 2px;
	transform: translateY(2px);
}
#cardsList .cc-drag-handle { cursor: grab; }
#cardsList .cc-drag-handle:active { cursor: grabbing; }

/* /create preview crop marks */
.cc-preview-sheet {
	position: relative;
	width: 100%;
}

/* Main preview canvas */
.cc-preview-sheet > canvas:not(.cc-crop-overlay) {
	position: relative;
	z-index: 1;
	display: block;
}

/* Crop overlay canvas (must override the rule above) */
.cc-preview-sheet > canvas.cc-crop-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

.row { display: flex; gap: 1rem; }
.row > div { flex: 1; }

.alert { margin-top: 1rem; padding: .7rem 1rem; border-radius: 8px; display: none; }
.alert.ok { background: #f5f5f5; border: 1px solid var(--border); color: var(--text); }
.alert.err { background: #f5f5f5; border: 1px solid var(--border); color: var(--text); }

/* Utility */
.hp { position: absolute; left: -5000px; }

/* CTA grid/panels */
.cta-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 720px){ .cta-grid { grid-template-columns: 1fr 1fr; } }
.cta-panel {
	display: block;
	padding: 2rem;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	color: #000000;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(0,0,0,.2);
	transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.cta-panel:hover { transform: translateY(-2px); background: #f7f7f7; border-color: #dddddd; }
.cta-panel:focus { outline: 2px solid #000; outline-offset: 2px; }
.cta-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 .4rem; color: #000; }
.cta-desc { color: #444; margin: 0; line-height: 1.5; }

/* CTA link affordance */
.cta-cta { margin-top: .9rem; font-weight: 600; color: #000; display: inline-flex; align-items: center; gap: .35rem; }
.cta-cta .arrow { transition: transform .12s ease; }
.cta-panel:hover .cta-cta { text-decoration: underline; }
.cta-panel:hover .cta-cta .arrow { transform: translateX(2px); }

/* CTA media */
.cta-media {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #ffffff; /* match panel */
	border: none; /* no frame around image */
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 1rem;
}
.cta-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* Opt-in: show the whole image with letterboxing if needed */
.cta-media img.fit-contain { object-fit: contain; background: #f5f5f5; }

/* Optional: let the image dictate height (no fixed 16:9, no letterboxing) */
.cta-media.auto { aspect-ratio: auto; }
.cta-media.auto img { height: auto; }

/* Site logo */
.site-logo { display: flex; justify-content: center; }
.site-logo-inner { background: #fff; padding: .5rem .75rem; border-radius: 10px; }
.site-logo img { display: block; max-height: 48px; max-width: 180px; height: auto; width: auto; }

/* Search (Instructions page) */
.search-wrap { max-width: 720px; margin: 0 auto 1rem; padding: 0 0.25rem; }
.search { position: relative; }
.search-icon {
	position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
	pointer-events: none;
	width: 24px; height: 24px; overflow: hidden;
	/* Hide any text node (emoji) and draw a crisp SVG icon instead */
	font-size: 0; line-height: 0;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 18px 18px;
}
.search-input {
	width: 100%;
	height: 48px; /* fixed height to compute perfect semi-circle ends */
 
	border-radius: 24px; /* exactly half of height for true semi-circles */
	border: 1px solid #e5e5e5;
	background: #fff;
	color: #000;
	box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.search-input::placeholder { color: #777; }
.search-input:focus { outline: none; border-color: #d0d0d0; box-shadow: 0 10px 26px rgba(0,0,0,.16); }

/* Ensure search field text starts well in from the left, overriding generic input styles */
input#gameSearch.search-input {
	/* keep icon area clear */
	/* padding-left: 56px !important;
	padding-right: 16px; */
	/* visibly start text further in (acts like tabs) */
	text-indent: 64px;
    	border-radius: 80px;
}
input#gameSearch.search-input::placeholder { text-indent: 64px; }

/* Search results list (one item per row) */
.tile-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; margin: 1rem auto 0; max-width: 920px; }
.tile-card { display: block; background: transparent; color: #000; border: 0; border-radius: 12px; box-shadow: none; transition: background .12s ease; overflow: visible; }
.tile-card:hover { background: transparent; }

.tile-thumb { display: none; }
.tile-body {
	padding: .9rem;
	min-width: 0;
	display: grid;
	grid-template-columns: 50px minmax(0, 1fr) auto;
	grid-template-rows: auto auto auto;
	column-gap: .5rem;
	row-gap: .25rem;
	align-items: start;
}
.tile-thumb-icon { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; border: 1px solid #eee; background: #fff; grid-column: 1; grid-row: 1 / span 2; }
.tile-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #000; grid-column: 2; grid-row: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tile-actions { grid-column: 3; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: .5rem; justify-self: end; align-self: center; color: var(--muted); white-space: nowrap; }
.tile-liked { font-size: .95rem; line-height: 1; }
.tile-vote { margin-top: 0; border: 0; border-radius: 0; background: transparent; padding: 0; cursor: pointer; font-size: 1rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
.tile-vote:hover { background: transparent; }
.tile-vote[aria-pressed="true"] { text-decoration: underline; }
.tile-cta { margin-top: 0; font-weight: 600; color: #000; display: inline-flex; align-items: center; gap: .3rem; position: static; white-space: nowrap; }
.tile-cta:hover { text-decoration: underline; }
.tile-cta { grid-column: 2; grid-row: 2; }
.tile-cta .arrow { transition: none; }

.tile-desc {
	margin: 0;
	color: #444;
	line-height: 1.45;
	grid-column: 1 / -1;
	grid-row: 3;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* Pagination */
.games-pager { max-width: 920px; margin: .75rem auto 0; display: flex; justify-content: center; align-items: center; gap: .75rem; color: var(--muted); }
.games-pager .pager-link { padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--link); }
.games-pager .pager-link:hover { text-decoration: underline; color: var(--link-hover); }
.games-pager .pager-link[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.games-pager .pager-meta { font-size: .95rem; }

/* Mobile: keep the same row layout, just more compact */
@media (max-width: 600px){
	.tile-body { padding: .8rem; }
	.tile-title { font-size: 1rem; }
	.tile-cta { font-size: .95rem; }
}

@media (max-width: 360px){
	/* no special-casing needed */
}

/* Cookie banner */
.cookie-banner {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	background: #fff;
	border-top: 1px solid var(--border);
	color: var(--text);
	padding: .75rem 1rem;
	z-index: 1000;
}
.cookie-banner__content { max-width: 920px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-banner__actions button { margin-left: .5rem; }
