/* Responsive application shell. Gameplay forms remain in their own modules. */
.app-shell,
.webapp-auth {
  --app-bg: #f5f6f3;
  --app-surface: #fff;
  --app-ink: #24322c;
  --app-muted: #707d75;
  --app-line: #e1e6e0;
  --app-accent: #344e40;
  background: var(--app-bg);
  color: var(--app-ink);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  padding: 12px 16px;
  z-index: 100;
  background: #fff;
  color: #24322c;
  border: 1px solid #344e40;
  border-radius: 8px;
}
.skip-link:focus {
  top: 10px;
}
.app-shell .appbar {
  position: sticky;
  top: 0;
  height: auto;
  padding: env(safe-area-inset-top) 0 0;
  z-index: 40;
  background: rgba(250, 251, 248, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--app-line);
}
.appbar-inner {
  width: min(100%, 1280px);
  min-height: 76px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--app-ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--app-accent);
  color: #fff;
  font-size: 13px;
  letter-spacing: -0.4px;
  font-weight: 650;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-copy strong {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.45px;
}
.brand-copy small {
  font-size: 10px;
  color: var(--app-muted);
}
.appbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #68766e;
  white-space: nowrap;
}
.connection-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9da79f;
}
.connection-pill[data-state="connected"] i {
  background: #558469;
  box-shadow: 0 0 0 3px #e6eee7;
}
.connection-pill[data-state="offline"] i {
  background: #aa8757;
}
.profile-area {
  position: relative;
}
.app-shell .profile-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #d8dfd7;
  border-radius: 50%;
  padding: 0;
  background: #e9eee7;
  color: #425544;
  font-size: 13px;
}
.profile-toggle[aria-expanded="true"] {
  box-shadow: 0 0 0 3px #e1e7df;
}
.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  width: min(285px, calc(100vw - 32px));
  padding: 18px 10px 10px;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 50px #23372b1a;
}
.menu-eyebrow {
  margin: 0 10px 6px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #89948b;
}
#current-user {
  margin: 0 10px 14px;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.app-shell .profile-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 9px;
  min-height: 44px;
}
.app-shell .profile-menu #logout {
  border-top: 1px solid var(--app-line);
  border-radius: 0 0 9px 9px;
  margin-top: 5px;
  color: #7b554b;
}
.app-shell main {
  max-width: 1280px;
  padding: 38px 40px calc(130px + env(safe-area-inset-bottom));
}
.app-heading {
  gap: 20px;
  margin-bottom: 30px;
}
.app-heading h1 {
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -1px;
  margin-bottom: 9px;
}
.app-heading .eyebrow {
  color: #829086;
  font-size: 9px;
  letter-spacing: 1.6px;
  margin-bottom: 10px;
}
.app-heading .muted {
  font-size: 13px;
  color: var(--app-muted);
  line-height: 1.7;
}
.app-shell button {
  min-height: 40px;
  border-radius: 9px;
  white-space: normal;
  line-height: 1.45;
}
.app-shell button:not(:disabled) {
  touch-action: manipulation;
}
.app-shell .primary {
  background: var(--app-accent);
  border-color: var(--app-accent);
}
.app-shell .primary:hover {
  background: #293e33;
}
.app-shell .quiet-button {
  font-size: 11px;
  border-color: var(--app-line);
  color: #69776e;
  background: transparent;
  white-space: nowrap;
}
.app-shell input,
.app-shell select {
  border-radius: 8px;
  border-color: #dce2da;
  min-height: 44px;
  height: 44px;
  background-color: #fff;
}
.app-shell input:focus,
.app-shell select:focus {
  border-color: #8b9d8d;
  outline-color: #e3eae0;
}
.app-shell .login-panel,
.app-shell .camp-panel,
.app-shell .accounts,
.app-shell aside {
  border-radius: 16px;
  border-color: var(--app-line);
  box-shadow: 0 2px 3px #22352602;
}
.app-shell .login-panel,
.app-shell .camp-panel {
  padding: 24px;
}
.app-shell .actions {
  flex-wrap: wrap;
}
.app-shell .actions button {
  min-height: 40px;
}
.app-shell .row-select {
  min-height: 0;
}
.app-shell .caption {
  font-size: 12px;
  line-height: 1.75;
  color: #6b786d;
}
.app-shell .operation-fold > summary,
.app-shell details > summary {
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.6;
}
.app-shell footer {
  color: #8c968e;
  margin-top: 4px;
}
.app-shell .status {
  border-radius: 6px;
  padding: 5px 8px;
  font-weight: 500;
  font-size: 10px;
  white-space: nowrap;
}
.section-kicker {
  margin: 0 0 7px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #8a968c;
  font-weight: 600;
}
.overview-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 27px 30px;
  border: 1px solid #dde5da;
  border-radius: 18px;
  background: #edf1e9;
  margin-bottom: 20px;
}
.overview-intro h2 {
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.55px;
  line-height: 1.4;
}
.overview-intro p:last-child {
  margin: 9px 0 0;
  color: #6b7869;
  font-size: 12px;
  line-height: 1.7;
}
.overview-intro .primary {
  flex-shrink: 0;
  padding: 12px 19px;
  font-size: 12px;
}
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  border: 1px solid var(--app-line);
  border-radius: 15px;
  background: #fff;
  padding: 22px 23px;
}
.metric-card p {
  margin: 0;
  font-size: 12px;
  color: #6d7b72;
}
.metric-card strong {
  display: block;
  font-size: 35px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -1.2px;
  margin: 20px 0 15px;
  font-variant-numeric: tabular-nums;
}
.metric-card span {
  display: block;
  font-size: 10px;
  color: #738072;
}
.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.overview-columns > * {
  min-width: 0;
}
.surface-card {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  overflow: hidden;
}
.surface-heading {
  padding: 22px 23px 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.surface-heading h2 {
  font-size: 15px;
  letter-spacing: -0.25px;
  font-weight: 600;
}
.app-shell .text-button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #5d7563;
  padding: 6px 0 6px 10px;
  font-size: 11px;
}
.session-list {
  padding: 0 23px;
  min-height: 140px;
}
.app-shell .session-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid #edf0e9;
  border-radius: 0;
  background: #fff;
  padding: 17px 0;
  text-align: left;
}
.app-shell .session-row:hover {
  background: #fafbf8;
}
.session-monogram {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #e8ece4;
  background: #f6f8f3;
  color: #87917f;
  border-radius: 11px;
  font-size: 13px;
}
.session-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.session-copy strong {
  font-size: 12px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.session-copy small {
  font-size: 10px;
  color: #738072;
  overflow-wrap: anywhere;
}
.surface-footnote {
  padding: 14px 23px;
  border-top: 1px solid #edf0e9;
  font-size: 10px;
  line-height: 1.8;
  color: #75806f;
  background: #fcfdfb;
}
.quick-access {
  padding: 0 23px 9px;
}
.app-shell .quick-access button {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px 0;
  border: 0;
  border-top: 1px solid #edf0e9;
  border-radius: 0;
  text-align: left;
  background: transparent;
}
.app-shell .quick-access button:hover {
  background: #fafbf8;
}
.quick-number {
  align-self: start;
  padding-top: 2px;
  color: #75806f;
  font-size: 10px;
  font-weight: 400;
}
.quick-access button > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.quick-access strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
}
.quick-access small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: #75806f;
  font-weight: 400;
  line-height: 1.6;
}
.quick-arrow {
  color: #75806f;
  font-size: 17px;
  font-weight: 400;
}
.live-label {
  color: #75806f;
  font-size: 10px;
}
.soft-empty {
  margin: 0;
  padding: 22px 0 28px;
  color: #75806f;
  font-size: 12px;
  line-height: 1.8;
}
#overview-activity {
  padding: 0 23px 3px;
}
#overview-activity[data-stale="true"] {
  opacity: 0.55;
}
.activity-row {
  display: flex;
  align-items: start;
  gap: 20px;
  border-top: 1px solid #edf0e9;
  padding: 15px 0;
}
.activity-row time {
  font-size: 10px;
  color: #75806f;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.activity-row strong {
  font-size: 11px;
  font-weight: 550;
}
.activity-row p {
  font-size: 11px;
  color: #6e7a68;
  line-height: 1.7;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.app-shell .floating-dock {
  position: fixed;
  z-index: 45;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(530px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 3px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid #e0e5da;
  background: rgba(255, 255, 253, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 7px 30px #263b2b16,
    0 1px 4px #263b2b08;
}
.app-shell .floating-dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 60px;
  min-height: 60px;
  min-width: 0;
  padding: 7px 2px;
  border-radius: 999px;
  border: 0;
  color: #687961;
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.app-shell .floating-dock button:hover {
  background: #f1f4ec;
  color: #4b614e;
}
.app-shell .floating-dock button[aria-current="page"] {
  color: #fff;
  background: var(--app-accent);
}
.floating-dock svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.keyboard-open .floating-dock {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 900px) {
  .appbar-inner {
    padding: 0 24px;
  }
  .app-shell main {
    padding: 30px 24px calc(120px + env(safe-area-inset-bottom));
  }
  .overview-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .overview-metrics {
    gap: 12px;
  }
  .metric-card {
    padding: 20px 17px;
  }
}
@media (max-width: 600px) {
  .appbar-inner {
    min-height: 66px;
    padding: 0 18px;
    gap: 12px;
  }
  .appbar-actions {
    gap: 12px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 12px;
  }
  .app-brand {
    gap: 9px;
  }
  .brand-copy strong {
    font-size: 15px;
  }
  .brand-copy small {
    font-size: 9px;
  }
  .connection-pill {
    font-size: 10px;
    gap: 6px;
  }
  .app-shell .profile-toggle {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 12px;
  }
  .app-shell main {
    padding: 27px 18px calc(116px + env(safe-area-inset-bottom));
  }
  .app-heading {
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 12px;
  }
  .app-heading h1 {
    font-size: 27px;
  }
  .app-heading .muted {
    font-size: 12px;
  }
  .app-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 1.2px;
  }
  .app-shell .quiet-button {
    padding: 7px 9px;
    font-size: 10px;
    min-height: 34px;
    margin-top: 20px;
  }
  .overview-intro {
    display: block;
    border-radius: 15px;
    padding: 23px 21px;
    margin-bottom: 14px;
  }
  .overview-intro h2 {
    font-size: 20px;
    line-height: 1.45;
  }
  .overview-intro .primary {
    margin-top: 19px;
    padding: 11px 17px;
  }
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .metric-card {
    padding: 19px 19px 17px;
    border-radius: 13px;
  }
  .metric-card p {
    font-size: 11px;
  }
  .metric-card strong {
    font-size: 31px;
    margin: 17px 0 12px;
  }
  .metric-card span {
    font-size: 9px;
    line-height: 1.6;
  }
  .overview-columns {
    margin-bottom: 18px;
  }
  .surface-heading {
    padding: 21px 19px 17px;
  }
  .session-list {
    min-height: 0;
  }
  .session-list,
  #overview-activity {
    padding-left: 19px;
    padding-right: 19px;
  }
  .quick-access {
    padding: 0 19px 8px;
  }
  .surface-footnote {
    padding: 14px 19px;
    font-size: 11px;
  }
  .session-monogram {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 12px;
  }
  .session-row {
    gap: 10px;
  }
  .session-copy strong {
    font-size: 11px;
  }
  .app-shell .session-row .status {
    font-size: 9px;
    padding: 4px 6px;
  }
  .app-shell .login-panel,
  .app-shell .camp-panel {
    padding: 20px;
    border-radius: 14px;
  }
  .app-shell input,
  .app-shell select {
    font-size: 16px;
  }
  .app-shell label {
    font-size: 12px;
  }
  .app-shell .caption {
    font-size: 11px;
  }
  .app-shell .floating-dock {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    padding: 5px;
    gap: 1px;
  }
  .app-shell .floating-dock button {
    height: 58px;
    min-height: 58px;
    font-size: 10px;
    gap: 5px;
  }
  .floating-dock svg {
    width: 19px;
    height: 19px;
  }
  .live-label {
    font-size: 9px;
  }
}
@media (max-width: 360px) {
  .appbar-inner {
    padding: 0 14px;
    gap: 8px;
  }
  .brand-copy small {
    display: none;
  }
  .app-shell main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .appbar-actions {
    gap: 9px;
  }
  .app-shell .floating-dock button {
    font-size: 9px;
  }
  .metric-card {
    padding: 17px 15px;
  }
  .overview-intro {
    padding: 21px 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .floating-dock button,
  .profile-toggle {
    transition:
      background-color 0.18s ease,
      color 0.18s ease;
  }
}

.app-shell #admin-panel {
  scroll-margin-top: 100px;
}

/* Entry screens share the same quiet palette; no navigation before sign-in. */
.webapp-auth {
  padding: 24px;
  background: #f5f6f3;
}
.webapp-auth .auth-card {
  border-radius: 20px;
  border-color: #e1e6e0;
  padding: 34px;
  box-shadow: 0 10px 40px #283d2c05;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 34px;
  letter-spacing: -0.4px;
}
.webapp-auth h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}
.webapp-auth .muted {
  color: #778173;
  font-size: 12px;
}
.webapp-auth input {
  height: 46px;
  border-radius: 9px;
  border-color: #dce2da;
}
.webapp-auth .primary {
  background: #344e40;
  border-color: #344e40;
  min-height: 46px;
  border-radius: 9px;
}
.webapp-auth .primary:hover {
  background: #293e33;
}
.webapp-auth .caption {
  color: #7a8574;
  line-height: 1.8;
}
@media (max-width: 600px) {
  .webapp-auth {
    padding: 18px;
  }
  .webapp-auth .auth-card {
    padding: 27px 23px;
  }
  .webapp-auth input {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .app-shell .accounts {
    min-height: 0;
  }
  .app-shell .accounts table {
    white-space: normal;
  }
  .app-shell .accounts thead {
    display: none;
  }
  #rows {
    display: block;
  }
  #rows tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    padding: 17px 19px;
    border-bottom: 1px solid #edf0e9;
  }
  #rows td {
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  #rows td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  #rows td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    color: #77846f;
    font-size: 11px;
  }
  #rows td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  #rows td:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    color: #77846f;
    font-size: 11px;
  }
  #rows td:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    color: #77846f;
    font-size: 11px;
    text-align: right;
  }
  #rows td:nth-child(4)::before {
    content: "Cấp: ";
    color: #9ba491;
  }
  #rows td:nth-child(5)::before {
    content: "Map: ";
    color: #9ba491;
  }
  #rows .row-select {
    text-align: left;
    overflow-wrap: anywhere;
  }
}

.brand-mark img { display: block; width: 100%; height: 100%; border-radius: inherit; }

/* Wallet stays within the existing five-tab workspace. */
.wallet-home,.wallet-dialog header,.wallet-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.wallet-home{margin:12px 0;padding:16px;border:1px solid #363840;border-radius:16px;background:#191b20}
.wallet-dialog{width:min(620px,calc(100vw - 28px));max-height:85dvh;overflow:auto;box-sizing:border-box}
.wallet-dialog p,.wallet-rental{overflow-wrap:anywhere}
.wallet-dialog form{display:grid;gap:12px}.wallet-dialog label{display:grid;gap:8px}
.wallet-rental{padding:14px 0;border-bottom:1px solid #363840}.wallet-rental small{display:block;margin-bottom:10px}
#wallet-qr{display:block;object-fit:contain;max-width:100%;height:auto;margin:16px auto;border-radius:10px}
#wallet-qr[hidden]{display:none}#rental-confirm-error{color:#ffb4b4}
.app-shell .wallet-dialog{max-width:620px;width:calc(100vw - 28px);padding:24px}
.app-shell .wallet-dialog header{height:auto;min-height:44px;padding:0 0 12px;background:transparent;border-color:#414a50;color:#fff}
.app-shell .wallet-dialog header h2{margin:0;color:#fff}
.app-shell .wallet-dialog form{grid-template-columns:minmax(0,1fr);align-items:stretch}
.app-shell #wallet-balance{font-size:28px;letter-spacing:-.02em}
.wallet-topup-buttons{display:flex;gap:10px;flex-wrap:wrap}
.wallet-topup-buttons button{flex:1 1 200px}
.wallet-topup-all-btn{background:linear-gradient(135deg,#0f766e,#0d9488);border-color:#2dd4bf;color:#f0fdfa;font-weight:700}
.wallet-rentals-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:16px}
.wallet-rentals-header h3{margin:0}
.wallet-renew-all-btn{background:linear-gradient(135deg,#b45309,#d97706);border-color:#fbbf24;color:#fffbeb;font-weight:700;padding:10px 16px;border-radius:10px}
.wallet-bulk-status{margin:10px 0;padding:10px 14px;border-radius:10px;background:rgba(16,185,129,.14);border:1px solid rgba(52,211,153,.35);color:#a7f3d0;font-weight:600}
.wallet-bulk-status[data-state="error"]{background:rgba(239,68,68,.15);border-color:rgba(248,113,113,.4);color:#fecaca}
@media(max-width:480px){.app-shell .wallet-dialog{padding:18px}.wallet-actions button,.wallet-topup-buttons button,.wallet-renew-all-btn{width:100%}}
