/* Пиратский Остров — стили */

/* === Корабль === */
.ship-marker {
	position: absolute;
	width: 20px; height: 20px;
	border-radius: 4px;
	border: 2px solid #fff;
	text-align: center;
	font-size: 10px; line-height: 20px; font-weight: bold;
	color: #000; z-index: 30;
	pointer-events: none;
	box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.ship-marker::after {
	content: '⛵'; font-size: 14px;
	position: absolute; top: -16px; left: 50%;
	transform: translateX(-50%);
}

/* === Монеты на клетке === */
.cell-coins {
	position: absolute; bottom: 2px; left: 50%;
	transform: translateX(-50%);
	background: rgba(0,0,0,0.6); color: #ffd700;
	padding: 1px 4px; border-radius: 3px;
	font-size: 9px; font-weight: bold;
	pointer-events: none; z-index: 10; white-space: nowrap;
}

/* === Юнит пирата === */
.unit-marker {
	position: absolute;
	width: 16px; height: 16px;
	border-radius: 50%;
	border: 2px solid #fff;
	text-align: center;
	font-size: 8px; line-height: 16px; font-weight: bold;
	color: #000; z-index: 20;
	pointer-events: none;
	box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
.unit-marker.unit-cart { border-radius: 3px; }
.unit-marker.unit-missionary { border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.6); }
.unit-marker.unit-bengunn { border-color: #8B4513; }
.unit-marker.unit-captured { opacity: 0.5; border-style: dashed; }
.unit-marker.selected {
	box-shadow: 0 0 8px 3px rgba(255,255,0,0.8);
	animation: pulse-select 0.8s ease-in-out infinite;
}
@keyframes pulse-select {
	0%, 100% { box-shadow: 0 0 8px 3px rgba(255,255,0,0.8); }
	50% { box-shadow: 0 0 12px 5px rgba(255,255,0,1); }
}

/* Значок тачки рядом с маркером пирата */
.unit-cart-badge {
	position: absolute;
	width: 10px; height: 10px;
	z-index: 21;
	pointer-events: none;
	background: rgba(0,0,0,0.6);
	border-radius: 2px;
	padding: 1px;
	box-shadow: 0 0 2px rgba(0,0,0,0.7);
}
.unit-cart-badge img {
	width: 100%; height: 100%;
	display: block;
	image-rendering: -webkit-optimize-contrast;
}

/* Значок рома на маркере */
.unit-rum-badge {
	position: absolute;
	width: 10px; height: 10px;
	z-index: 21;
	pointer-events: none;
	background: rgba(160,82,45,0.85);
	border-radius: 2px;
	padding: 1px;
	box-shadow: 0 0 3px rgba(255,180,0,0.6);
}
.unit-rum-badge.pending {
	opacity: 0.5;
	animation: rum-blink 1s ease-in-out infinite;
}
@keyframes rum-blink {
	0%, 100% { opacity: 0.4; }
	50% { opacity: 0.8; }
}
.unit-rum-badge img {
	width: 100%; height: 100%;
	display: block;
}

/* === Счётчик болота === */
.swamp-label {
	position: absolute;
	background: rgba(80,50,0,0.85);
	color: #ffd;
	padding: 1px 4px; border-radius: 3px;
	font-size: 9px; font-weight: bold;
	pointer-events: none; z-index: 25;
	white-space: nowrap;
}

/* === Метка подзорной трубы === */
.spyglass-mark {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	font-size: 16px;
	pointer-events: none; z-index: 15;
	opacity: 0.85;
	text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* === Приватное раскрытие === */
.hex-cell.private-reveal img {
	opacity: 0.6;
	filter: sepia(0.3) brightness(1.2);
}
.hex-cell.private-reveal::after {
	content: '👁'; position: absolute;
	top: 2px; left: 2px; font-size: 10px;
	pointer-events: none; z-index: 15;
}

/* === Монеты на корабле === */
.ship-coins-display { color: #ffd700; font-weight: bold; }

/* === Лобби === */
.lobby-box h1 { color: #ffd700; }

/* === Настройки лобби === */
#settings-container { display: block; }
.settings-presets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.preset-btn {
	padding: 6px 16px; background: #2a5a3a; color: #7fa; border: 1px solid #4a8;
	border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: bold;
	transition: background 0.15s;
}
.preset-btn:hover { background: #3a7a4a; }
.settings-columns { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.settings-col { flex: 1 1 280px; min-width: 240px; }
.settings-col-full {
	width: 100%;
	display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: flex-start;
}
.settings-col-full > .setting-header { width: 100%; flex-shrink: 0; }
.settings-col-full > .setting-row {
	flex: 1 1 380px; min-width: 320px; max-width: 50%;
}
/* На узких экранах — одна колонка */
@media (max-width: 900px) {
	.settings-col-full > .setting-row { max-width: 100%; }
}
.setting-header {
	margin-top: 12px; margin-bottom: 4px;
	font-weight: bold; font-size: 14px;
	color: #ffd700;
	border-bottom: 1px solid #444;
	padding-bottom: 2px;
}
#settings-container .setting-row {
	display: flex; align-items: center;
	gap: 8px; padding: 4px 0;
	cursor: help;
}
#settings-container .setting-row label {
	flex: 1; color: #ccc; font-size: 13px;
}
#settings-container .setting-row input[type="number"],
#settings-container .setting-row select {
	padding: 3px 6px;
	background: #333; color: #fff;
	border: 1px solid #555; border-radius: 4px;
}
#settings-container .setting-row input[type="number"] { width: 60px; }
#settings-container .setting-row input[type="checkbox"] { width: 18px; height: 18px; }
.border-tiles-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.bt-item { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.bt-item img { width: 24px; height: 24px; display: block; margin: 0 auto 1px; }
.bt-label { font-size: 10px; color: #aaa; }
.bt-input { width: 42px !important; text-align: center; }
.bt-sum { font-size: 12px; font-weight: bold; margin-left: 8px; }

/* === Кнопка рома === */
.btn-rum {
	background: #8B4513 !important;
	color: #ffd !important;
	border-color: #A0522D !important;
}
.btn-rum:hover { background: #A0522D !important; }

/* === Окна "Клетки Острова" / "Клетки Моря" === */
.zc-summary {
	padding: 4px 8px; font-size: 12px; color: #ccc;
	border-bottom: 1px solid #333;
}
.zc-rem { color: #f80; }
/* --zc-size управляется колёсиком мыши через JS (default 48px) */
.zc-grid {
	display: flex; flex-wrap: wrap; gap: 4px;
	padding: 6px;
	align-content: flex-start;
}
.zc-item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: default;
	width: calc(var(--zc-size, 48px) + 4px);
}
.zc-tile-img {
	width: var(--zc-size, 48px);
	height: calc(var(--zc-size, 48px) * 1.15);
	object-fit: contain;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
}
.zc-count {
	position: absolute; bottom: 0; right: 0;
	background: rgba(0,0,0,0.75); color: #fff;
	font-size: max(9px, calc(var(--zc-size, 48px) * 0.16));
	font-weight: bold;
	padding: 0 2px; border-radius: 3px;
	line-height: 1.4;
	min-width: 14px; text-align: center;
}
.zc-empty {
	padding: 12px; color: #888; font-size: 12px; text-align: center;
}

/* === Предметы на клетках === */
.cell-item {
	position: absolute;
	width: 14px; height: 14px;
	z-index: 12;
	pointer-events: auto;
}
.cell-item-img {
	width: 100%; height: 100%;
	object-fit: contain;
	image-rendering: pixelated;
}
.cell-item[style*="cursor: pointer"]:hover {
	filter: brightness(1.5);
	transform: scale(1.2);
}

/* === Инвентарь юнита в панели действий === */
.unit-inventory {
	display: flex; align-items: center; gap: 4px;
	padding: 4px 6px; margin-top: 4px;
	background: rgba(255,255,255,0.05);
	border-radius: 4px; flex-wrap: wrap;
}
.inv-label { font-size: 11px; color: #aaa; margin-right: 4px; }
.inv-item {
	width: 22px; height: 22px; object-fit: contain;
	border-radius: 3px; border: 1px solid #444;
	background: rgba(0,0,0,0.3);
}
.inv-clickable {
	cursor: pointer; border-color: #888;
}
.inv-clickable:hover {
	border-color: #ffd700; filter: brightness(1.3);
	transform: scale(1.1);
}

/* === Панель игроков === */
.player-card {
	background: #2a2a2a; border: 2px solid #444; border-radius: 6px;
	padding: 3px 7px; margin-bottom: 2px; transition: background 0.3s, border-color 0.3s;
}
.player-card.current-turn {
	border-width: 3px;
	background: color-mix(in srgb, var(--player-color, #4a4) 18%, #1a2a1a);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--player-color, #4a4) 40%, transparent),
		0 0 8px color-mix(in srgb, var(--player-color, #4a4) 25%, transparent);
}
.player-card.is-me { background: #2a2a3a; }
.player-card.current-turn.is-me { background: color-mix(in srgb, var(--player-color, #4a4) 22%, #1a1a2a); }
.player-header { display: flex; align-items: center; gap: 4px; font-size: 12px; flex-wrap: wrap; }
.player-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.player-ship-line { font-size: 11px; color: #aaa; margin: 1px 0; }
.player-inventory { margin-top: 2px; display: flex; flex-direction: column; gap: 1px; }
.pirate-inv-row {
	display: flex; align-items: center; gap: 3px;
	padding: 1px 2px; border-radius: 3px; font-size: 11px; color: #ccc;
}
.pirate-inv-row.pirate-row-selected { background: rgba(255,220,50,0.13); }
.pirate-letter {
	display: inline-block; width: 14px; height: 14px; line-height: 14px;
	text-align: center; border-radius: 3px; font-size: 10px; font-weight: bold;
	color: #000; flex-shrink: 0;
}
.pirate-pos { font-size: 10px; color: #777; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === Статусы пиратов в панели === */
.rum-badge { font-size: 10px; vertical-align: super; }
.pirate-pos { font-size: 10px; color: #888; margin: 0 2px; }
.pirate-row-selected { background: rgba(255,220,50,0.12); border-radius: 3px; }
.player-ship-line { font-size: 11px; color: #aaa; margin-top: 1px; }
.player-eliminated { opacity: 0.5; }
