/* ============================================================
   POKÉMON BINGO — STYLESHEET
   Themes: blue (Cerulean), red (Cinnabar), white (Pallet)
   Brand palette: #3B4CCA (blue), #FFDE00 (yellow), #CC0000 (red),
                  #FFFFFF (white), #B3B3B3 (gray), #000000 (black)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
	--yellow: #FFDE00;
	--red: #CC0000;
	--blue: #1A53BB;
	--white: #FFFFFF;
	--black: #1a1a2e;
	--gray: #B3B3B3;
	--gray-dk: #444;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
	--shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
	--font-pixel: 'Press Start 2P', monospace;
	--font-body: 'Nunito', sans-serif;
	--transition: 0.18s ease;
}

/* ---- THEMES ---- */
body.theme-blue {
	--bg-rgb: 15, 27, 92;
	--bg: #0f1b5c;
	--bg2: #1a2d8a;
	--bg3: #243eb0;
	--surface: #1e3099;
	--surface2: #2a42c5;
	--accent: #FFDE00;
	--accent2: #ffeA40;
	--text: #FFFFFF;
	--text-muted: rgba(255, 255, 255, 0.6);
	--text-dark: #0f1b5c;
	--header-bg: #0a1240;
	--ball-bg: #1A53BB;
	--ball-drawn: #FFDE00;
	--ball-drawn-text: #0f1b5c;
	--col-b: #4fc3f7;
	--col-i: #81c784;
	--col-n: #FFDE00;
	--col-g: #ff8a65;
	--col-o: #ce93d8;
	--draw-btn: #FFDE00;
	--draw-btn-text: #0f1b5c;
}

body.theme-red {
	--bg-rgb: 92, 10, 10;
	--bg: #5c0a0a;
	--bg2: #8a1a1a;
	--bg3: #b02424;
	--surface: #991e1e;
	--surface2: #c52a2a;
	--accent: #FFDE00;
	--accent2: #ffeA40;
	--text: #FFFFFF;
	--text-muted: rgba(255, 255, 255, 0.6);
	--text-dark: #5c0a0a;
	--header-bg: #400a0a;
	--ball-bg: #CC0000;
	--ball-drawn: #FFDE00;
	--ball-drawn-text: #5c0a0a;
	--col-b: #4fc3f7;
	--col-i: #81c784;
	--col-n: #FFDE00;
	--col-g: #ff8a65;
	--col-o: #ce93d8;
	--draw-btn: #FFDE00;
	--draw-btn-text: #5c0a0a;
}

body.theme-white {
	--bg-rgb: 240, 240, 240;
	--bg: #f0f0f0;
	--bg2: #e0e0e8;
	--bg3: #d0d0e0;
	--surface: #FFFFFF;
	--surface2: #f8f8ff;
	--accent: #CC0000;
	--accent2: #ff3333;
	--text: #1a1a2e;
	--text-muted: rgba(26, 26, 46, 0.55);
	--text-dark: #1a1a2e;
	--header-bg: #FFFFFF;
	--ball-bg: #e8e8f0;
	--ball-drawn: #CC0000;
	--ball-drawn-text: #FFFFFF;
	--col-b: #3B4CCA;
	--col-i: #2e7d32;
	--col-n: #CC0000;
	--col-g: #e65100;
	--col-o: #6a1b9a;
	--draw-btn: #CC0000;
	--draw-btn-text: #FFFFFF;
}

/* ---- RESET & BASE ---- */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	width: 100%;
	height: 100%;
	font-family: var(--font-body);
	background: var(--bg);
	color: var(--text);
	overflow: hidden;
}

/* ---- SCREEN SYSTEM ---- */
.screen {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	overflow-y: auto;
	opacity: 0;
	pointer-events: none;
	transform: translateY(16px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 10;
}

.screen.active {
	opacity: 1;
	pointer-events: all;
	transform: translateY(0);
}

/* ---- SCREEN HEADER ---- */
.screen-header {
	display: flex;
	align-items: center;
	gap: 12px;
 	padding: 20px;
	background: var(--header-bg);
	border-bottom: 2px solid rgba(255, 255, 255, 0.08);
	position: sticky;
	top: 0;
	z-index: 5;
}

.screen-header h2 {
	font-family: var(--font-pixel);
	font-size: 24px;
	color: var(--accent);
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	pointer-events: none;
}

/* ---- BACK BUTTON ---- */
.back-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	transition: background var(--transition), color var(--transition);
}

.back-btn:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
}

/* ---- BUTTONS ---- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: none;
	border-radius: var(--radius-sm);
	font-family: var(--font-body);
	font-weight: 800;
	cursor: pointer;
	transition: all var(--transition);
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent);
	color: var(--text-dark);
	padding: 10px 22px;
	font-size: 15px;
}

.btn-primary:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
	background: var(--surface2);
	color: var(--text);
	padding: 10px 22px;
	font-size: 15px;
	border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
	background: var(--bg3);
	transform: translateY(-1px);
}

.btn-ghost {
	background: transparent;
	color: var(--text-muted);
	padding: 10px 18px;
	font-size: 14px;
	border: 2px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
	color: var(--text);
	border-color: var(--accent);
	background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
	padding: 7px 14px;
	font-size: 13px;
}

.btn-xs {
	padding: 5px 10px;
	font-size: 12px;
}

.btn-rand:active {
	background: var(--accent) !important;
	color: var(--text-dark) !important;
	border-color: var(--accent) !important;
}

.btn-rand:active {
	background: var(--accent) !important;
	color: var(--text-dark) !important;
	border-color: var(--accent) !important;
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
	position: absolute;
	left: 0;
	width: 100%;
	overflow: hidden;
	z-index: 3;
	height: 40px;
	display: flex;
	align-items: center;
	opacity: 0.25;
}

.ticker-top {
	top: 20px;
}

.ticker-bottom {
	bottom: 20px;
}

.ticker-track {
	display: flex;
	align-items: center;
	gap: 0;
	white-space: nowrap;
	will-change: transform;
}

/* Each logo item with 50px gap on each side */
.ticker-item {
	flex-shrink: 0;
	padding: 0 25px;
	/* 25px each side = 50px between logos */
	display: flex;
	align-items: center;
}

.ticker-item svg {
	height: 28px;
	width: auto;
	display: block;
}

/* Scroll right — JS sets --ticker-w dynamically */
@keyframes ticker-right {
	0% {
		transform: translateX(calc(-1 * var(--ticker-w, 50%)));
	}

	100% {
		transform: translateX(0%);
	}
}

/* Scroll left */
@keyframes ticker-left {
	0% {
		transform: translateX(0%);
	}

	100% {
		transform: translateX(calc(-1 * var(--ticker-w, 50%)));
	}
}

.ticker-right {
	animation: ticker-right 45s linear infinite;
}

.ticker-left {
	animation: ticker-left 45s linear infinite;
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */
#titleScreen {
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background-image: url('../img/title-bg.svg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* background decorations removed */

.title-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
	padding: 40px 24px;
}

/* Pokéball Icon */
.title-pokeball-icon {
	width: 160px;
	height: 160px;
	position: relative;
	filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
	animation: spin-bob 4s ease-in-out infinite;
}

@keyframes spin-bob {

	0%,
	100% {
		transform: rotate(-5deg) translateY(0);
	}

	50% {
		transform: rotate(5deg) translateY(-12px);
	}
}

.pokeball {
	display: block;
	width: 160px;
	height: 160px;
	background: radial-gradient(white 16px, black 17px 18px, white 19px 24px, black 25px 32px, transparent 33px), linear-gradient(to bottom, red 0 70px, black 70px 85px, white 85px 100%);
	border-radius: 50%;
	border: 3px solid black;
	box-shadow: inset -10px -8px 0 0 rgba(0, 0, 0, 0.2);
}

/* Title text */
.title-heading {
	line-height: 1.3;
}

/* Only direct child spans (POKÉMON letters) — exclude .t-bingo wrapper */
.title-heading>span:not(.t-bingo) {
	font-family: var(--font-pixel);
	font-size: clamp(36px, 8vw, 64px);
	display: inline-block;
	text-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
}

.t-p {
	color: #FF5C5C;
	transform: rotate(-3deg);
	display: inline-block;
}

.t-o {
	color: #FF9E3D;
	transform: translateY(3px);
	display: inline-block;
}

.t-k {
	color: #FFDE00;
	transform: rotate(2deg);
	display: inline-block;
}

.t-e {
	color: #7FE87F;
	transform: translateY(-3px);
	display: inline-block;
}

.t-m {
	color: #4fc3f7;
	transform: rotate(-2deg);
	display: inline-block;
}

.t-o2 {
	color: #ce93d8;
	transform: translateY(3px);
	display: inline-block;
}

.t-n {
	color: #FF5C5C;
	transform: rotate(3deg);
	display: inline-block;
}

/* Wave animation for POKÉMON letters — triggered every 20s */
/* Wave animations preserve each letter's rotation */
@keyframes wave-p {

	0%,
	100% {
		transform: rotate(-3deg) translateY(0);
	}

	50% {
		transform: rotate(-3deg) translateY(-18px);
	}
}

@keyframes wave-o {

	0%,
	100% {
		transform: translateY(3px);
	}

	50% {
		transform: translateY(-15px);
	}
}

@keyframes wave-k {

	0%,
	100% {
		transform: rotate(2deg) translateY(0);
	}

	50% {
		transform: rotate(2deg) translateY(-18px);
	}
}

@keyframes wave-e {

	0%,
	100% {
		transform: translateY(-3px);
	}

	50% {
		transform: translateY(-21px);
	}
}

@keyframes wave-m {

	0%,
	100% {
		transform: rotate(-2deg) translateY(0);
	}

	50% {
		transform: rotate(-2deg) translateY(-18px);
	}
}

@keyframes wave-o2 {

	0%,
	100% {
		transform: translateY(3px);
	}

	50% {
		transform: translateY(-15px);
	}
}

@keyframes wave-n {

	0%,
	100% {
		transform: rotate(3deg) translateY(0);
	}

	50% {
		transform: rotate(3deg) translateY(-18px);
	}
}

.title-heading.animate-wave .t-p {
	animation: wave-p 0.5s ease 0.00s both;
}

.title-heading.animate-wave .t-o {
	animation: wave-o 0.5s ease 0.08s both;
}

.title-heading.animate-wave .t-k {
	animation: wave-k 0.5s ease 0.16s both;
}

.title-heading.animate-wave .t-e {
	animation: wave-e 0.5s ease 0.24s both;
}

.title-heading.animate-wave .t-m {
	animation: wave-m 0.5s ease 0.32s both;
}

.title-heading.animate-wave .t-o2 {
	animation: wave-o2 0.5s ease 0.40s both;
}

.title-heading.animate-wave .t-n {
	animation: wave-n 0.5s ease 0.48s both;
}

/* Cascade spin for BINGO! letters */
@keyframes letter-spin {
	0% {
		transform: rotateY(0deg) scale(1);
	}

	40% {
		transform: rotateY(180deg) scale(1.3);
	}

	100% {
		transform: rotateY(360deg) scale(1);
	}
}

.t-bingo-b,
.t-bingo-i,
.t-bingo-n,
.t-bingo-g,
.t-bingo-o,
.t-bingo-ex {
	display: inline-block;
}

.title-heading.animate-bingo .t-bingo-b {
	animation: letter-spin 0.5s ease 0.60s both;
}

.title-heading.animate-bingo .t-bingo-i {
	animation: letter-spin 0.5s ease 0.72s both;
}

.title-heading.animate-bingo .t-bingo-n {
	animation: letter-spin 0.5s ease 0.84s both;
}

.title-heading.animate-bingo .t-bingo-g {
	animation: letter-spin 0.5s ease 0.96s both;
}

.title-heading.animate-bingo .t-bingo-o {
	animation: letter-spin 0.5s ease 1.08s both;
}

.title-heading.animate-bingo .t-bingo-ex {
	animation: letter-spin 0.5s ease 1.20s both;
}

.t-bingo {
	display: inline;
	font-family: var(--font-pixel);
	font-size: clamp(56px, 12vw, 104px);
	color: var(--accent);
	text-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
	letter-spacing: 8px;
}

.t-bingo span {
	display: inline-block;
	font-family: var(--font-pixel);
	font-size: inherit;
	color: inherit;
	text-shadow: inherit;
}

.title-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.title-active-preset {
	font-size: 13px;
	color: var(--text-muted);
	font-weight: 600;
}

.title-active-preset span {
	color: var(--accent);
	font-weight: 800;
}

/* ============================================================
   SETTINGS / THEMES
   ============================================================ */
.settings-content {
	padding: 24px;
}

.settings-label {
	font-size: 13px;
	color: var(--text-muted);
	margin-bottom: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* Game mode cards */
.mode-cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 8px;
}

.mode-card {
	background: var(--surface);
	border: 2px solid transparent;
	border-radius: var(--radius);
	padding: 14px 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	cursor: pointer;
	transition: all var(--transition);
}

.mode-card:hover {
	border-color: var(--accent);
}

.mode-card.active {
	border-color: var(--accent);
	background: var(--surface2);
}

.mode-icon {
	font-size: 24px;
	flex-shrink: 0;
}

.mode-info {
	flex: 1;
}

.mode-name {
	font-weight: 900;
	font-size: 15px;
	margin-bottom: 3px;
}

.mode-desc {
	font-size: 12px;
	color: var(--text-muted);
	font-weight: 600;
	line-height: 1.4;
}

.mode-check {
	color: var(--accent);
	font-size: 16px;
	font-weight: 900;
	opacity: 0;
	flex-shrink: 0;
}

.mode-card.active .mode-check {
	opacity: 1;
}

.theme-cards {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.theme-card {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 16px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all var(--transition);
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	min-width: 120px;
	font-weight: 800;
	font-size: 13px;
}

.theme-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

.theme-card.active {
	border-color: var(--accent);
}

.theme-check {
	position: absolute;
	top: 8px;
	right: 8px;
	color: var(--accent);
	font-size: 14px;
	opacity: 0;
	font-weight: 900;
}

.theme-card.active .theme-check {
	opacity: 1;
}

.theme-preview {
	width: 80px;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.tp-header {
	height: 16px;
}

.tp-body {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3px;
	padding: 3px;
}

.tp-ball {
	border-radius: 4px;
	opacity: 0.6;
}

.tp-active {
	opacity: 1;
}

.theme-card-blue .tp-header {
	background: #0a1240;
}

.theme-card-blue .tp-body {
	background: #1a2d8a;
}

.theme-card-blue .tp-ball {
	background: #2a42c5;
}

.theme-card-blue .tp-active {
	background: #FFDE00;
}

.theme-card-blue {
	color: #FFFFFF;
}

.theme-card-red .tp-header {
	background: #400a0a;
}

.theme-card-red .tp-body {
	background: #8a1a1a;
}

.theme-card-red .tp-ball {
	background: #c52a2a;
}

.theme-card-red .tp-active {
	background: #FFDE00;
}

.theme-card-red {
	color: #FFFFFF;
}

.theme-card-white .tp-header {
	background: #FFFFFF;
}

.theme-card-white .tp-body {
	background: #e0e0e8;
}

.theme-card-white .tp-ball {
	background: #B3B3B3;
}

.theme-card-white .tp-active {
	background: #CC0000;
}

.theme-card-white {
	color: #1a1a2e;
}

/* ============================================================
   PRESETS SCREEN
   ============================================================ */
.presets-list {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.preset-card {
	background: var(--surface);
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	gap: 0;
	border: 2px solid transparent;
	transition: all var(--transition);
	overflow: hidden;
}

.preset-card:hover {
	border-color: var(--surface2);
	box-shadow: var(--shadow);
}

.preset-card.active-preset {
	border-color: var(--accent);
}

.preset-card-selector {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
}


.preset-card-icon {
	font-size: 22px;
	flex-shrink: 0;
	width: 28px;
	text-align: center;
	color: var(--accent);
}

.active-preset .preset-card-icon {
	color: var(--accent);
}

.preset-card-info {
	flex: 1;
}

.preset-card-name {
	font-weight: 900;
	font-size: 16px;
	margin-bottom: 4px;
}

.preset-card-meta {
	font-size: 12px;
	color: var(--text-muted);
	font-weight: 600;
}

.preset-card-actions {
	display: flex;
	gap: 8px;
	padding: 0 12px 0 0;
	flex-shrink: 0;
}

.preset-action-btn {
	background: none;
	border: 2px solid rgba(255, 255, 255, 0.12);
	color: var(--text-muted);
	border-radius: var(--radius-sm);
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	font-family: var(--font-body);
	transition: all var(--transition);
}

.preset-action-btn:hover {
	color: var(--text);
	border-color: var(--accent);
}

.preset-action-btn.danger:hover {
	color: #ff5555;
	border-color: #ff5555;
}

.preset-action-btn.play-btn {
	background: var(--accent);
	color: var(--text-dark);
	border-color: var(--accent);
	font-weight: 900;
}

.preset-action-btn.play-btn:hover {
	filter: brightness(1.1);
}

/* + New Card Set button as first list item */
.preset-card-new {
	height: 77.5px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 2px dashed rgba(255, 255, 255, 0.2) !important;
	background: transparent !important;
	transition: all var(--transition);
}

.preset-card-new:hover {
	border-color: var(--accent) !important;
	background: rgba(255, 255, 255, 0.03) !important;
}

.preset-new-label {
	font-size: 16px;
	font-weight: 800;
	color: var(--text-muted);
	transition: color var(--transition);
}

.preset-card-new:hover .preset-new-label {
	color: var(--accent);
}


.preset-action-btn.cards-btn {
	border-color: rgba(255, 255, 255, 0.2);
}

.preset-action-btn.cards-btn:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.presets-empty {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	gap: 12px;
	padding: 60px 24px;
	text-align: center;
}

.presets-empty.visible {
	display: flex;
}

.empty-pokeball {
	font-size: 48px;
}

.muted {
	color: var(--text-muted);
	font-size: 14px;
}

/* ============================================================
   PRESET EDITOR / SELECTOR
   ============================================================ */
.preset-name-row {
	padding: 16px 20px 0;
}

.preset-name-input {
	width: 100%;
	background: var(--surface);
	border: 2px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-sm);
	padding: 12px 16px;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 800;
	outline: none;
	transition: border-color var(--transition);
}

.preset-name-input:focus {
	border-color: var(--accent);
}

.preset-name-input::placeholder {
	color: var(--text-muted);
	font-weight: 600;
}

.selector-filters {
	padding: 12px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--header-bg);
	border-bottom: 2px solid rgba(255, 255, 255, 0.06);
	position: sticky;
	top: 60px;
	z-index: 4;
}

.search-input {
	width: 100%;
	background: var(--surface);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	outline: none;
	transition: border-color var(--transition);
}

.search-input:focus {
	border-color: var(--accent);
}

.search-input::placeholder {
	color: var(--text-muted);
}

.filter-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.filter-select {
	background: var(--surface);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 600;
	padding: 6px 10px;
	outline: none;
	cursor: pointer;
}

.filter-select:focus {
	border-color: var(--accent);
}

.selector-count {
	font-size: 13px;
	font-weight: 800;
	color: var(--accent);
}

/* Pokémon Gallery */
.pokemon-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 8px;
	padding: 16px 20px 80px;
}

.poke-card {
	background: var(--surface);
	border-radius: var(--radius-sm);
	padding: 8px 4px 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all var(--transition);
	user-select: none;
	position: relative;
}

.poke-card:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.2);
}

.poke-card.selected {
	border-color: var(--accent);
	background: var(--surface2);
}

.poke-card.selected::after {
	content: '✓';
	position: absolute;
	top: 3px;
	right: 5px;
	font-size: 11px;
	font-weight: 900;
	color: var(--accent);
}

.poke-card img {
	width: 60px;
	height: 60px;
	image-rendering: pixelated;
	object-fit: contain;
}

.poke-card .poke-name {
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	line-height: 1.2;
	color: var(--text);
}

.poke-card .poke-type {
	font-size: 8px;
	padding: 2px 5px;
	border-radius: 4px;
	color: white;
	font-weight: 700;
	text-transform: uppercase;
}

/* ============================================================
   MASTER BOARD
   ============================================================ */
#boardScreen {
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding-top: 7px;
}

.board-preset-name {
	font-family: var(--font-pixel);
	font-size: 9px;
	color: var(--accent);
	text-align: center;
	margin-top: 2px;
}

/* Column headers — each spans 2 sub-columns */
.board-columns-header {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	padding: 0 6px;
	gap: 3px;
	flex-shrink: 0;
}

.board-col-header {
	grid-column: span 2;
	text-align: center;
	font-family: var(--font-pixel);
	font-size: 20px;
	padding: 6px 2px;
	border-radius: 6px 6px 0 0;
	font-weight: 900;
}

.col-header-B {
	background: var(--col-b);
	color: var(--black);
}

.col-header-I {
	background: var(--col-i);
	color: var(--black);
}

.col-header-N {
	background: var(--col-n);
	color: var(--black);
}

.col-header-G {
	background: var(--col-g);
	color: var(--black);
}

.col-header-O {
	background: var(--col-o);
	color: var(--black);
}


/* Board grid fills full height, no scroll */
.board-grid {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	gap: 3px;
	padding: 3px 6px;
	flex: 1;
	overflow: hidden;
	/* grid-template-rows set dynamically by JS based on pokemon count */
}

/* Undrawn cell — just shows the sprite, centered */
.board-cell {
	background: var(--ball-bg);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: default;
	border: 2px solid transparent;
	transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
	position: relative;
	overflow: hidden;
	min-height: 0;
	gap: 2px;
	padding: 3px;
}

.board-cell .cell-sprite-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 0;
	width: 100%;
}

/* Name hidden until drawn */
.board-cell .cell-name-wrap {
	display: none;
}

/* Board cell images — scale to height */
.board-cell img {
	width: auto;
	height: 65%;
	max-width: 85%;
	image-rendering: pixelated;
	object-fit: contain;
}

.board-cell .cell-name {
	font-size: clamp(8px, 1vw, 14px);
	font-weight: 800;
	text-align: center;
	line-height: 1.2;
	color: var(--text);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 0 2px;
}

/* Drawn cell — highlight, show both sprite and name */
.board-cell.drawn {
	background: var(--ball-drawn);
	border-color: transparent;
	animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-cell.drawn .cell-sprite-wrap {
	flex: 1;
	min-height: 0;
}

.board-cell.drawn .cell-name-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 100%;
}

.board-cell.drawn .cell-name {
	color: var(--ball-drawn-text);
}

.board-cell.drawn img {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.board-cell.just-drawn {
	box-shadow: 0 0 0 3px var(--accent), 0 0 20px var(--accent);
}

@keyframes sprite-flip {
	0% {
		transform: scaleX(1);
	}

	25% {
		transform: scaleX(-1);
	}

	50% {
		transform: scaleX(1);
	}

	75% {
		transform: scaleX(-1);
	}

	100% {
		transform: scaleX(1);
	}
}

.board-cell.just-drawn .cell-sprite-wrap img {
	animation: sprite-flip 0.6s ease-in-out;
}

@keyframes pop-in {
	0% {
		transform: scale(0.7);
	}

	100% {
		transform: scale(1);
	}
}

/* Invisible blank padding cell */
.board-cell-blank {
	background: transparent;
	border-radius: 8px;
	min-height: 0;
}

/* Board footer */
.board-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: var(--header-bg);
	border-top: 2px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}

/* Left section: menu/reset/pattern buttons */
.board-footer-left {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

/* Center section: preset name */
.board-footer-center {
	flex: 1;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 20px;
	min-width: 0;
	gap: 20px;
}

/* Right section: last drawn + draw button */
.board-footer-right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

/* Footer nav buttons */
.footer-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 2px solid rgba(255, 255, 255, 0.12);
	color: var(--text-muted);
	border-radius: var(--radius-sm);
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	font-family: var(--font-body);
	transition: all var(--transition);
	white-space: nowrap;
}

.footer-btn:hover {
	color: var(--text);
	border-color: var(--accent);
	background: rgba(255, 255, 255, 0.1);
}

/* Hide pattern button and overlay column in match mode */
body.mode-match #patternBtn {
	display: none;
}

body.mode-match .draw-overlay-column {
	display: none;
}

body.mode-match .last-drawn-col {
	display: none;
}

.last-drawn {
	display: flex;
	align-items: center;
	min-width: 225px;
	gap: 20px;
}

.last-drawn-sprite-wrap {
	width: 52px;
	height: 52px;
	background: var(--ball-bg);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: 3px solid var(--surface2);
}

.last-drawn-sprite {
	width: 35px !important;
	height: 35px !important;
	max-width: 35px !important;
	max-height: 35px !important;
	object-fit: contain;
	display: block;
}

.last-drawn-sprite.hidden {
	display: none !important;
}

.last-drawn-placeholder {
	font-size: 24px;
	color: var(--text-muted);
}

.last-drawn-info {
	flex: 1;
	min-width: 0;
}

.last-drawn-col {
	font-family: var(--font-pixel);
	font-size: 10px;
	margin-bottom: 2px;
}

.last-drawn-col.col-B {
	color: var(--col-b);
}

.last-drawn-col.col-I {
	color: var(--col-i);
}

.last-drawn-col.col-N {
	color: var(--col-n);
}

.last-drawn-col.col-G {
	color: var(--col-g);
}

.last-drawn-col.col-O {
	color: var(--col-o);
}

.last-drawn-name {
	font-size: 15px;
	font-weight: 900;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.drawn-counter {
	font-size: 13px;
	color: var(--text-muted);
	font-weight: 600;
}

.last-drawn-label {
	font-size: 10px;
	color: var(--text-muted);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Draw button */
.draw-btn {
	background: var(--draw-btn);
	color: var(--draw-btn-text);
	border: none;
	border-radius: 50px;
	padding: 14px 24px;
	font-family: var(--font-pixel);
	font-size: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all var(--transition);
	flex-shrink: 0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.draw-btn:hover {
	filter: brightness(1.1);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.draw-btn:active {
	transform: scale(0.96);
}

.draw-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

.draw-btn-pokeball {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: white;
	border: 3px solid rgba(0, 0, 0, 0.25);
	position: relative;
	flex-shrink: 0;
}

.draw-btn-pokeball::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 3px;
	background: rgba(0, 0, 0, 0.25);
	transform: translateY(-50%);
}

/* ============================================================
   DRAW OVERLAY
   ============================================================ */
.draw-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--bg-rgb, 15, 27, 92), 0.93);
	backdrop-filter: blur(5px);
	cursor: pointer;
	opacity: 1;
	transition: opacity 0.4s ease;
}

.draw-overlay.hidden {
	opacity: 0;
	pointer-events: none;
}

.draw-overlay-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	animation: overlay-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes overlay-pop {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.draw-overlay-column {
	font-family: var(--font-pixel);
	font-size: clamp(28px, 7vw, 52px);
	color: var(--accent);
	text-shadow: 0 0 40px var(--accent);
	letter-spacing: 4px;
}

.draw-overlay-pokeball {
	width: 30vw;
	height: 30vw;
	max-width: 500px;
	max-height: 500px;
	margin: 25px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
	background-color: var(--ball-bg);
	border: 8px solid var(--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 80px rgba(255, 222, 0, 0.35), 0 0 160px rgba(255, 222, 0, 0.18);
	animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

	0%,
	100% {
		box-shadow: 0 0 80px rgba(255, 222, 0, 0.35), 0 0 160px rgba(255, 222, 0, 0.18);
	}

	50% {
		box-shadow: 0 0 120px rgba(255, 222, 0, 0.55), 0 0 220px rgba(255, 222, 0, 0.28);
	}
}

.draw-overlay-pokeball img {
	width: 70% !important;
	height: 70% !important;
	max-width: none !important;
	object-fit: contain;
	image-rendering: pixelated;
	filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5));
	animation: sprite-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both,
		sprite-hover 3s ease-in-out 0.7s infinite;
}

@keyframes sprite-bounce {
	0% {
		transform: scale(0) rotate(-10deg);
	}

	100% {
		transform: scale(1) rotate(0deg);
	}
}

@keyframes sprite-hover {

	0%,
	100% {
		transform: translateY(0px);
	}

	50% {
		transform: translateY(-10px);
	}
}

.draw-overlay-name {
	font-family: var(--font-pixel);
	font-size: clamp(18px, 5vw, 36px);
	color: var(--text);
	text-align: center;
	animation: fade-up 0.4s ease 0.2s both;
	padding: 0 20px 50px;
}

.draw-overlay-count {
	font-size: clamp(13px, 1.8vw, 18px);
	color: var(--text-muted);
	font-weight: 600;
	animation: fade-up 0.4s ease 0.3s both;
}

.draw-overlay-hint {
	font-size: clamp(10px, 1.2vw, 13px);
	color: var(--text-muted);
	font-weight: 400;
	margin-top: 8px;
	animation: fade-up 0.4s ease 0.5s both;
}

@keyframes fade-up {
	0% {
		opacity: 0;
		transform: translateY(12px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============================================================
   WIN PATTERN SCREEN
   ============================================================ */
.win-pattern-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.win-bingo-card {
	display: grid;
	grid-template-columns: repeat(5, 56px);
	grid-template-rows: repeat(6, 56px);
	gap: 6px;
}

.win-cell {
	background: var(--surface);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-pixel);
	font-size: 11px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all var(--transition);
	user-select: none;
}

.win-cell:hover {
	border-color: var(--accent);
}

.win-cell.win-active {
	background: var(--accent);
	color: var(--text-dark);
}

.win-pattern-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.win-preset-btn {
	background: var(--surface);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	cursor: pointer;
	transition: all var(--transition);
}

.win-preset-btn:hover {
	background: var(--accent);
	color: var(--text-dark);
	border-color: var(--accent);
}

.win-hint {
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
	display: none;
}

.modal {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 28px;
	min-width: 300px;
	max-width: 90vw;
	display: flex;
	flex-direction: column;
	gap: 16px;
	box-shadow: var(--shadow-lg);
	border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal h3 {
	font-family: var(--font-pixel);
	font-size: 14px;
	color: var(--accent);
}

.modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
	.board-columns-header {
		padding: 0 4px;
	}

	.board-grid {
		gap: 3px;
		padding: 3px 4px;
	}

	.board-cell .cell-name {
		font-size: 7px;
	}

	.pokemon-gallery {
		grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
		gap: 6px;
	}
}

@media (min-width: 900px) {
	.pokemon-gallery {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	}
}

@media screen and (min-width: 992px) {

	.presets-list,
	.settings-content {
		width: 70%;
		margin: auto;
	}
}

/* ============================================================
   CARD GENERATOR
   ============================================================ */
.card-gen-controls {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: auto;
	padding: 20px 24px;
	background: var(--surface);
	border-radius: var(--radius);
}

.card-gen-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 14px;
	color: var(--text);
}

.card-gen-input {
	background: var(--surface);
	border: 2px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 800;
	padding: 8px 12px;
	width: 80px;
	text-align: center;
	outline: none;
}

.card-gen-input:focus {
	border-color: var(--accent);
}

.card-gen-preview {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	justify-content: center;
	align-content: flex-start;
}

.card-gen-hint {
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	margin-top: 40px;
	width: 100%;
}

/* ---- Print card layout ---- */
.print-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.print-deck-label {
  font-size: 9pt;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-weight: 700;
  padding-right: 2px;
  text-align: right;
}

.print-logo {
  display: flex;
  justify-content: center;
}

.print-logo svg {
  height: 27px;
  margin-top: 4px;
  opacity: .5;
  width: auto;
}

.print-card {
	background: white;
	color: #1a1a2e;
	border: 3px solid #1a1a2e;
	border-radius: 12px;
	overflow: hidden;
	width: 100%;
	max-width: 600px;
	font-family: var(--font-body);
	box-shadow: var(--shadow);
	page-break-inside: avoid;
}

.print-card-header {
	background: #CC0000;
	color: white;
	padding: 20px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 20px;
}

.print-pokeball {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 5px solid white;
	position: relative;
	flex-shrink: 0;
	background: linear-gradient(180deg, white 0%, white 43%, #333 43%, #333 57%, white 57%);
}

.print-pokeball::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: white;
	border: 4px solid #333;
}

.print-title {
	font-family: 'Press Start 2P', monospace;
	font-size: 28px;
	color: white;
	text-align: center;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 2px;
	line-height: 1.8;
}

.print-title-p {
	color: #ffaaaa;
	transform: rotate(-3deg);
	display: inline-block;
}

.print-title-o {
	color: #ffcc88;
	transform: translateY(2px);
	display: inline-block;
}

.print-title-k {
	color: #ffee66;
	transform: rotate(2deg);
	display: inline-block;
}

.print-title-e {
	color: #aaffaa;
	transform: translateY(-2px);
	display: inline-block;
}

.print-title-m {
	color: #aaddff;
	transform: rotate(-2deg);
	display: inline-block;
}

.print-title-o2 {
	color: #ddaaff;
	transform: translateY(2px);
	display: inline-block;
}

.print-title-n {
	color: #ffaaaa;
	transform: rotate(3deg);
	display: inline-block;
}

.print-title-sep {
	width: 6px;
}

.print-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	border-top: 3px solid #1a1a2e;
}

.print-col-header {
	text-align: center;
	font-family: var(--font-pixel);
	font-size: 18px;
	padding: 8px 2px;
	font-weight: 900;
	border-right: 2px solid #ccc;
	color: white;
}

.print-col-header.col-o {
	border-right: none !important;
}

.col-b {
	background: #4fc3f7;
	color: #1a1a2e;
}

.col-i {
	background: #81c784;
	color: #1a1a2e;
}

.col-n {
	background: #FFDE00;
	color: #1a1a2e;
}

.col-g {
	background: #ff8a65;
	color: #1a1a2e;
}

.col-o {
	background: #ce93d8;
	color: #1a1a2e;
}

.print-cell {
	border-top: 2px solid #ccc;
	border-right: 2px solid #ccc;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4px 2px;
	min-height: 100px;
	text-align: center;
}

.print-cell:nth-child(5n) {
	border-right: none !important;
}

.print-cell img {
	width: 70px;
	height: 70px;
	object-fit: contain;
	image-rendering: auto;
}

.print-cell-name {
	font-size: 9px;
	font-weight: 700;
	line-height: 1.2;
	color: #333;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.print-free {
	background: #FFDE00;
}

.print-free-label {
	font-family: var(--font-pixel);
	font-size: 9px;
	color: #1a1a2e;
	font-weight: 900;
}

/* Match mode print card additions */

.print-match-title-group {
	display: inline-flex;
	align-items: flex-start;
	gap: 20px;
}

.print-match-bingo {
	font-family: 'Press Start 2P', monospace;
	font-size: 28px;
	color: white;
	letter-spacing: 2px;
	line-height: 1.6;
	text-align: center;
	margin-top: 4px;
}

/* Match mode print grid — no column header row */
.print-grid.match-grid {
	grid-template-rows: repeat(5, 1fr) !important;
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
/* Print handled via new window in printCards() */
