/**
 * Team Shay Arcade — mist-green inline sidebar styling.
 *
 * Primary: #2d8a56 | Background: #e9f2e4 | Text: #1e3a28
 */

/* Container */
.tsm-arcade {
	background: #e9f2e4;
	border: 2px solid #2d8a56;
	border-radius: 12px;
	padding: 12px;
	font-family: inherit;
	color: #1e3a28;
	max-width: 100%;
	box-sizing: border-box;
}

.tsm-arcade-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.tsm-arcade-emoji {
	font-size: 22px;
}

.tsm-arcade-collapse {
	background: #2d8a56;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.tsm-arcade-collapse:hover,
.tsm-arcade-collapse:focus {
	background: #236b44;
	outline: 2px solid #1e5c38;
	outline-offset: 2px;
}

.tsm-arcade-body[hidden] {
	display: none;
}

/* Game buttons */
.tsm-game-buttons {
	display: flex;
	gap: 6px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.tsm-game-btn {
	flex: 1 1 auto;
	background: #fff;
	border: 2px solid #2d8a56;
	border-radius: 8px;
	color: #1e5c38;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.tsm-game-btn:hover {
	background: #d4e8cc;
}

.tsm-game-btn.tsm-active {
	background: #2d8a56;
	color: #fff;
}

.tsm-game-btn:focus-visible {
	outline: 2px solid #1e5c38;
	outline-offset: 2px;
}

/* Game area */
.tsm-game-area {
	background: #fff;
	border: 1px solid #b8d5b0;
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 12px;
	min-height: 180px;
	text-align: center;
}

.tsm-game-status {
	font-size: 14px;
	font-weight: 600;
	color: #1e5c38;
	margin: 0 0 10px;
}

/* Buttons */
.tsm-btn {
	background: #2d8a56;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	margin: 4px;
}

.tsm-btn:hover:not(:disabled) {
	background: #236b44;
}

.tsm-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tsm-btn-secondary {
	background: #7ba889;
}

.tsm-btn-secondary:hover {
	background: #648f72;
}

.tsm-btn-row {
	margin-top: 8px;
}

/* Tic-Tac-Toe */
.tsm-ttt-grid {
	display: grid;
	grid-template-columns: repeat(3, 64px);
	grid-template-rows: repeat(3, 64px);
	gap: 6px;
	justify-content: center;
	margin-bottom: 10px;
}

.tsm-ttt-cell {
	background: #f4faf2;
	border: 2px solid #2d8a56;
	border-radius: 8px;
	font-size: 28px;
	font-weight: 700;
	color: #1e5c38;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tsm-ttt-cell:hover:not(:disabled) {
	background: #d4e8cc;
}

.tsm-ttt-cell:disabled {
	cursor: default;
}

/* Snake */
.tsm-snake-canvas {
	border: 2px solid #2d8a56;
	border-radius: 8px;
	max-width: 100%;
	height: auto;
	touch-action: none;
}

/* Pac-Man */
.tsm-pacman-canvas {
	border: 2px solid #2d8a56;
	border-radius: 8px;
	max-width: 100%;
	height: auto;
	touch-action: none;
	display: block;
	margin: 0 auto;
}

.tsm-dpad {
	display: grid;
	grid-template-columns: repeat(3, 44px);
	grid-template-rows: repeat(2, 44px);
	gap: 4px;
	justify-content: center;
	margin: 10px auto 4px;
}
.tsm-dpad-btn {
	width: 44px;
	height: 44px;
	font-size: 18px;
	background: #e8f4ec;
	border: 2px solid #2d8a56;
	border-radius: 8px;
	cursor: pointer;
	color: #1e5c38;
}
.tsm-dpad-btn:nth-child(1) { grid-column: 2; grid-row: 1; }
.tsm-dpad-btn:nth-child(2) { grid-column: 1; grid-row: 2; }
.tsm-dpad-btn:nth-child(3) { grid-column: 2; grid-row: 2; }
.tsm-dpad-btn:nth-child(4) { grid-column: 3; grid-row: 2; }
.tsm-dpad-btn:active {
	background: #2d8a56;
	color: #fff;
}

/* Clicker */
.tsm-clicker-btn {
	background: #2d8a56;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 120px;
	height: 120px;
	font-size: 20px;
	font-weight: 700;
	cursor: pointer;
	margin: 12px auto;
	display: block;
	transition: transform 0.08s ease;
}

.tsm-clicker-btn:hover {
	background: #236b44;
}

.tsm-clicker-btn:active {
	transform: scale(0.93);
}

/* Leaderboard */
.tsm-scores {
	background: #fff;
	border: 1px solid #b8d5b0;
	border-radius: 8px;
	padding: 10px 12px;
}

.tsm-scores-title {
	font-size: 14px;
	font-weight: 700;
	color: #1e5c38;
	margin: 0 0 8px;
}

.tsm-score-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 160px;
	overflow-y: auto;
}

.tsm-score-row {
	display: flex;
	gap: 8px;
	align-items: baseline;
	padding: 4px 0;
	border-bottom: 1px dashed #d4e8cc;
	font-size: 13px;
}

.tsm-score-row:last-child {
	border-bottom: none;
}

.tsm-score-rank {
	color: #2d8a56;
	font-weight: 700;
	min-width: 24px;
}

.tsm-score-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tsm-score-val {
	font-weight: 700;
	color: #1e5c38;
}

.tsm-score-loading,
.tsm-score-empty {
	color: #7ba889;
	font-style: italic;
	font-size: 13px;
}

/* Responsive: full width on small screens */
@media (max-width: 480px) {
	.tsm-ttt-grid {
		grid-template-columns: repeat(3, 56px);
		grid-template-rows: repeat(3, 56px);
	}

	.tsm-clicker-btn {
		width: 100px;
		height: 100px;
		font-size: 17px;
	}
}

/* iPad / touch targets — 44px minimum on interactive controls */
.tsm-game-btn {
	min-height: 44px;
}

.tsm-arcade-collapse {
	width: 44px;
	height: 44px;
}

.tsm-btn {
	min-height: 44px;
}
