/* © 2026 Ardent Realty Group, LLC. All rights reserved. */
/* Uptown Heirs Online — mobile-first layout on top of the offline styles (style.css). */
body { font-size: 17px; -webkit-text-size-adjust: 100%; }
.hidden { display: none !important; }
.screen { min-height: 100vh; }
input, select, button { font: inherit; }
input[type=text], input:not([type]), input[type=number], select { font-size: 17px; padding: .55em .7em; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 48px; }
.btn { min-height: 48px; touch-action: manipulation; }
.btn.full { width: 100%; }
.choice { min-height: 46px; padding: .4em .8em; touch-action: manipulation; }
.choice small { display: block; font-size: .72em; font-weight: 500; opacity: .85; }
.err { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: .4em 0 0; }
.tag { background: #eee3c4; border-radius: 6px; padding: 0 .35em; font-size: .8em; font-weight: 700; }

/* home */
.ol-hero { background: linear-gradient(135deg, #22304a, #1f8a83); color: #fff; padding: 28px 18px 22px; text-align: center; }
.ol-hero h1 { font-size: 2rem; margin: 0 0 .3em; } .ol-hero h1 span { color: var(--gold); }
.ol-hero p { margin: 0 auto; max-width: 640px; opacity: .92; }
.ol-cards { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; padding: 16px; max-width: 1100px; margin: 0 auto; }
.ol-form { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.ol-form h2 { margin: 0; }
.ol-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.ol-form .field { display: flex; flex-direction: column; gap: 6px; }
.ol-form .btn-row { flex-wrap: wrap; gap: 8px; align-items: center; }
.ol-foot { text-align: center; color: var(--muted); padding: 0 16px 30px; }
#jCode { text-transform: uppercase; letter-spacing: .25em; font-weight: 800; font-size: 1.3rem; }
@media (min-width: 900px) { .ol-cards { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); align-items: start; } }

/* global top 5 */
.top5 { max-width: 1100px; margin: 14px auto 0; background: #fff7df; border: 2px solid var(--gold); border-radius: 14px; padding: 10px 14px; font-size: .95rem; }
.top5 ol { margin: .3em 0 0; padding-left: 1.4em; display: grid; gap: 2px 18px; }
.top5 .amt { float: right; font-weight: 800; color: var(--good); }
.top5.pinned { margin: 0; border-radius: 0; border-width: 0 0 2px; max-width: none; }
@media (min-width: 900px) { .top5 ol { grid-template-columns: repeat(5, 1fr); } .top5 .amt { float: none; display: block; } }

/* lobby */
#lobby.active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; max-width: 1000px; margin: 0 auto; }
@media (min-width: 900px) { #lobby.active { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.ol-lobby, .ol-lobby-chat { padding: 18px; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .2em; background: #22304a; color: #fff; padding: .1em .45em; border-radius: 10px; }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .share input { flex: 1 1 220px; min-width: 0; }
.seats { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.seats li { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .5em .8em; }
.seats li.empty { color: var(--muted); border-style: dashed; }

/* game layout: mobile first = one column (wheel, action, side tabs, map) */
.ol-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #22304a; color: #fff; flex-wrap: wrap; padding-top: max(6px, env(safe-area-inset-top)); }
.ol-top .brand { font-size: 1.3rem; }
.ol-top .pill { background: rgba(255,255,255,.14); border-radius: 999px; padding: .2em .7em; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.ol-top .pill .sub { color: #cfd8e6; }
.ol-top .spacer { flex: 1; }
.ol-top .btn.small { min-height: 38px; padding: .2em .6em; }
.banner { background: #3b3f6b; color: #fff; padding: 10px 14px; font-size: 1rem; text-align: center; }
.ol-main { display: flex; flex-direction: column; gap: 12px; padding: 10px; }
.ol-left { display: contents; }
.ol-play { display: flex; flex-direction: column; gap: 12px; order: 1; }
.ol-side { order: 2; padding: 0; overflow: hidden; }
.map-card { order: 3; padding: 10px; }
.wheel-card { padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wheel-wrap { width: min(88vw, 400px); }
#wheel { width: 100%; height: auto; aspect-ratio: 1; display: block; }
.spin { width: 100%; max-width: 420px; }
.result-card { padding: 14px; min-height: 120px; }
.result-card h2 { margin-top: 0; font-size: 1.2rem; }
.res-head img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; }
.res-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.stats { grid-template-columns: repeat(3, 1fr); }
.buy-grid.wide { grid-template-columns: 1fr 1fr; }
.result-actions { flex-wrap: wrap; } .result-actions .btn { flex: 1 1 160px; }
.event-res { display: flex; gap: 10px; } .event-res .big-icon { font-size: 2.6rem; }
.map-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; } .map-tools .spacer { flex: 1; }
.map-scroll { overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; touch-action: pan-x pan-y pinch-zoom; }
#map { width: 100%; min-width: 640px; }
@media (min-width: 700px) { #map { min-width: 0; } }
.tdetail { margin-top: 8px; }

/* side tabs */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #efe5cf; position: sticky; top: 0; }
.tabs button { border: 0; background: transparent; padding: 14px 4px; font-weight: 800; color: var(--muted); min-height: 52px; border-bottom: 4px solid transparent; position: relative; }
.tabs button.on { color: var(--ink); background: var(--card); border-bottom-color: var(--gold); }
.badge-n { background: var(--bad); color: #fff; border-radius: 999px; font-size: .7rem; padding: .05em .45em; vertical-align: top; }
.tab { display: none; padding: 12px; } .tab.on { display: block; }
.tablewrap { overflow-x: auto; }
.board { width: 100%; font-size: .9rem; }
.ol-log { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; font-size: .9rem; }
.ol-log li { padding: 6px 8px; border-left: 4px solid var(--line); margin-bottom: 4px; background: #fff; border-radius: 6px; }
.ol-log li.good { border-color: var(--good); } .ol-log li.bad { border-color: var(--bad); } .ol-log li.trade { border-color: var(--info); } .ol-log li.year { border-color: var(--gold); }
.ol-log .yr { font-weight: 800; margin-right: .4em; color: var(--muted); }

/* chat */
.chatbox { display: flex; flex-direction: column; gap: 8px; }
.chatbox .msgs { height: 300px; overflow-y: auto; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px; }
.msg { padding: 4px 2px; } .msg .who { font-weight: 800; margin-right: .3em; } .msg.mine .who { color: var(--teal); } .msg .emo { font-size: 1.5rem; }
.reacts { display: flex; gap: 6px; } .react { flex: 1; font-size: 1.6rem; min-height: 50px; border: 2px solid var(--line); border-radius: 12px; background: #fff; touch-action: manipulation; }
.chatform { display: flex; gap: 6px; } .chatform input { flex: 1; min-width: 0; }
.float-emo { position: fixed; bottom: 80px; font-size: 3rem; z-index: 300; pointer-events: none; animation: floatup 2.2s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50vh); opacity: 0; } }

/* timer ring sits under the top bar */
.timer { top: 64px; padding: .15em .8em .15em .2em; }
.timer svg { width: 46px; height: 46px; } .timer .t-num { width: 46px; font-size: 1.05rem; left: .2em; } .timer .t-label { font-size: 1rem; }
.conn { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: #c0443a; color: #fff; padding: .4em 1em; border-radius: 999px; z-index: 400; font-weight: 700; }
.modal-box { width: min(96vw, 760px); max-height: 92vh; overflow: auto; }
.form-grid { display: grid; gap: 10px; } .form-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.deal { display: grid; gap: 8px; } .bottom-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.any-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.loanbox .btn-row { flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.money { grid-template-columns: 1fr 1fr; }

/* desktop: map + play on the left, tabs on the right */
@media (min-width: 1000px) {
  body { font-size: 18px; }
  .ol-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: start; gap: 16px; padding: 16px; }
  .ol-left { display: flex; flex-direction: column; gap: 16px; }
  .ol-play { display: grid; grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
  .ol-side { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
  .wheel-wrap { width: 360px; }
  .any-grid { grid-template-columns: 1fr 1fr; }
  .deal { grid-template-columns: 1fr 1fr; }
  .chatbox .msgs { height: 420px; }
  /* desktop: the turn timer sits in the top bar so it never covers card titles */
  .timer { top: 6px; left: auto; right: 132px; transform: none; padding: .05em .8em .05em .15em; }
  .timer svg { width: 40px; height: 40px; } .timer .t-num { width: 40px; font-size: .95rem; }
  .timer.warn { animation: tpulseD 1s infinite; }
}
@keyframes tpulseD { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@media (min-width: 1000px) and (max-width: 1250px) { .ol-play { grid-template-columns: 1fr; } .wheel-wrap { width: 340px; } }
.toast { max-width: min(92vw, 640px); width: max-content; text-align: center; }
@media (max-width: 899px) {
  .top5.pinned { padding: 6px 10px; font-size: .85rem; }
  .top5.pinned > .sub { display: none; }
  .top5.pinned ol { display: flex; overflow-x: auto; gap: 16px; white-space: nowrap; padding-left: 0; list-style-position: inside; -webkit-overflow-scrolling: touch; }
  .top5.pinned .amt { float: none; margin-left: .3em; }
  .top5.pinned li .sub { display: none; }
}

/* v5: avatars, turn badge */
.av-choose .av-cur{display:flex;align-items:center;gap:.7em;margin-top:.3em}
#turnBadge:empty{display:none}
.seats li .av{margin-right:.2em}
.who-cell{white-space:nowrap}
.who-cell .av{margin-right:.25em}
.msg .who .av{--avs:22px;border-width:2px;margin-right:.25em}
#gTurn .av{--avs:24px;border-width:2px}
.current .who .av{margin-right:.2em}

/* v7: tap a player to open their portfolio */
.tap { cursor: pointer; }
table.board tr.tap:hover td, table.board tr.tap:focus td { background: #fff4d6; }
table.board .go { color: var(--muted); font-weight: 800; margin-left: .2em; }
#gTurn { cursor: pointer; }
.chip.tap:hover { filter: brightness(.96); }
/* v7: while a pop-up (modal) is open, the timer sits above it in the dimmed area instead of covering its title */
body:has(#modal:not(.hidden)) #timer { top: 6px; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
body:has(#modal:not(.hidden)) #timer.warn { animation: tpulse 1s infinite; }
body:has(#timer:not(.hidden)) #modal:not(.hidden) { padding-top: 64px; box-sizing: border-box; }
body:has(#timer:not(.hidden)) #modal .modal-box { max-height: calc(100vh - 78px); }
@media (max-width: 520px) { .modal-box { padding: 20px 16px; } }
.share a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* v9: copyright footer */
.ol-foot.copyright { font-size: .88rem; margin-top: -8px; }
/* v10: keep scrolled-to cards clear of the sticky top bar */
#action, .map-card { scroll-margin-top: 70px; }
.copyright a { color: #1f8a83; font-weight: 700; padding: .4em .2em; display: inline-block; } /* Terms of Use link */

/* v11: richer text invite + invite landing */
.inv-btn { display: inline-flex; align-items: center; gap: .45em; }
.inv-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.invite-when { margin-top: 12px; display: grid; gap: 8px; }
.invite-when label { font-weight: 800; }
.iw-row { display: flex; gap: 8px; flex-wrap: wrap; }
.iw-row select, .iw-row input { font: inherit; padding: .5em .6em; border: 2px solid #d9cdb2; border-radius: 12px; background: #fff; min-height: 48px; min-width: 0; max-width: 100%; }
.invite-when .btn { justify-self: start; }
#lMsgPrev { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; background: #fffdf6; border: 1px dashed #d9cdb2; border-radius: 12px; padding: 8px 10px; margin: 0; }
.inv-only { display: none; }
body.invited .inv-only { display: block; }
body.invited #createCard, body.invited #homeTop { display: none !important; }
body.invited .ol-cards { grid-template-columns: minmax(0, 1fr) !important; max-width: 560px; margin-left: auto; margin-right: auto; }

/* v11: install / Add to Home Screen */
.ins { margin-top: 12px; display: flex; justify-content: center; }
.ins.hidden { display: none; }
.ins-btn { display: inline-flex; align-items: center; gap: .5em; }
.ins-btn img { border-radius: 7px; }
.ins-tip { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 10px 12px; color: #fff; text-align: left; font-size: .95rem; max-width: 520px; }
.ins-tip img { border-radius: 8px; flex: none; }
.ins-share { vertical-align: -4px; margin: 0 2px; }
.ins-x { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; min-width: 40px; min-height: 40px; flex: none; }

/* v12: share the game (home + end-of-game) */
.uh-share { max-width: 720px; margin: 8px auto 16px; padding: 14px 16px; text-align: center; }
#home .uh-share { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 16px; color: #fff; margin: 0 auto 18px; }
.uhs-main { display: flex; justify-content: center; }
.uhs-native { display: inline-flex; align-items: center; gap: .5em; }
.uhs-native img { border-radius: 7px; flex: none; }
.uhs-lbl { margin: 10px 0 8px; font-size: .85rem; font-weight: 700; letter-spacing: .02em; color: inherit; opacity: .85; }
.uhs-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.uhs-a { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
#action .uh-share { margin: 14px 0 0; padding: 0; text-align: center; }
#action .uhs-lbl { color: var(--muted); }
@media (max-width: 560px) { .uhs-row .btn { flex: 1 1 calc(50% - 8px); } }

/* v12: in-game chat as a compact bar at the bottom (expands on tap) */
#game.active { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
.chat-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fffdf6; border-top: 2px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.12); padding-bottom: env(safe-area-inset-bottom, 0px); }
.cd-toggle { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 14px; border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--ink, #24324d); cursor: pointer; text-align: left; }
.cd-ico { font-size: 1.25rem; }
.cd-last { flex: 1; min-width: 0; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-chevron { margin-left: auto; flex: none; transition: transform .2s; }
.chat-dock.open .cd-chevron { transform: rotate(180deg); }
.chat-dock.open .cd-last { display: none; }
.cd-panel { display: none; border-top: 1px solid var(--line); }
.chat-dock.open .cd-panel { display: block; }
.cd-panel .chatbox { padding: 8px 12px 12px; gap: 8px; }
.cd-panel .msgs { height: min(36vh, 240px); max-height: 240px; }
.cd-mic { flex: none; min-width: 48px; padding: .4em .6em; }
.cd-mic[hidden] { display: none !important; }
.cd-mic.on { background: #c0443a; border-color: #c0443a; color: #fff; animation: micpulse 1s infinite; }
@keyframes micpulse { 50% { transform: scale(1.06); } }
.cd-tabhint { padding: 12px; }
body.in-game .conn { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
body.in-game .toast { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
body.in-game .float-emo { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
/* Desktop: dock as a corner card so it never covers the wheel or SPIN */
@media (min-width: 1000px) {
  #game.active { padding-bottom: 0; }
  .chat-dock { left: auto; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 10px 32px rgba(0,0,0,.16); }
  .cd-panel .msgs { height: min(40vh, 320px); max-height: 320px; }
  body.in-game .conn, body.in-game .toast { bottom: 24px; }
}
@media (max-width: 999px) {
  .cd-panel .msgs { height: min(20vh, 140px); max-height: 140px; }
  .cd-panel .react { min-height: 44px; font-size: 1.3rem; }
  #action, .wheel-card { scroll-margin-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}
