/* Michigander Euchre app shell (login, request access, welcome, profile, admin), v0.3.
   All colors/fonts/shapes come from the theme variables in /themes/*.css (same as the game), so the
   whole site follows the player's theme. Component look matches /themes/ui.css. */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
html { background: var(--bg); }
body { font-family: var(--font-ui); background: var(--bg); background-image: var(--bg-image); background-attachment: fixed; color: var(--text); -webkit-text-size-adjust: 100%;
  line-height: 1.45; transition: background-color .3s ease, color .3s ease; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-spacing); }

/* top bar */
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 52px;
  padding: 6px 14px; padding-top: calc(6px + env(safe-area-inset-top)); background: var(--surface-glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(0,0,0,.25); }
#topbar[hidden] { display: none; }
.brand { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-spacing); font-size: 22px; color: var(--display-color); text-decoration: none; white-space: nowrap; }
.ver { font-family: var(--font-ui); font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 4px; letter-spacing: 0; text-transform: none; }
#nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#nav .navlink { gap: 6px; padding: 6px 12px; font-weight: 700; }
#nav .navlink .ic { font-size: 15px; line-height: 1; }
#nav .navlink.on { background: var(--surface-2); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); cursor: default; }
#nav .nav-profile .lbl { font-weight: 600; }
#nav .btn.sm { min-height: 36px; }

/* badges & buttons (same look as .ui-badge / .ui-btn) */
.badge { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--plan); color: var(--plan-ink); vertical-align: middle; font-family: var(--font-ui); }
.badge.owner { background: var(--accent); color: var(--accent-ink); } .badge.admin { background: var(--warn); color: var(--warn-ink); } .badge.off { background: var(--danger); color: var(--danger-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; font-size: 16px; font-weight: 700; border-radius: var(--radius-pill);
  border: 1px solid transparent; background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--accent-shadow); cursor: pointer; text-decoration: none; font-family: var(--font-ui);
  transition: transform .08s ease, filter .15s ease, border-color .15s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: var(--secondary-bg); color: var(--secondary-ink); border: 1px solid var(--secondary-line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.danger { background: var(--danger); color: var(--danger-ink); box-shadow: none; }
.btn.big { font-size: 20px; padding: 14px 30px; min-height: 58px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* login / request access */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px 14px 32px;
  padding-top: calc(16px + env(safe-area-inset-top)); background-image: var(--start-glow); }
.auth .art { width: min(380px, 80vw); height: auto; border-radius: var(--radius); box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
@media (min-width: 900px) { .auth { flex-direction: row; gap: 40px; } .auth .art { width: min(540px, 44vw); } }
.panel { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; box-shadow: var(--shadow); }
.panel h2 { color: var(--heading-color); text-align: center; margin: 0 0 12px; font-size: 24px; }
.tabs { display: flex; gap: 4px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; min-height: 44px; background: none; border: none; color: var(--text-soft); font-size: 15px; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; font-family: inherit; transition: color .15s ease, border-color .15s ease; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
form.stack { display: flex; flex-direction: column; gap: 10px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-soft); text-align: left; font-weight: 600; }
input[type=text], input[type=email], input[type=password], textarea, select {
  font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--input-bg); color: var(--text); width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.err { color: var(--danger); font-size: 14px; min-height: 1em; font-weight: 600; }
.okmsg { color: var(--ok); font-size: 15px; font-weight: 600; }
.muted { color: var(--text-soft); font-size: 13px; } .dim { color: var(--muted); font-size: 13px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.linkbtn { background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; padding: 6px 0; }
.foot { margin-top: 14px; color: var(--muted); font-size: 12px; text-align: center; }

/* signed-in pages */
.page { max-width: 980px; margin: 0 auto; padding: 22px 14px 60px; }
.hero { text-align: center; padding: 6px 0 4px; }
.hero img { width: min(380px, 80vw); border-radius: var(--radius); box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
.hero h1 { color: var(--display-color); margin: 16px 0 4px; font-size: clamp(30px, 5vw, 44px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 6px; color: var(--heading-color); font-size: 19px; }
.hero .sub { color: var(--text-soft); font-size: 17px; max-width: 620px; margin: 6px auto 16px; line-height: 1.5; }
.feat p, .install p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text-soft); }
.feat h3, .install h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 20px; }
.status { font-family: var(--font-ui); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.status.ok { background: var(--ok); color: var(--ok-ink); } .status.soon { background: var(--warn); color: var(--warn-ink); } .status.plan { background: var(--plan); color: var(--plan-ink); }
.install { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; justify-content: space-between; padding: 18px 20px; border-color: var(--line-strong); }
.install-text { flex: 1 1 280px; }
.install-btns { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 320px; justify-content: flex-end; }
.install-btns .inst { flex: 1 1 180px; min-height: 52px; font-size: 17px; }
.install-btns .inst.match { box-shadow: var(--accent-shadow), var(--focus-ring); }
.installed { color: var(--ok); font-weight: 700; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.feat { padding: 16px 18px; }
.soon { opacity: .88; }
/* modal (install steps etc.) = .ui-modal look */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: var(--overlay); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ui-fade .16s ease; }
.modal { width: min(480px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); animation: ui-pop .2s cubic-bezier(.2, 1.2, .4, 1); }
.modal h3 { margin: 0 0 10px; color: var(--heading-color); font-size: 22px; }
.modal h4 { margin: 12px 0 4px; color: var(--text); font-size: 16px; }
.steps { margin: 0 0 6px; padding-left: 22px; font-size: 16px; line-height: 1.55; }
.steps li { margin: 3px 0; }
.key { display: inline-block; min-width: 22px; text-align: center; background: var(--secondary-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.modal .small { font-size: 14px; margin-top: 10px; }
.modal .warn { background: var(--danger); color: var(--danger-ink); border-radius: var(--radius-sm); padding: 8px 10px; margin: 0 0 10px; }
.modal-acts { text-align: right; margin: 14px 0 0; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.subtabs a { padding: 8px 16px; border-radius: var(--radius-pill); background: var(--secondary-bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; min-height: 40px; display: inline-flex; align-items: center; }
.subtabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.row .main { min-width: 200px; flex: 1; } .row .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .acts select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }
.row blockquote { margin: 6px 0 0; padding: 4px 10px; border-left: 3px solid var(--accent); color: var(--text-soft); font-size: 14px; }
.switch { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.switch input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--accent); flex-shrink: 0; }
.empty { color: var(--muted); padding: 14px; text-align: center; }
h2.sec { color: var(--heading-color); margin: 4px 0 12px; font-size: 26px; }
.page.narrow { max-width: 600px; } .page.narrow .card { margin-bottom: 14px; }
/* toasts = .ui-toast look */
#toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
#toast .t { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 11px 16px; color: var(--text); box-shadow: var(--shadow); font-weight: 600; text-align: center; animation: ui-tin .32s cubic-bezier(.2, 1.3, .4, 1); }
#toast .t.bad { border-color: var(--danger); }
@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .install-btns { justify-content: stretch; }
  .install-btns .inst { flex-basis: 100%; }
}
@media (max-width: 520px) {
  .brand { font-size: 18px; }
  #nav .navlink { padding: 6px 9px; }
  #nav .navlink .lbl { display: none; }
  .brand .ver, .brand .full { display: none; }
  .panel { padding: 16px 14px 18px; }
}

/* ---------- v0.3.1: hero (same look as the /play/ start screen) for the welcome and login pages ---------- */
.hero2 { min-height: calc(100vh - var(--topbar-h, 53px)); min-height: calc(100svh - var(--topbar-h, 53px)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 28px 20px 18px; background-image: var(--start-glow); }
.hero2.out { min-height: 100vh; min-height: 100svh; }
.h2-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; width: min(1080px, 100%); }
.h2-art { justify-self: end; width: min(440px, 100%); aspect-ratio: 1 / 1.16; border-radius: var(--radius); background: var(--start-art) center / cover no-repeat;
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); animation: ui-fade .4s ease; }
.h2-main { display: flex; flex-direction: column; gap: 14px; text-align: left; max-width: 460px; width: 100%; }
.h2-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); }
.h2-title { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-spacing);
  color: var(--display-color); font-size: clamp(40px, 5vw, 64px); line-height: 1.02; text-shadow: 0 2px 14px rgba(0,0,0,.25); }
.h2-sub { margin: 0 0 8px; color: var(--text-soft); font-size: 17px; line-height: 1.5; }
.h2-sub b { color: var(--text); }
.h2-actions { display: flex; flex-direction: column; gap: 10px; }
.h2-actions .btn.big { width: 100%; }
.h2-primary { flex-direction: column; gap: 0; }
.h2-primary small { display: block; font-size: 14px; font-weight: 600; opacity: .85; margin-top: 2px; }
.h2-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.h2-tools .btn { flex-direction: column; gap: 2px; min-height: 64px; border-radius: var(--radius-sm); font-size: 14px; padding: 8px 4px; }
.h2-tools .btn span:first-child { font-size: 20px; }
.h2-more { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill); }
.h2-more:hover { color: var(--text); background: var(--secondary-bg); }
.hero2 .panel { max-width: none; padding: 16px 20px 20px; }
.hero2 .panel .tabs { margin-top: -6px; }

/* below the fold: phone install + feature status (light) */
.home-more { max-width: 1080px; padding-top: 8px; }
.home-more h2.sec { font-size: 22px; margin: 18px 0 10px; }
.home-more .install { margin-top: 0; padding: 14px 18px; }
.home-more .install h3 { font-size: 18px; }
.home-more .install p { font-size: 15px; }
.home-more .install-btns .inst { min-height: 48px; font-size: 16px; }
.home-more .install-btns .inst.big { min-height: 52px; font-size: 17px; padding: 10px 20px; }
.home-more .features { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 0; }
.home-more .feat { padding: 12px 14px; box-shadow: none; background: var(--secondary-bg); }
.home-more .feat h3 { font-size: 16px; gap: 6px; margin-bottom: 4px; font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-weight: 800; color: var(--text); }
.home-more .feat p { font-size: 14px; line-height: 1.4; }
.home-more .foot { margin: 22px 0 0; }

@media (max-width: 960px) { .home-more .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .hero2 { justify-content: space-between; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); gap: 12px; }
  .h2-wrap { grid-template-columns: 1fr; gap: 14px; flex: 1; align-content: space-between; }
  .h2-art { justify-self: center; width: auto; height: min(34vh, 320px); max-width: 100%; }
  .h2-main { max-width: 520px; justify-self: center; text-align: center; gap: 10px; }
  .h2-title { font-size: clamp(32px, 9vw, 46px); }
  .h2-sub { font-size: 15px; margin-bottom: 2px; }
  .hero2.out .h2-wrap { align-content: start; }
  .hero2.out .h2-art { height: min(22vh, 200px); }
  .hero2.out .h2-main { text-align: left; }
  .hero2.out .h2-kicker, .hero2.out .h2-title { text-align: center; }
}
@media (max-width: 640px) { .home-more .features { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .h2-tools .btn { font-size: 12px; } }

/* v0.3.1 tidy-ups: feature badges on their own line (even cards); hide the top-bar Play on the phone welcome page (the hero has it) */
.home-more .feat h3 { flex-direction: column; align-items: flex-start; gap: 4px; }
.home-more .feat h3 .status { order: -1; }
@media (max-width: 520px) { body.on-home #nav .navplay { display: none; } }

/* v0.3.1 admin: in-app dialog checkbox, load errors */
.modal .field { display: block; margin: 10px 0 6px; }
.modal textarea { width: 100%; min-height: 70px; }
.chk { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; font-weight: 600; cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--accent); }
.errbox { color: var(--text); border: 1px dashed var(--danger); border-radius: var(--radius-sm); }
.errbox .btn { margin-top: 10px; }
/* v0.3.1: phone top bar on one row (icons for Home / Admin / My profile), admin tabs on one row */
@media (max-width: 520px) {
  #topbar { flex-wrap: nowrap; padding-left: 10px; padding-right: 10px; }
  #nav { gap: 4px; flex-wrap: nowrap; }
  #nav .btn.sm { font-size: 13px; padding: 6px 10px; }
  #nav .navlink { width: 36px; min-width: 36px; padding: 0; }
  .subtabs { gap: 4px; flex-wrap: nowrap; }
  .subtabs a { padding: 6px 11px; font-size: 14px; white-space: nowrap; }
}
