@font-face {
	font-family: 'Doto';
	src: url('./assets/Doto-Black.ttf') format('truetype');
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	user-select: none;
}

body {
	background-color: #121212;
	color: #ffffff;
	font-family: sans-serif;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* HEADER */
header {
	background: linear-gradient(145deg, #2b2b2b, #121212);
	font-family: 'Doto', monospace;
}

h1 {
	color: #aaa;
	font-family: sans-serif;
	padding: 0.25rem 0.5rem;
}

.header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

#app-version {
	font-size: 0.85rem;
}

.lcd-screen {
	background-color: #9ea792;
	padding: 0.6rem 0.75rem;
	border-radius: 0.5rem;
	box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1);
	position: relative;
	overflow: hidden;
	border: 0.25rem solid #111;
	margin: 0 0.3rem;
}

.lcd-content {
	color: #1a1a1a;
	text-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

/* título / arquivos / info --- */
.header-top {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.load-zone {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex: 1;
	min-width: 0;
}

.style-selector {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex: 1;
	min-width: 0;
}

.style-selector select {
	font-size: 1rem;
	color: #1a1a1a;
	text-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	font-family: 'Doto', monospace;
	background: transparent;
	border: none;
	padding: 0;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.load-btn {
	font-size: 0.75rem;
	font-family: 'Doto', monospace;
	color: #1a1a1a;
	background: rgba(0,0,0,0.12);
	border: 1px solid rgba(0,0,0,0.25);
	border-radius: 0.25rem;
	padding: 0.15rem 0.4rem;
	white-space: nowrap;
	cursor: pointer;
	flex-shrink: 0;
}

.load-btn:active {
	background: rgba(0,0,0,0.25);
}

.info-btn {
	font-size: 1rem;
	font-family: 'Doto', monospace;
	color: #1a1a1a;
	background: rgba(0,0,0,0.12);
	border: 1px solid rgba(0,0,0,0.25);
	border-radius: 0.25rem;
	cursor: pointer;
	padding: 0 0.5rem;
	flex-shrink: 0;
}

/* --- STATUS BAR --- */
.status-bar {
	font-size: 0.85rem;
	opacity: 0.8;
	border-top: 1px solid rgba(0,0,0,0.15);
	border-bottom: 1px solid rgba(0,0,0,0.15);
	padding: 0.15rem 0;
}

/* transporte / performance */
.transport-zone {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	justify-content: space-between;
}

.transport-label {
	font-size: 0.6rem;
	opacity: 0.8;
	display: block;
	margin-bottom: 0.1rem;
	letter-spacing: 0.05em;
}

/* BPM */
.bpm-block {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.bpm-controls {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.bpm-controls button {
	font-size: 1rem;
	color: #1a1a1a;
	font-family: 'Doto', monospace;
	background: transparent;
	border: 1px solid rgba(0,0,0,0.15);
	border-radius: 0.25rem;
	cursor: pointer;
	padding: 0.65rem 0.25rem 0.65rem 0.3rem;
	line-height: 1;
}

.bpm-controls input {
	width: 3.5rem;
	color: #1a1a1a;
	text-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	font-family: 'Doto', monospace;
	font-size: 1.1rem;
	text-align: center;
	background: transparent;
	border: none;
	padding: 0;
}

/* Beat indicator */
.tap-tempo-block {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.indicator {
	font-size: 2rem;
	cursor: pointer;
	padding: 0 0.5rem;
	border: 1px solid rgba(0,0,0,0.15);
	border-radius: 0.25rem;
	padding: 0 0.3rem 0 0.5rem;
}

/* Gravação (no header, ao lado do título) */
.header-record-block {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding-right: 0.5rem;
	flex-shrink: 0;
}

.rec-btn, .rec-play-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
	font-family: 'Doto', monospace;
	background: transparent;
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 0.25rem;
	cursor: pointer;
	padding: 0.35rem;
	line-height: 1;
}

.rec-btn {
	color: #e57373;
	border-color: rgba(229,115,115,0.4);
}

.rec-btn.recording {
	background: #c62828;
	color: #fff;
	border-color: #c62828;
	animation: pulse-rec 1s infinite;
}

.rec-btn.armed {
	background: transparent;
	color: #e57373;
	border-color: #c62828;
	animation: pulse-armed 0.6s infinite;
}

@keyframes pulse-armed {
	0%   { box-shadow: 0 0 2px #c62828; border-color: #c62828; }
	50%  { box-shadow: 0 0 2px transparent; border-color: rgba(198,40,40,0.3); }
	100% { box-shadow: 0 0 2px #c62828; border-color: #c62828; }
}

@keyframes pulse-rec {
	0%   { box-shadow: 0 0 4px #c62828; }
	50%  { box-shadow: 0 0 12px #ff5252; }
	100% { box-shadow: 0 0 4px #c62828; }
}

.rec-play-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.rec-play-btn.playing {
	background: #2e7d32;
	color: #fff;
	border-color: #2e7d32;
}

/* Volume */
.volume-block {
	display: flex;
	flex-direction: column;
}

#volume-slider-rhythm, #volume-slider-sub {
	-webkit-appearance: none;
	appearance: none;
	width: 4rem;
	height: 4px;
	border-radius: 2px;
	background: #2c2c2c;
	box-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	outline: none;
	cursor: pointer;
	margin: 0.2rem 0;
}

#volume-slider-rhythm::-webkit-slider-thumb, #volume-slider-sub::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #2c2c2c;
	box-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	cursor: pointer;
}

#volume-slider-rhythm::-moz-range-thumb, #volume-slider-sub::-moz-range-thumb {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #1a1a1a;
	border: none;
	cursor: pointer;
}

/* Quantização */
.quant-block {
	display: flex;
	flex-direction: column;
}

.quant-block select {
	font-size: 0.85rem;
	color: #1a1a1a;
	text-shadow: 0 0 3px rgba(26, 26, 26, 0.4);
	font-family: 'Doto', monospace;
	background: transparent;
	border: none;
	padding: 0;
}

/* GRADE */
.grid-container {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(5, 1fr);
	gap: 0.5rem;
	padding: 0.5rem;
	min-height: 0;
}

.intro-btn  { background: #ff6f00; color: white; }
.main-btn   { background: #1565c0; color: white; }
.fill-btn   { background: #00838f; color: white; }
.break-btn  { background: #c62828; color: white; }
.ending-btn { background: #4527a0; color: white; }

.btn {
	border: none;
	border-radius: 0.5rem;
	font-weight: bold;
	font-size: 0.9rem;
	transition: transform 0.1s, box-shadow 0.1s;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2rem;
}
 
.bar-counter {
	font-size: 0.75rem;
	font-weight: normal;
	opacity: 0.75;
	font-family: monospace;
	letter-spacing: 0.02em;
	line-height: 1;
}
 
.btn:active {
	transform: translateY(4px);
	box-shadow: 0 0 #000;
}
 
.btn.active {
	border: 3px solid #ffffff;
	box-shadow: 0 0 15px #ffffff;
}

.btn:disabled,
.btn.section-missing {
	opacity: 0.25;
	filter: grayscale(0.6);
	cursor: not-allowed;
	box-shadow: none;
}

.btn:disabled:active {
	transform: none;
}


/* FILA DE ESPERA */
@keyframes pulse-queued {
	0%   { box-shadow: 0 0 5px #ffeb3b;  border-color: #ffeb3b; }
	50%  { box-shadow: 0 0 15px #ffeb3b; border-color: #fff176; }
	100% { box-shadow: 0 0 5px #ffeb3b;  border-color: #ffeb3b; }
}

.btn.queued {
	border: 3px solid #ffeb3b;
	animation: pulse-queued 1s infinite;
}

/* DEBUG MODAL */
.debug-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.debug-content {
	background: #1a1a1a;
	border-radius: 8px;
	padding: 20px;
	width: 90%;
	max-width: 800px;
	max-height: 80vh;
	overflow-y: auto;
	position: relative;
	font-family: monospace;
}

.debug-content h2 {
	color: #aaa;
	padding-bottom: 1rem;
}

.close-btn {
	position: absolute;
	right: 1rem;
	background: #aaa;
	color: #111;
	border: none;
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1rem;
	cursor: pointer;
	padding: 0;
}

#debug-info {
	white-space: pre-wrap;
}

.play-btn {
	background: #555 !important;
	border: none;
	border-radius: 0.5rem;
	font-weight: bold;
	font-size: 1rem;
	transition: transform 0.1s, box-shadow 0.1s;
	cursor: pointer;
}

.play-btn.playing {
	background: #555 !important;
}