/* The market town (js/town.js): full-screen 3D, MMO-style HUD on top (unit frame, place name,
   minimap, chat, menu bar, place windows), name plates and floating place markers. */

.landing.town-mode { position: fixed; inset: 0; padding: 0; overflow: hidden; background: #0d0a07; }
.town-host, .town { position: absolute; inset: 0; }
.town > canvas:first-child { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.town-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.town-fade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle, #fff8e0, #f0d9a0 60%, #c9a24f); }

/* name plates and chat bubbles over heads */
.town-plate { position: absolute; left: 0; top: 0; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; white-space: nowrap; will-change: transform; }
.town-plate > b { translate: -50% -100%; position: absolute; font: 700 13.5px 'Alegreya', serif; color: color-mix(in srgb, var(--pc, #9fd0ff) 60%, #fff); text-shadow: 1px 1px 0 #000, 0 0 4px #000; }
.town-plate.own > b { color: #ffd76a; }
.tp-bubble { position: absolute; translate: -50% calc(-100% - 22px); width: max-content; max-width: 240px; white-space: normal; padding: 6px 10px; border-radius: 10px; font: 600 13px/1.3 'Alegreya', serif; color: #2b1f12;
	background: #f6ecd2; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); text-align: center; }
.tp-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; translate: -50% 0; border: 6px solid transparent; border-top-color: #f6ecd2; border-bottom: 0; }

/* floating place markers */
.town-poi { position: absolute; left: 0; top: 0; translate: -50% -100%; display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: auto; cursor: pointer; will-change: transform; }
.town-poi span { font-size: 26px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .7)); animation: poi-bob 2.4s ease-in-out infinite; }
.town-poi b { font: 800 13px 'Cinzel', serif; letter-spacing: .5px; color: #ffd76a; text-shadow: 1px 1px 0 #000, 0 0 5px #000; white-space: nowrap; }
.town-poi small { font: 600 11.5px 'Alegreya', serif; color: #f3e7cc; text-shadow: 1px 1px 0 #000, 0 0 4px #000; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.town-poi:hover small, .town-poi.near small { opacity: 1; }
.town-poi.near b { color: #fff3c0; }
@keyframes poi-bob { 50% { transform: translateY(-5px); } }

.town-minimap { position: absolute; top: 14px; right: 14px; width: 180px; height: 180px; border-radius: 50%; pointer-events: none;
	box-shadow: 0 0 0 3px #1a120a, 0 0 0 6px #c9a24f, 0 0 0 7px #1a120a, 0 8px 22px rgba(0, 0, 0, .55); }

/* HUD */
.town-hud { position: absolute; inset: 0; pointer-events: none; color: #f3e7cc; font-family: 'Alegreya', Georgia, serif; }
.town-hud > * { pointer-events: auto; }
.th-frame { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; --ps: 72px; }
.th-frame .uf-portrait { width: var(--ps); height: var(--ps); }
.th-who { margin-left: -16px; padding: 7px 14px 8px 26px; min-width: 210px; display: flex; flex-direction: column; gap: 2px; border-radius: 0 8px 8px 0;
	background: linear-gradient(180deg, rgba(22, 19, 15, .9), rgba(9, 8, 7, .9)); border: 1px solid #6b5530; border-left: 0; }
.th-who b { font: 800 16px 'Alegreya', serif; color: #ffd76a; text-shadow: 1px 1px 0 #000; }
.th-who > span { font-size: 12.5px; color: #d8c9a4; }
.uf-bar.xp > i { background: linear-gradient(180deg, #c27bff, #7a1fc8 55%, #4d0f86); }
.th-place { position: absolute; top: 18px; left: 50%; translate: -50% 0; font: 800 22px 'Cinzel', serif; letter-spacing: 3px; color: #ffd76a; text-shadow: 2px 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8); pointer-events: none; white-space: nowrap; }
.th-queue { position: absolute; top: 60px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 99px;
	background: rgba(9, 8, 7, .85); border: 1px solid #c9a24f; font-weight: 700; }
.th-prompt { position: absolute; bottom: 120px; left: 50%; translate: -50% 0; padding: 9px 18px; border-radius: 8px; font: 700 16px 'Alegreya', serif; white-space: nowrap;
	background: linear-gradient(180deg, rgba(22, 19, 15, .92), rgba(9, 8, 7, .92)); border: 1px solid #c9a24f; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); pointer-events: none; }
.th-prompt span { color: #b9ab8c; font-weight: 500; margin-left: 6px; }
.th-prompt kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 6px; border-radius: 4px; font: 800 13px 'Cinzel', serif; color: #1a1206; background: linear-gradient(180deg, #ffe08a, #c9a24f); }
.town-chat { position: absolute; left: 14px; bottom: 14px; width: min(380px, 42vw); height: 190px; }
.cf-line.say { color: #fff; }
.th-menu { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 5px; padding: 7px; border-radius: 8px; background: linear-gradient(180deg, #2c2721, #0d0b08); border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(201, 162, 79, .55), 0 8px 22px rgba(0, 0, 0, .5); }
.mm-btn.big { width: 42px; height: 42px; font-size: 21px; }
.th-help { position: absolute; bottom: 72px; right: 16px; font-size: 12px; color: #d8c9a4; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.th-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle, #2a2016, #0d0a07); font: 700 16px 'Cinzel', serif; color: #ffd76a; letter-spacing: 1px; }

/* place windows */
.th-panel { position: absolute; top: 50%; right: 210px; translate: 0 -50%; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 140px); display: flex; flex-direction: column; border-radius: 10px; color: #f3e7cc;
	background: linear-gradient(180deg, rgba(30, 24, 18, .97), rgba(12, 10, 8, .97)); border: 1px solid #000;
	box-shadow: inset 0 0 0 1px #c9a24f, inset 0 0 0 4px #120c06, inset 0 0 0 5px rgba(201, 162, 79, .35), 0 20px 50px rgba(0, 0, 0, .6); animation: tp-in .22s ease-out; }
@keyframes tp-in { from { opacity: 0; translate: 20px -50%; } }
.tp-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid rgba(201, 162, 79, .3); }
.tp-head > span { font-size: 26px; }
.tp-head h3 { flex: 1; margin: 0; font: 800 18px 'Cinzel', serif; color: #ffd76a; letter-spacing: 1px; }
.tp-head .x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #c9a24f; background: #2a1e12; color: #ffd76a; font-size: 20px; line-height: 1; cursor: pointer; }
.tp-body { padding: 14px 18px 18px; overflow-y: auto; }
.tp-body h4 { margin: 16px 0 8px; font: 700 13px 'Cinzel', serif; letter-spacing: 1.5px; color: #c9a24f; text-transform: uppercase; }
.tp-body .muted { color: #b9ab8c; }
.tp-actions { display: flex; flex-direction: column; gap: 8px; }
.tp-body .room-row, .tp-body [data-room] { color: #2b1f12; }
.tp-body .ranked-card h3 { display: none; }
.tp-body .rk-mode { color: #f3e7cc; }
.tp-body .rk-tabs button { color: #f3e7cc; }
.tp-body .rk-queue { background: rgba(0, 0, 0, .3); }
#hall-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hall-col h4 { margin-top: 0; }
.hall-col ol { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.hall-col li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; }

/* arriving at the board after the dive */
.app.arrive { animation: arrive 1.4s ease-out; }
@keyframes arrive { from { filter: brightness(3) saturate(.3); opacity: .2; } }

@media (max-width: 760px) {
	.town-minimap { width: 110px; height: 110px; top: 10px; right: 10px; }
	.th-place { top: 96px; font-size: 16px; }
	.th-frame { --ps: 54px; top: 10px; left: 10px; }
	.th-who { min-width: 150px; }
	.town-chat { width: calc(100vw - 20px); left: 10px; bottom: 70px; height: 120px; }
	.th-menu { left: 10px; right: 10px; bottom: 10px; justify-content: center; }
	.mm-btn.big { width: 38px; height: 38px; }
	.th-help { display: none; }
	.th-prompt { bottom: 200px; }
	.th-panel { right: 10px; left: 10px; width: auto; top: 10px; bottom: 10px; translate: none; max-height: none; }
	#hall-board { grid-template-columns: 1fr; }
}
