/* Master Runes D92 - houses browser, house detail and bidding (houses.php, house.php, My account widget).
   Brand tokens: brand-tokens.css. Mobile first (360 px), 44 px touch targets, prefers-reduced-motion. */
.tp-houses { --h-gap: 16px; display: grid; gap: var(--h-gap); color: var(--brand-text-soft); min-width: 0; }
.tp-houses h1, .tp-houses h2 { font-family: var(--brand-font-display); color: var(--brand-text); margin: 0; letter-spacing: .02em; }
.tp-houses h1 { font-size: clamp(24px, 6vw, 34px); }
.tp-houses h2 { font-size: 19px; margin-bottom: 10px; }
.tp-houses a { color: var(--brand-accent); }
.tp-houses a:hover { color: var(--brand-accent-hover); }
.tp-houses :focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; border-radius: 4px; }
.tp-houses .tp-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.tp-houses .tp-btn--sm { min-height: 40px; }
.tp-h-muted { color: var(--brand-text-muted); font-size: 13.5px; }
.tp-h-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hero + rules */
.tp-h-hero { display: grid; gap: 12px; background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); padding: 18px; box-shadow: var(--brand-shadow-md); }
.tp-h-hero p { margin: 6px 0 0; }
.tp-h-rules { background: rgb(var(--brand-bg-rgb) / .55); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-md); padding: 0 14px; }
.tp-h-rules summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--brand-text); }
.tp-h-rules ul { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }

/* alerts + pills */
.tp-h-alert { margin: 0; padding: 12px 14px; border-radius: var(--brand-radius-md); border: 1px solid var(--brand-border); background: var(--brand-surface-2); line-height: 1.45; }
.tp-h-alert--ok { border-color: rgb(var(--brand-success-text-rgb) / .5); background: rgb(var(--brand-success-rgb) / .22); color: var(--brand-success-text); }
.tp-h-alert--warn { border-color: rgb(var(--brand-premium-rgb) / .55); background: rgb(var(--brand-premium-rgb) / .12); color: var(--brand-warning-text); }
.tp-h-alert--err { border-color: rgb(var(--brand-danger-rgb) / .55); background: rgb(var(--brand-danger-rgb) / .12); color: var(--brand-danger-text); }
.tp-h-alert--info { border-color: rgb(var(--brand-info-rgb) / .45); background: rgb(var(--brand-info-rgb) / .08); color: var(--brand-text); }
.tp-h-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--brand-radius-pill); font-size: 12px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--brand-border-strong); background: var(--brand-surface-3); color: var(--brand-text); white-space: nowrap; }
.tp-h-pill--free { border-color: rgb(var(--brand-info-rgb) / .5); color: var(--brand-info); }
.tp-h-pill--auction, .tp-h-pill--lead { border-color: rgb(var(--brand-accent-rgb) / .6); color: var(--brand-accent); background: rgb(var(--brand-accent-rgb) / .1); }
.tp-h-pill--ending { border-color: rgb(var(--brand-premium-rgb) / .6); color: var(--brand-warning-text); }
.tp-h-pill--rented { color: var(--brand-text-muted); }
.tp-h-pill--outbid { border-color: rgb(var(--brand-danger-rgb) / .6); color: var(--brand-danger-text); }

/* my bids strip */
.tp-h-mine { border: 1px solid rgb(var(--brand-accent-rgb) / .35); border-radius: var(--brand-radius-lg); padding: 14px 16px; background: rgb(var(--brand-accent-rgb) / .05); }
.tp-h-mine__list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.tp-h-mine__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tp-h-mine p { margin: 0; }

/* filters */
.tp-h-filters { display: grid; grid-template-columns: 1fr; gap: 12px; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); padding: 14px; }
.tp-h-field { display: grid; gap: 5px; min-width: 0; }
.tp-h-field label, .tp-h-amount label { font-size: 12.5px; font-weight: 600; color: var(--brand-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.tp-houses input[type="text"], .tp-houses input[type="search"], .tp-houses input[type="number"], .tp-houses input[type="password"], .tp-houses select {
	width: 100%; min-height: 44px; box-sizing: border-box; padding: 9px 12px; font: inherit; font-size: 16px; color: var(--brand-text);
	background: var(--brand-bg-deep); border: 1px solid var(--brand-border-strong); border-radius: var(--brand-radius-md); }
.tp-houses input:focus, .tp-houses select:focus { border-color: var(--brand-accent); box-shadow: var(--brand-shadow-glow); outline: none; }
.tp-houses input[aria-invalid="true"] { border-color: var(--brand-danger); }
.tp-h-more summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; color: var(--brand-accent); font-weight: 600; }
.tp-h-more__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 6px; }
.tp-h-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.tp-h-check input { width: 20px; height: 20px; accent-color: var(--brand-accent); }
.tp-h-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tp-h-view { display: inline-flex; margin-left: auto; border: 1px solid var(--brand-border-strong); border-radius: var(--brand-radius-md); overflow: hidden; }
.tp-h-view__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; color: var(--brand-text-muted) !important; text-decoration: none; }
.tp-h-view__btn svg { width: 18px; height: 18px; fill: currentColor; }
.tp-h-view__btn[aria-pressed="true"] { background: rgb(var(--brand-accent-rgb) / .16); color: var(--brand-accent) !important; }
.tp-h-count { margin: 0; font-weight: 600; color: var(--brand-text); }

/* results */
.tp-h-results { display: grid; gap: 14px; }
.tp-h-results.is-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tp-h-card { position: relative; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tp-h-card:hover, .tp-h-card:focus-within { border-color: var(--brand-accent-strong); transform: translateY(-2px); box-shadow: var(--brand-shadow-md); }
.tp-h-card[data-status="auction"] { border-color: rgb(var(--brand-accent-rgb) / .45); }
.tp-h-card__link { display: grid; text-decoration: none; color: inherit !important; height: 100%; }
.tp-h-card__map { display: block; aspect-ratio: 4 / 3; background: var(--brand-bg-deep); border-bottom: 1px solid var(--brand-border); }
.tp-h-card__map img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.tp-h-card__body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.tp-h-card__title { font-weight: 700; color: var(--brand-text); font-size: 15.5px; line-height: 1.3; padding-right: 36px; }
.tp-h-card__town { font-size: 13px; color: var(--brand-text-muted); }
.tp-h-card__facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.tp-h-card__status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.tp-h-card__bid { color: var(--brand-text); }
.tp-h-results.is-list { grid-template-columns: 1fr; gap: 8px; }
.tp-h-results.is-list .tp-h-card__link { grid-template-columns: 88px 1fr; align-items: center; }
.tp-h-results.is-list .tp-h-card__map { border-bottom: 0; border-right: 1px solid var(--brand-border); height: 100%; }
.tp-h-results.is-list .tp-h-card__body { padding: 10px 12px; gap: 4px; }
.tp-h-empty { padding: 24px; text-align: center; color: var(--brand-text-muted); grid-column: 1 / -1; }
.tp-h-star { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border-radius: var(--brand-radius-pill); border: 1px solid var(--brand-border-strong); background: rgb(var(--brand-bg-rgb) / .82); color: var(--brand-text-muted); cursor: pointer; }
.tp-h-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tp-h-star[aria-pressed="true"] { color: var(--brand-accent); border-color: var(--brand-accent-strong); }
.tp-h-star[aria-pressed="true"] svg { fill: currentColor; }
.tp-h-results.is-list .tp-h-star { top: 50%; transform: translateY(-50%); }
.tp-h-star--inline { position: static; width: auto; padding: 0 14px; font: inherit; font-size: 14px; }
.tp-h-pages { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tp-h-more-wrap { display: flex; justify-content: center; }
.tp-h-more-wrap[hidden], .tp-h-pages[hidden], [data-role="apply"][hidden] { display: none; }

/* detail */
.tp-h-crumbs { font-size: 13.5px; color: var(--brand-text-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.tp-house__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tp-h-watchform { margin: 0 0 0 auto; }
.tp-house__top { display: grid; gap: var(--h-gap); }
.tp-house__map { margin: 0; background: var(--brand-bg-deep); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); overflow: hidden; }
.tp-house__map img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tp-house__map figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; font-size: 12.5px; color: var(--brand-text-muted); }
.tp-house__nomap { padding: 40px; text-align: center; color: var(--brand-text-muted); }
.tp-h-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.tp-h-key--house { background: #e0b249; box-shadow: inset 0 0 0 2px #ffd278; }
.tp-h-key--door { background: #ea4242; border-radius: 50%; margin-left: 8px; }
.tp-house__facts, .tp-house__stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tp-house__facts > div, .tp-house__stats > div { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-md); padding: 10px 12px; min-width: 0; }
.tp-house__facts dt, .tp-house__stats dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-text-muted); }
.tp-house__facts dd, .tp-house__stats dd { margin: 3px 0 0; color: var(--brand-text); font-weight: 600; overflow-wrap: anywhere; }
.tp-house__stat--big { grid-column: 1 / -1; }
.tp-house__stat--big dd { font-size: clamp(26px, 8vw, 36px); font-family: var(--brand-font-display); color: var(--brand-accent); }
.tp-house__stat--big small { font-size: 14px; color: var(--brand-text-muted); font-family: var(--brand-font-sans); }
.tp-h-countdown { display: block; font-size: 13px; font-weight: 700; color: var(--brand-warning-text); font-variant-numeric: tabular-nums; margin-top: 2px; }
.tp-house__auction, .tp-house__history { background: var(--brand-gradient-surface); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); padding: 16px; display: grid; gap: 12px; }
.tp-house__auction > p, .tp-house__history > p { margin: 0; }

/* bidding panel */
.tp-h-bid { display: grid; gap: 14px; }
.tp-h-chars { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.tp-h-chars legend, .tp-h-confirm legend { font-weight: 700; color: var(--brand-text); margin-bottom: 8px; padding: 0; }
.tp-h-char { display: grid; grid-template-columns: 24px 1fr; gap: 4px 10px; align-items: start; padding: 12px; border-radius: var(--brand-radius-md); border: 1px solid var(--brand-border-strong); background: var(--brand-bg-deep); cursor: pointer; }
.tp-h-char input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand-accent); }
.tp-h-char:has(input:checked) { border-color: var(--brand-accent); box-shadow: var(--brand-shadow-glow); }
.tp-h-char.is-blocked { cursor: not-allowed; opacity: .78; }
.tp-h-char__main { display: grid; gap: 2px; min-width: 0; }
.tp-h-char__main strong { color: var(--brand-text); }
.tp-h-char__bank { font-size: 13px; color: var(--brand-accent); }
.tp-h-char__why { grid-column: 2; margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--brand-danger-text); display: grid; gap: 2px; }
.tp-h-amount { display: grid; gap: 6px; }
.tp-h-amount input { font-size: 20px !important; font-variant-numeric: tabular-nums; }
.tp-h-amount p { margin: 0; }
.tp-h-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-h-quick[hidden] { display: none; }
.tp-h-msg { margin: 0; min-height: 1.4em; font-size: 14px; }
.tp-h-msg--ok { color: var(--brand-success-text); }
.tp-h-msg--err { color: var(--brand-danger-text); }
.tp-h-summary { padding: 12px 14px; border-radius: var(--brand-radius-md); border: 1px dashed rgb(var(--brand-accent-rgb) / .5); background: rgb(var(--brand-accent-rgb) / .06); line-height: 1.5; font-size: 14px; }
.tp-h-summary strong { color: var(--brand-text); }
.tp-h-confirm { border: 1px solid var(--brand-border); border-radius: var(--brand-radius-md); padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.tp-h-inline { display: flex; gap: 8px; }
.tp-h-inline input { flex: 1; min-width: 0; }
.tp-h-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0; border: 1px solid var(--brand-accent-strong); border-radius: var(--brand-radius-lg); background: var(--brand-surface); color: var(--brand-text-soft); box-shadow: var(--brand-shadow-lg); }
.tp-h-dialog::backdrop { background: rgb(0 0 0 / .7); }
.tp-h-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--brand-border); }
.tp-h-dialog__head h2 { margin: 0; font-family: var(--brand-font-display); color: var(--brand-text); font-size: 18px; }
.tp-h-dialog__x { width: 44px; height: 44px; border: 0; background: none; color: var(--brand-text-muted); font-size: 28px; cursor: pointer; border-radius: var(--brand-radius-md); }
.tp-h-dialog .tp-h-confirm { border: 0; border-radius: 0; padding: 16px; }
.tp-h-result:focus { outline: none; }

/* history */
.tp-h-tablewrap { overflow-x: auto; }
.tp-h-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-h-table th, .tp-h-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--brand-border); white-space: nowrap; }
.tp-h-table th { color: var(--brand-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tp-h-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tp-h-table tr.is-you td { color: var(--brand-accent); font-weight: 600; }

/* My account widget */
.tp-house-mine { display: grid; gap: 12px; }
.tp-house-mine h3 { margin: 6px 0 0; font-size: 15px; color: var(--brand-text); }
.tp-house-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tp-house-mine li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--brand-border); border-radius: var(--brand-radius-md); background: var(--brand-surface); }

@media (min-width: 700px) {
	.tp-h-hero { grid-template-columns: 1fr; padding: 22px 24px; }
	.tp-h-filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
	.tp-h-filters .tp-h-more, .tp-h-filters .tp-h-actions { grid-column: 1 / -1; }
	.tp-h-more__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.tp-house__top { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
	.tp-house__facts { grid-template-columns: 1fr 1fr; }
	.tp-house__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.tp-house__stat--big { grid-column: auto; }
	.tp-h-results.is-list .tp-h-card__link { grid-template-columns: 120px 1fr; }
	.tp-h-results.is-list .tp-h-card__body { grid-template-columns: 2fr 1fr 2fr; align-items: center; padding-right: 60px; }
}
@media (max-width: 420px) {
	.tp-h-view__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.tp-h-view { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.tp-h-card, .tp-houses .tp-btn { transition: none; }
	.tp-h-card:hover, .tp-h-card:focus-within { transform: none; }
	.tp-houses .tp-btn::after { animation: none !important; }
}
