/* Thủ thành · dùng chung /hai-sao/style.css, thêm phần riêng */
.tt { background: #1b2418; }
.tt #cv { touch-action: none; }
.tt .toasts { top: calc(env(safe-area-inset-top) + 104px); }

/* ---------- Thanh trên ---------- */
.tt-top {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 14px;
	height: calc(env(safe-area-inset-top) + 54px);
	padding: env(safe-area-inset-top) 10px 0 14px;
	background: linear-gradient(180deg, rgba(10, 9, 8, .94), rgba(10, 9, 8, .8));
	border-bottom: 1px solid var(--line);
}
.tt-top[hidden], .tt-bar[hidden], .tt-info[hidden], .tt-hint[hidden] { display: none; }
.tt-stat { display: flex; align-items: center; gap: 6px; color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.tt-stat b { font: 500 22px/1 var(--serif); }
.tt-stat svg { width: 17px; height: 17px; fill: #c9604a; stroke: none; }
.tt-stat.gold svg { fill: none; stroke: var(--gold-2); stroke-width: 1.8; }
.tt-stat.gold b { color: var(--gold-2); }
.tt-stat .lbl { color: var(--text-3); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.tt-stat.flash b { animation: ttFlash .5s var(--ease); }
@keyframes ttFlash { 0% { color: #e66e5a; transform: scale(1.25); } 100% { transform: none; } }
.tt-top-r { display: flex; gap: 8px; margin-left: auto; }
.tt-speed { width: auto; min-width: 44px; padding: 0 10px; font: 600 13px/1 var(--sans); color: var(--text); }
.tt-speed.on { border-color: var(--gold); color: var(--gold-2); }

/* ---------- Gợi ý nổi ---------- */
.tt-hint {
	position: absolute;
	left: 50%;
	top: calc(env(safe-area-inset-top) + 62px);
	z-index: 4;
	max-width: calc(100% - 24px);
	margin: 0;
	padding: 7px 14px;
	transform: translateX(-50%);
	border: 1px solid var(--line-strong);
	background: rgba(15, 14, 12, .92);
	color: var(--text-2);
	font-size: 12.5px;
	line-height: 1.4;
	text-align: center;
	pointer-events: none;
}
.tt-hint b { color: var(--gold-2); font-weight: 500; }

/* ---------- Thanh dưới ---------- */
.tt-bar, .tt-info {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 4;
	padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
	background: linear-gradient(0deg, rgba(10, 9, 8, .96), rgba(10, 9, 8, .86));
	border-top: 1px solid var(--line);
}
.tt-bar { display: grid; grid-template-columns: 1fr 78px; gap: 6px; height: calc(env(safe-area-inset-bottom) + 96px); }
.tt-build { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tt-tw, .tt-call {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	padding: 4px 2px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--text);
	font: 500 10.5px/1.15 var(--sans);
	cursor: pointer;
	transition: border-color .2s, background .2s, opacity .2s;
}
.tt-tw canvas { width: 40px; height: 40px; }
.tt-tw .nm { max-width: 100%; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.tt-tw .cost { display: flex; align-items: center; gap: 3px; color: var(--gold-2); font-weight: 600; font-variant-numeric: lining-nums; }
.tt-tw .cost svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
.tt-tw .key { position: absolute; top: 3px; left: 5px; color: var(--text-3); font-size: 9px; }
.tt-tw.on { border-color: var(--gold); background: #231d15; }
.tt-tw.poor { opacity: .45; }
.tt-tw.poor .cost { color: var(--warn); }
.tt-call { border-color: var(--gold); background: #231d15; color: var(--gold-2); font: 500 18px/1 var(--serif); }
.tt-call small { color: var(--text-2); font: 500 9.5px/1.2 var(--sans); letter-spacing: .06em; text-align: center; }
.tt-call:disabled { border-color: var(--line-strong); background: var(--surface); color: var(--text-3); cursor: default; }
.tt-call.pulse { animation: ttPulse 1.6s ease-in-out infinite; }
@keyframes ttPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 203, 142, 0); } 50% { box-shadow: 0 0 0 4px rgba(232, 203, 142, .18); } }
.tt-tw:hover:not(.poor), .tt-call:hover:not(:disabled) { border-color: var(--gold-2); }

/* Bảng tháp đang chọn */
.tt-info { min-height: calc(env(safe-area-inset-bottom) + 96px); animation: rise .25s var(--ease) both; }
.tt-info-head { display: grid; grid-template-columns: 44px 1fr 40px; align-items: center; gap: 10px; }
.tt-ico { width: 44px; height: 44px; }
.tt-info-name { margin: 0; font: 500 19px/1.1 var(--serif); }
.tt-info-name small { margin-left: 6px; color: var(--gold-2); font: 500 11px/1 var(--sans); letter-spacing: .1em; }
.tt-info-stats { margin: 3px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.35; }
.tt-info .close { position: static; margin: 0; }
.tt-info-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.tt-info-actions .btn { height: 44px; padding: 0 6px; font-size: 10.5px; letter-spacing: .08em; }
.tt-info-actions .btn:disabled { opacity: .45; cursor: default; }

/* ---------- Màn hình chọn bản đồ ---------- */
.tt-menu {
	justify-content: flex-start;
	overflow-y: auto;
	padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 20px);
	background: linear-gradient(180deg, rgba(10, 9, 8, .9) 0%, rgba(10, 9, 8, .72) 55%, rgba(10, 9, 8, .82) 100%);
	text-align: center;
}
.tt-menu-head { margin-top: 18px; }
.tt-menu .title { font-size: clamp(44px, 13vw, 60px); }
.tt-menu .title em { display: inline; }
.tt-menu .lead { margin-bottom: 14px; }
.tt-diff { width: 100%; max-width: 360px; }
.tt-maps { display: grid; gap: 10px; width: 100%; max-width: 360px; margin: 14px 0 16px; padding: 0; list-style: none; text-align: left; }
.tt-map {
	display: grid;
	grid-template-columns: 34px 1fr auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 13px 14px;
	border: 1px solid var(--line-strong);
	background: rgba(21, 19, 17, .92);
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color .2s, transform .2s var(--ease);
}
.tt-map:hover:not(:disabled) { border-color: var(--gold); }
.tt-map:active:not(:disabled) { transform: translateY(1px); }
.tt-map .no { color: var(--gold); font: italic 500 22px/1 var(--serif); }
.tt-map b { display: block; font: 500 20px/1.15 var(--serif); }
.tt-map small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12px; line-height: 1.4; }
.tt-map .st { display: flex; gap: 2px; }
.tt-map .st svg, .tt-stars svg { width: 15px; height: 15px; fill: var(--line-strong); }
.tt-map .st svg.on, .tt-stars svg.on { fill: var(--gold-2); }
.tt-map:disabled { cursor: default; opacity: .55; }
.tt-map .lock { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 1.6; }
.tt-menu-btns { width: 100%; max-width: 360px; }

.tt-stars { display: flex; justify-content: center; gap: 8px; margin: 14px 0 8px; }
.tt-stars svg { width: 34px; height: 34px; }
.tt-stars svg.on { animation: pop .5s var(--ease) both; }
.tt-stars svg:nth-child(2) { animation-delay: .15s; }
.tt-stars svg:nth-child(3) { animation-delay: .3s; }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.2); } 100% { transform: none; opacity: 1; } }
.stats { grid-template-columns: 1fr 1fr; }

.tt-h3 { margin: 18px 0 8px; font: 500 20px/1.2 var(--serif); }
.tt-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.tt-list li { margin-bottom: 6px; }
.tt-list b { color: var(--text); font-weight: 500; }
.small { font-size: 12px; }
