:root{
	--bg:#0f0a0a;
	--panel:#151015;
	--line:#2a1a1a;
	--text:#f3f4f6;
	--muted:#b5b1b3;
	--accent:#d44;
	--warn:#e3a008;
	--ok:#16a34a;
	--me:#b91c1c;
	--them:#065f46;
	--over:#f59e0b;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: linear-gradient(180deg, var(--bg), #130c0c);
	color: var(--text);
	font-family: Inter, system-ui;
}

header {
	padding: 16px;
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	background: rgba(15,10,10,.9);
	backdrop-filter: blur(6px);
	z-index: 10;
}

h1 { margin: 0; font-size: 18px; }
header a.title { 
	color: var(--text); 
	text-decoration: none; 
	cursor: pointer;
	transition: color 0.2s ease;
}
header a.title:hover { 
	color: var(--accent);
}
#welcome { margin: 0; font-size: 22px; font-weight: 800; color: #fee2e2; }

main { max-width: 1080px; margin: 20px auto; padding: 0 14px 84px; display: flex; flex-direction: column; }

.pill {
	font-size: 12px;
	border: 1px solid var(--line);
	padding: 6px 10px;
	border-radius: 999px;
	color: #f3dada;
	margin-right: 6px;
	background: #1b1212;
}

.badge {
	font-size: 11px;
	background: #1b1212;
	border: 1px solid var(--line);
	padding: 6px 8px;
	border-radius: 10px;
	color: #fce7e7;
}

.card {
	background: linear-gradient(180deg, var(--panel), #1a1111);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 14px 14px 18px;
	margin: 10px 0;
	animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
#instrP1 ol, #instrP2 ol {
	min-height: 120px;
	margin: 0;
}

#infoCard, #infoCard * {
	transition: none !important;
	animation: none !important;
	transform: none !important;
}

#infoCard.instructions-highlight {
	animation: instructionGlow 2s ease-in-out !important;
}

h2 { margin: 0 0 8px; font-size: 17px; }
h3 { margin: 10px 0 6px; font-size: 15px; color: #fce7e7; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }
.hidden { display: none !important; }
.muted { color: #c6b5b5; font-size: 12px; }
#instrP1 ol.muted, #instrP2 ol.muted { font-size: 14px; }

.btn {
	border: 0;
	border-radius: 10px;
	padding: 9px 12px;
	font-weight: 700;
	cursor: pointer;
	background: var(--accent);
	color: #2b0b0b;
	transition: all 0.2s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(221, 68, 68, 0.25); }

.btn--ghost {
	background: transparent;
	border: 1px solid var(--line);
	color: #ffe4e6;
}

.btn--warn { background: var(--warn); color: #1a1203; }
.btn--ok { background: var(--ok); color: #05130a; }

.btn--pulse {
	animation: pulse 2s infinite;
}

.input {
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #1b1212;
	color: #ffe4e6;
	transition: border-color 0.2s ease;
}

.input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(221, 68, 68, 0.2);
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 30px #1b1212 inset !important;
	-webkit-text-fill-color: #ffe4e6 !important;
	caret-color: #ffe4e6;
}

/* Opera/Chromium-specific calendar icon styling */
input[type="date"] {
	color-scheme: dark;
	background: #1b1212;
	border: 1px solid var(--line);
	color: #ffe4e6;
	padding: 8px 12px;
	border-radius: 10px;
}

/* Calendar picker indicator with text color #f3f4f6 */
input[type="date"]::-webkit-calendar-picker-indicator {
	filter: brightness(0) saturate(100%) invert(96%) sepia(1%) saturate(1825%) hue-rotate(316deg) brightness(102%) contrast(98%) !important;
	cursor: pointer !important;
	opacity: 1 !important;
}

input[type="time"] {
	color-scheme: dark;
	background: #1b1212;
	border: 1px solid var(--line);
	color: #ffe4e6;
	padding: 8px 12px;
	border-radius: 10px;
}

input[type="time"]::-webkit-calendar-picker-indicator {
	filter: brightness(0) saturate(100%) invert(96%) sepia(1%) saturate(1825%) hue-rotate(316deg) brightness(102%) contrast(98%);
	cursor: pointer;
	opacity: 1;
}

.tabs { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }

.tab {
	border: 1px solid var(--line);
	background: #1b1212;
	border-radius: 10px;
	padding: 8px 12px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateY(0);
}

.tab:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(221, 68, 68, 0.15);
}

.tab--active {
	outline: 2px solid var(--accent);
	font-weight: 700;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(221, 68, 68, 0.25);
}

.rowline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border: 1px dashed var(--line);
	border-radius: 10px;
	padding: 8px 10px;
	background: #1b1212;
}

.copybox { display: flex; gap: 8px; align-items: center; }
.copybox .input { flex: 1; }

.kv {
	display: grid;
	grid-template-columns: 160px 1fr auto;
	gap: 8px;
	width: 100%;
}

ul.kv {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

ul.kv li {
	display: flex;
	gap: 8px;
	padding: 4px 0;
	border-bottom: 1px dashed #221414;
}

ul.kv li:last-child {
	border-bottom: 0;
}

ul.kv .k {
	min-width: 140px;
	color: #cfc7c7;
	flex-shrink: 0;
}

.tourneybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tourneywrap { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#tourneyLogo { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.tourneytext { display: flex; flex-direction: column; gap: 2px; }
#legionLogo {
	width: 100px;
	height: 100px;
	object-fit: cover;
	border-radius: 8px;
	opacity: .95;
	cursor: pointer;
	transition: all 0.2s ease;
}
#legionLogo:hover { transform: scale(1.05); opacity: 1; }

.file-drop-zone {
	border: 2px dashed var(--line);
	border-radius: 12px;
	padding: 32px 24px;
	text-align: center;
	background: rgba(255,255,255,0.02);
	cursor: pointer;
	transition: all 0.3s ease;
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
}

.file-drop-zone:hover {
	border-color: var(--accent);
	background: rgba(221, 68, 68, 0.05);
	transform: scale(1.02);
}

#toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #1b1212;
	border: 1px solid var(--line);
	padding: 10px 14px;
	border-radius: 10px;
	display: none;
	z-index: 50;
	animation: toastSlide 0.3s ease-out;
}

.toast--success {
	background: linear-gradient(135deg, var(--ok), #22c55e);
	color: white;
}

.toast--persistent {
	background: rgba(255, 193, 7, 0.9);
	color: #000;
	border-color: #ffc107;
}

.schedule-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.schedule-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.schedule-modal-content {
	background: linear-gradient(135deg, #1b1212, #2a1a1a);
	border: 2px solid var(--accent);
	border-radius: 12px;
	padding: 32px;
	max-width: 500px;
	text-align: center;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.schedule-modal-overlay.active .schedule-modal-content {
	transform: scale(1);
}

.schedule-modal-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px 0;
	color: var(--accent);
}

.schedule-modal-message {
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
	margin-bottom: 24px;
}

.schedule-modal-dismiss {
	background: var(--accent);
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.schedule-modal-dismiss:hover {
	background: rgba(221, 68, 68, 0.8);
	transform: translateY(-2px);
}

.site-footer {
	border-top: 1px solid #2a1a1a;
	margin-top: 40px;
	padding: 20px 20px 16px;
	color: #8a7575;
	font-size: 13px;
}

.footer-simple {
	max-width: 1080px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 12px;
}

.footer-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.footer-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.footer-copyright {
	max-width: 1080px;
	margin: 0 auto;
	padding-top: 8px;
	border-top: 1px solid #2a1a1a;
	color: #8a7575;
	font-size: 12px;
	text-align: center;
}

.footer-title {
	color: #b5b1b3;
	font-weight: 500;
}

.version-badge {
	background: var(--accent);
	color: #0f0a0a;
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	cursor: default;
}


.developer-info {
	display: flex;
	align-items: center;
	gap: 6px;
}

.developer-logo {
	width: 14px;
	height: 14px;
	border-radius: 2px;
	object-fit: contain;
}

.footer-dev {
	color: #8a7575;
	font-size: 12px;
}

.footer-links {
	display: flex;
	gap: 4px;
	margin-left: 8px;
}

.footer-link {
	color: #fda4af;
	text-decoration: none;
	padding: 4px 6px;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
}

.footer-link:hover {
	background: rgba(253, 164, 175, 0.1);
	text-decoration: none;
}

@media (max-width: 600px) {
	.footer-simple {
		grid-template-columns: 1fr;
		text-align: center;
		gap: 12px;
	}
	
	.footer-left,
	.footer-center,
	.footer-right {
		justify-self: center;
	}
}

@keyframes slideIn {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes toastSlide {
	from { transform: translateX(-50%) translateY(100px); opacity: 0; }
	to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

.instructions-highlight {
	animation: instructionGlow 2s ease-in-out;
}

@keyframes instructionGlow {
	0%, 100% { box-shadow: none; }
	50% { box-shadow: 0 0 20px rgba(221, 68, 68, 0.4); }
}

@media (max-width: 560px) {
	#tourneyLogo { width: 44px; height: 44px; }
	#legionLogo { display: none; }
}

.admin-grid { display: grid; gap: 10px; }
.admin-room {
	background: #140d0d;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px;
}
.admin-room .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td {
	border-bottom: 1px solid var(--line);
	padding: 8px;
	text-align: left;
	font-size: 14px;
	vertical-align: top;
}

.table-scroller { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }

.details {
	margin-top: 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #120b0b;
	padding: 10px;
}

.details h4 { margin: 8px 0 6px 0; font-size: 14px; opacity: .9; }

.admin-panel {
	background: linear-gradient(135deg, #1a1203, #2d1f05);
	border: 2px solid var(--warn);
}

.admin-action {
	background: var(--warn);
	color: #1a1203;
}

.admin-danger {
	background: var(--accent);
	color: #210a0a;
}

.admin-info {
	background: rgba(221, 68, 68, 0.1);
	border: 1px solid var(--accent);
	border-radius: 8px;
	padding: 12px;
	margin: 8px 0;
}

.split {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

@media(min-width: 900px) {
	.split { grid-template-columns: 1fr 1fr; }
}

.subcard {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px;
	background: #160d0d;
}

.admin-kv {
	margin: 0;
	padding: 0;
	list-style: none;
}

.admin-kv li {
	display: flex;
	gap: 8px;
	padding: 4px 0;
	border-bottom: 1px dashed #221414;
}

.admin-kv li:last-child { border-bottom: 0; }
.admin-kv .k { min-width: 140px; color: #cfc7c7; }

.small { font-size: 12px; color: #cfc7c7; }
.good { color: #8ef58e; }
.warn { color: #ffd27d; }
.link { color: #fbb6b6; text-decoration: underline; }
.code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	background: #1b1212;
	border: 1px solid #2a1a1a;
	border-radius: 6px;
	padding: 2px 6px;
}
.box-btn {
	background: transparent;
	border: 1px solid var(--line);
	color: var(--muted);
}
.box-btn--active {
	background: var(--accent);
	color: #210a0a;
	border-color: var(--accent);
}

/* Custom tooltip for disabled buttons */
.btn-tooltip {
	position: relative;
	display: inline-block;
}

.btn-tooltip .tooltip-text {
	visibility: hidden;
	width: 220px;
	background-color: #333;
	color: #fff;
	text-align: center;
	border-radius: 6px;
	padding: 8px;
	position: absolute;
	z-index: 1000;
	bottom: 120%;
	left: 50%;
	margin-left: -110px;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.1s ease, visibility 0.1s ease;
	box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-tooltip .tooltip-text::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: #333 transparent transparent transparent;
}

.btn-tooltip:hover .tooltip-text {
	visibility: visible;
	opacity: 1;
}

/* OAuth Button Styles */
.oauth-container {
	margin-bottom: 1.5rem;
}

.oauth-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	padding: 0.875rem 1.5rem;
	background: white;
	color: #333;
	border: 1px solid #dadce0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 500;
	transition: all 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.oauth-button:hover {
	background: #f8f9fa;
	border-color: #c6c6c6;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.oauth-button:active {
	background: #f1f3f4;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.oauth-icon {
	font-size: 1.2rem;
}

.login-divider {
	display: flex;
	align-items: center;
	margin: 1rem 0;
	color: var(--text-muted);
	font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}

.login-divider span {
	padding: 0 1rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}