/* ── Canvas viewport wrapper ──────────────────────────────────────────────
   Normally the canvas is 720×624 and sits centred with transform(-50%,-50%).
   For XL maps the canvas doubles to 1440×624 but the visible window stays
   720 px wide; the canvas slides left/right via JS (Game._applyScroll).
   ────────────────────────────────────────────────────────────────────── */
#canvas-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 624px;
    overflow: hidden;      /* clips the XL canvas to the 720-px viewport  */
    pointer-events: auto;
}

/* When the XL class is present keep the canvas positioned by JS scrollX */
#canvas-wrapper.xl-map canvas {
    /* JS sets transform via _applyScroll(); we remove the default centering */
    position: absolute;
    top: 50%;
    /* left is controlled by the transform set in JS */
}

/* Scroll hint bar — thin bar at the bottom of the canvas showing position */
#canvas-wrapper.xl-map::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 4px;
    right: 4px;
    height: 3px;
    background: rgba(0,0,0,0.4);
    border-radius: 2px;
    pointer-events: none;
}

/* ── Scrollbar thumb (updated dynamically via CSS var --scroll-pct) ───── */
#canvas-wrapper.xl-map::before {
    content: '';
    position: absolute;
    bottom: 3px;
    left: calc(4px + (100% - 8px) * var(--scroll-pct, 0) * 0.5);
    width: calc((100% - 8px) * 0.5);  
    height: 3px;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    pointer-events: none;
    transition: left 0.05s linear;
}

/* XL route spans 2 grid columns */
.maps-scene-route-xl {
    /* Keeps its own name tag centred across the wider cell */
}

.maps-scene-route-xl .maps-scene-route-name {
    font-size: 9px;   /* slightly larger since there's more room */
}

/* When 12 slots are active the container grows to accommodate 2 extra rows.
   Each slot is flex: 0 0 50% so 12 slots = 6 rows. The extra 2 appear at
   the bottom and use the same alternating background as the existing ones. */
.ui-pokemon-container.xl-slots .ui-pokemon:nth-child(11),
.ui-pokemon-container.xl-slots .ui-pokemon:nth-child(12) {
    /* inherit standard slot sizing; the container grows automatically */
}

/* Alternating background for the 2 new slots (continues the existing pattern) */
.ui-pokemon-container.xl-slots .ui-pokemon:nth-child(11) {
    background: rgba(0, 0, 0, 0.05);
}
.ui-pokemon-container.xl-slots .ui-pokemon:nth-child(12) {
    background: rgba(0, 0, 0, 0.15);
}

.maps-scene-route-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px; 
    height: 416px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(6, 1fr);
    
    background: rgba(40, 40, 40, 0.9);

    background-image: linear-gradient(
        rgba(255, 255, 255, 0.03) 1px, 
        transparent 1px
    );
    background-size: 100% 4px;
    
    overflow: visible; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.maps-scene-route {
	position: relative;
	width: 100%;
	height: 100%;
	
	background-size: 100% 100%; 
	background-position: center;
	background-repeat: no-repeat;

	cursor: pointer;
	outline: 1px solid black;
	box-sizing: border-box;
}

.maps-scene-route:hover {
	filter: brightness(1.2);
}

.maps-scene-route-empty {
	position: relative;
	width: 100%;
	height: 100%;
	background: #252527;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #3d3d3f;
	font-size: 20px;
	font-weight: bold;
	outline: 1px solid black;
	box-sizing: border-box;
}

.maps-scene-route-name {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	font-size: 8px;
	background: rgba(0, 0, 0, 0.8);
	color: var(--white);
	text-align: center;
	padding: 3px 0;
	opacity: 0;
	pointer-events: none;
	text-transform: uppercase;
}

.maps-scene-route:hover .maps-scene-route-name {
	opacity: 1;
}

.maps-scene-route-requires {
	position: absolute;
	top: 30px;
	left: 50%;
	transform: translate(-50%);
	font-size: 12px;
	line-height: 20px;
	color: #ebbe35;
	text-shadow: 1px 1px 1px black, -1px -1px 1px black;
}

.maps-scene-route-record-container {
	position: absolute;
	top: 0px;
	right: 0px;
	left: 0px;
	height: 12px;
	background: #2a2a2b;
	box-shadow: 0 1px 3px black;
}

.maps-scene-route-record {
	position: absolute;
	width: 100%;
	top: 2px;
	font-size: 9px;
	color: #ebbe35;
	text-align: center;
	text-shadow: 1px 1px black;
}

.msrre { 
	vertical-align: middle;
	position: relative;
	top: -4px; 
}


.maps-scene-editor-button {
	position: absolute;

	bottom: 30px;
	left: 50%;
	transform: translate(-50%);
	width: 250px;
	height: 40px;

	text-align: center;
	line-height: 42px;
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
	border-radius: 2px;
	
	color: var(--white);
	text-shadow: 1px 1px 0px black;
	outline: 1px solid black;

	box-shadow: 
		inset 1px 1px 0 rgba(255, 255, 255, 0.2), 
		inset -1px -2px 0 rgba(0, 0, 0, 0.3);

	cursor: pointer;
	transition: all 0.1s;
	image-rendering: pixelated;
	
	overflow: hidden;

	background: url("../assets/images/textures/texture3.png"), linear-gradient(180deg, #a33635 0%, #822b2a 100%);
}

.maps-scene-editor-button:hover {
	filter: brightness(1.15);
}