/* base.css: retained cascade position */ /* System fonts work offline without third-party requests. */
html {
  scrollbar-color: #aa9874 #f5eddb;
}
::selection {
  background: #c4a45b70;
  color: #253b4d;
}
/* style.css: retained cascade position */
:root {
  color-scheme: light;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  color: var(--ink);
  background: #e6ece5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
}
body:before {
  content: '';
  position: fixed;
  inset: 0;
  background: #e6ece5 url('/assets/ui/garden-v1.png') center/cover no-repeat;
  z-index: -2;
  pointer-events: none;
}
body:after {
  content: '';
  position: fixed;
  inset: 0;
  background: #eff1e5bc;
  z-index: -1;
  pointer-events: none;
}
body[data-screen='lobby']:after,
body[data-screen='auth']:after {
  background: linear-gradient(180deg, #e7f2ee05 50%, #203b4938);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  line-height: 1.4;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:not(:disabled):hover {
  filter: brightness(1.05);
}
:focus-visible {
  outline: 3px solid #ae5039;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -1px;
}
h2 {
  font-size: 20px;
  line-height: 1.4;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.7;
}
a {
  color: inherit;
}
small {
  font-size: 12px;
}
.ui-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
button .ui-icon,
button > span {
  pointer-events: none;
}
.muted,
.page-note {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--paper);
  padding: 14px;
  z-index: 1000;
}
.skip:focus {
  top: 12px;
}
.loading {
  display: grid;
  min-height: 100dvh;
  place-content: center;
}
.primary,
.outline {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 23px;
  border-radius: 5px;
  border: 1px solid #b99b63;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 8px #3c443c12;
  white-space: nowrap;
}
.primary {
  color: #fff9e8;
  background: linear-gradient(135deg, #365264, #253e51);
  border-color: #d5b980;
  box-shadow:
    inset 0 0 0 3px #d7bd7e20,
    0 3px 8px #3c443c22;
}
.outline {
  background: #fffaf0e8;
  color: var(--ink);
}
.quiet,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
}
.quiet:hover:not(:disabled) {
  background: #9b824918;
}
.text-button {
  color: #7f482f;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.wide {
  width: 100%;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 18px;
  margin-bottom: 16px;
  background: #fff9eaf5;
  border: 1px solid #baa16d;
  border-radius: 6px;
  font-size: 13px;
}
.banner.warning {
  border-color: #be7653;
  background: #fff0db;
}
.banner small {
  color: #755538;
}
.banner > .quiet {
  margin-left: auto;
}
.section-label {
  display: block;
  color: #786445;
  font-size: 12px;
  margin-bottom: 7px;
}
.bot-badge,
.host-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 3px;
  padding: 2px 6px;
  vertical-align: middle;
}
.bot-badge {
  color: #3c5d53;
  background: #e5ede1;
  border: 1px solid #8eaa8c80;
}
.host-tag {
  color: #8b622b;
  background: #f5e7c4;
  border: 1px solid #c6a36280;
}
/* Common header */
.game-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 86px;
  padding: 13px 32px;
  background: linear-gradient(180deg, #fffaf5fa, #fff8e9e8);
  border-bottom: 2px solid #c3a876;
  box-shadow: 0 3px 16px #26384626;
  position: relative;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  white-space: nowrap;
  opacity: 1 !important;
}
.brand:disabled {
  cursor: default;
}
.brand > .ui-icon {
  width: 42px;
  height: 42px;
  color: #8f682d;
  border: 1px solid #c6aa70;
  background: #fff6db;
  padding: 7px;
  rotate: -8deg;
  border-radius: 10px;
}
.brand strong {
  font-family: Batang, serif;
  font-size: 23px;
  letter-spacing: -1px;
}
.player-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ccb782;
  background: #eee6d2;
  flex-shrink: 0;
}
.player-profile > div {
  min-width: 0;
}
.account-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 150px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 10px;
  color: #7c5f45;
}
.connection i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b4673d;
}
.connection.online i {
  background: #548a64;
}
.connection.online {
  color: #467355;
}
.top-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #c8ab70;
  border-radius: 5px;
  padding: 9px 16px;
  background: #f7ebd1;
  box-shadow: inset 0 1px 3px #fff;
  font-size: 15px;
  color: #5b4726;
}
.coin .ui-icon {
  color: #a57932;
  width: 23px;
  height: 23px;
}
.coin b {
  font-variant-numeric: tabular-nums;
}
.header-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
  border: 1px solid #baa36f7d;
  border-radius: 6px;
  background: #fffaf0b3;
  padding: 8px 12px;
}
.header-button .ui-icon {
  width: 21px;
  height: 21px;
}
#main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 40px 46px;
  flex: 1;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading > div {
  min-width: 0;
}
.page-heading h1 {
  overflow-wrap: anywhere;
}
.page-heading p {
  font-size: 12px;
  margin-top: 8px;
  color: var(--muted);
}
.page-heading > button {
  flex-shrink: 0;
}
.page-note {
  font-size: 12px;
  margin-top: 20px;
  text-align: center;
}
/* Character and three mode banners */
.screen-lobby #main {
  padding: 0 32px;
  max-width: 1680px;
  display: flex;
  flex-direction: column;
}
.screen-lobby #main > .banner {
  margin-top: 16px;
}
.lobby-hero {
  position: relative;
  flex: 1;
  min-height: 650px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 0 7%;
  padding: 14px 5% 20px;
}
.lobby-character {
  position: relative;
  min-width: 0;
  min-height: 500px;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-character {
  height: clamp(540px, 78dvh, 840px);
  max-height: calc(100dvh - 115px);
  width: auto;
  max-width: 115%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 15px 15px #23394440);
  position: absolute;
  bottom: -65px;
  pointer-events: none;
}
.mode-menu {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  max-width: 510px;
  margin-left: auto;
  padding-top: 15px;
  padding-bottom: 30px;
}
.mode-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 125px;
  padding: 20px 35px;
  color: #fff8df;
  border: 4px solid #c8a66d;
  border-radius: 9px;
  background: linear-gradient(115deg, #344f6b, #24394f);
  box-shadow:
    0 6px 0 #654d38,
    0 12px 22px #1a2e4545,
    inset 0 0 0 2px #f1d59c5c;
  isolation: isolate;
  transition:
    translate 0.15s,
    box-shadow 0.15s;
}
.mode-button:before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid #e5c58760;
  border-radius: 3px;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 15px, #fff4d303 15px 17px);
  z-index: -1;
}
.mode-button:after {
  content: '';
  position: absolute;
  top: -11px;
  right: 32px;
  width: 17px;
  height: 17px;
  rotate: 45deg;
  background: #f1d599;
  border: 3px solid #9b773e;
  box-shadow: 0 2px 5px #30291c55;
}
.mode-button.mode-join {
  background: linear-gradient(115deg, #b0674d, #864235);
}
.mode-button.mode-bot {
  background: linear-gradient(115deg, #567970, #315651);
}
.mode-button:hover:not(:disabled) {
  translate: 0 -3px;
  box-shadow:
    0 9px 0 #654d38,
    0 16px 28px #1a2e4545;
}
.mode-button:active:not(:disabled) {
  translate: 0 3px;
  box-shadow: 0 3px 0 #654d38;
}
.mode-title {
  font:
    700 clamp(30px, 3vw, 42px) / 1.2 Batang,
    serif;
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 2px 2px #182334;
}
.mode-symbol {
  display: grid;
  place-items: center;
  width: 61px;
  height: 61px;
  flex-shrink: 0;
  border: 1px solid #e1c180a6;
  outline: 1px solid #e1c18038;
  outline-offset: 4px;
  rotate: 45deg;
  background: #112d402b;
  border-radius: 6px;
  color: #f2d598;
}
.mode-symbol .ui-icon {
  width: 37px;
  height: 37px;
  rotate: -45deg;
}
.mode-arrow {
  margin-left: auto;
  color: #e2c58d;
}
.mode-arrow .ui-icon {
  width: 25px;
  height: 25px;
}
.maintenance-note {
  padding: 12px;
  background: #fff1d8;
  border: 1px solid #af8050;
  color: #7e4a2c;
  font-size: 12px;
  text-align: center;
  border-radius: 5px;
}
.lobby-dock {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 15px;
  position: relative;
  z-index: 2;
}
.dock-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 10px;
  min-width: 105px;
  font-size: 14px;
  font-weight: 700;
  color: #253b4d;
  background: linear-gradient(180deg, #fff9eaf5, #ead8afe8);
  border: 1px solid #b19760;
  border-radius: 8px;
  box-shadow:
    0 4px 0 #8a704d,
    0 7px 20px #263f4930;
  text-shadow: 0 1px #fff8e9;
  transition: translate 0.15s;
}
.dock-button:hover:not(:disabled) {
  translate: 0 -3px;
}
.dock-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  color: #896536;
}
.dock-icon .ui-icon {
  width: 33px;
  height: 33px;
}
/* Login */
.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: 7vw;
  max-width: 1260px;
  min-height: 100dvh;
  margin: auto;
  padding: 50px;
}
.auth-art {
  position: relative;
  align-self: stretch;
  min-height: 550px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
  color: #263a4c;
  text-shadow: 0 1px 6px #fff;
}
.auth-brand > .ui-icon {
  width: 54px;
  height: 54px;
  padding: 9px;
  color: #866234;
  background: #f9edcef0;
  border: 2px solid #b89a65;
  border-radius: 11px;
  rotate: -8deg;
}
.auth-brand h1 {
  font:
    700 34px Batang,
    serif;
}
.auth-character {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  height: 88dvh;
  max-height: 840px;
  width: auto;
  max-width: 130%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 20px #23364b30);
}
.auth-character-name {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 35px;
  background: #293e54ed;
  border: 1px solid #d0b980;
  color: #fff4d7;
  font:
    700 20px Batang,
    serif;
  white-space: nowrap;
  border-radius: 4px;
}
.auth-panel#main {
  padding: 36px;
  flex: none;
  background: #fffaf0f5;
  border: 2px solid #c8ae78;
  border-radius: 10px;
  box-shadow: 0 18px 70px #2c3d4c40;
  position: relative;
  z-index: 2;
  max-width: 440px;
}
.auth-box > h2 {
  font-size: 28px;
  margin-bottom: 24px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tabs > button {
  flex: 1;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 3px solid transparent;
}
.tabs > button.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: #9d7540;
}
.auth-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
}
/* Forms and dialogs */
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 17px;
}
input,
select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  min-height: 45px;
  padding: 11px 12px;
  background: #fffdf8;
  color: var(--ink);
  border: 1px solid #b9aa8b;
  border-radius: 5px;
  font-size: 14px;
}
input::placeholder {
  color: #8b8e8a;
  font-size: 12px;
}
.form-error {
  color: #a2392d;
  font-size: 12px;
  margin: 10px 0;
}
.form-error:empty {
  display: none;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row label {
  flex: 1;
  min-width: 0;
}
dialog {
  width: min(480px, calc(100% - 28px));
  max-height: 88dvh;
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid #b79c65;
  border-radius: 9px;
  box-shadow: 0 20px 100px #132d4c66;
}
dialog::backdrop {
  background: #1e304c77;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font-size: 23px;
}
.icon-button {
  min-width: 40px;
  min-height: 40px;
  font-size: 27px;
  color: #78664c;
}
.dialog-copy {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 17px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.dialog-actions button {
  min-width: 85px;
}
dialog .muted {
  font-size: 12px;
  margin: 12px 0 18px;
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-family: Consolas, monospace;
  font-size: 19px;
}
.join-dialog {
  width: min(680px, calc(100% - 28px));
}
.join-code-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.join-code-row label {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.join-code-row button {
  height: 46px;
}
.public-rooms h3 {
  font-size: 14px;
  margin: 22px 0 10px;
  color: #6b654f;
}
.room-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.room-row:last-child {
  border: 0;
}
.room-symbol {
  display: grid;
  place-items: center;
  background: #eee5ce;
  border: 1px solid #c4b38c;
  width: 43px;
  height: 43px;
  border-radius: 7px;
  flex-shrink: 0;
  color: #897044;
}
.room-info {
  flex: 1;
  min-width: 0;
}
.room-info strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.room-info small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.room-row > button {
  flex-shrink: 0;
  font-size: 12px;
  padding: 9px 15px;
  min-width: 74px;
}
.empty-table {
  text-align: center;
  padding: 35px 20px;
  color: var(--muted);
}
.empty-table h2 {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 12px;
}
.empty-table p {
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  background: #263d50;
  color: #fff6dd;
  border: 1px solid #ccb27b;
  border-radius: 6px;
  padding: 13px 20px;
  box-shadow: 0 8px 25px #1f334833;
  width: max-content;
  max-width: calc(100% - 30px);
  font-size: 13px;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* Waiting room */
.invite-strip {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 20px;
  margin-bottom: 14px;
  background: #fff9eaf7;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.invite-strip > span {
  font-size: 12px;
}
.invite-strip strong {
  font:
    700 21px Georgia,
    serif;
  letter-spacing: 3px;
  margin-left: 15px;
  color: #6e4e28;
}
.invite-strip > small {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.bot-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 12px;
  margin: 0 0 22px;
  color: #4f655c;
}
.bot-notice strong {
  color: #3c554c;
}
.bot-notice small {
  color: var(--muted);
  margin-left: auto;
  font-size: 11px;
}
.player-seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.seat {
  position: relative;
  text-align: center;
  border: 1px solid #b9a781;
  border-radius: 8px;
  background: linear-gradient(160deg, #fffaf0ef, #eee5d1f5);
  box-shadow: var(--shadow);
  padding: 15px 18px 20px;
  min-width: 0;
  overflow: hidden;
}
.seat.ready {
  border-color: #718a63;
  box-shadow:
    inset 0 0 0 2px #8aa57955,
    var(--shadow);
}
.seat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #7c715b;
  min-height: 23px;
}
.seat-label > span:first-child {
  margin-right: auto;
}
.seat-art {
  height: clamp(240px, 32dvh, 345px);
  width: 100%;
  object-fit: contain;
  margin: 8px 0;
}
.seat h2 {
  font-size: 19px;
  overflow-wrap: anywhere;
}
.seat h2 small {
  font-size: 10px;
  color: #9b7437;
  margin-left: 4px;
}
.seat p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 12px;
}
.status-tag {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #7b664a;
  margin: 10px 0;
}
.ready .status-tag {
  color: #3e6d4b;
}
.seat .quiet {
  font-size: 11px;
  display: flex;
  margin: 0 auto;
}
.seat.vacant {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 410px;
  background: #f7f2e8ce;
  border-style: dashed;
  box-shadow: none;
}
.seat.vacant > .ui-icon {
  width: 50px;
  height: 50px;
  color: #b1a78b;
  margin-bottom: 20px;
}
.seat.vacant h3 {
  color: #817965;
  font-size: 17px;
  margin-bottom: 14px;
}
.waiting-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}
.waiting-actions button {
  min-width: 150px;
  min-height: 49px;
}
.waiting-actions .muted {
  font-size: 13px;
}
