:root {
  --vv-top: 0px;
  --vv-left: 0px;
  --vv-width: 100vw;
  --vv-height: 100vh;
  --game-height: 100vh;
  --keyboard-bottom: 0px;
  --chat-keyboard-top: 0px;
  color-scheme: dark;
  font-family: "Malgun Gothic", "Segoe UI", sans-serif;
  background: #000;
  color: #f4f5ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #000;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: var(--game-height);
  background: #000;
}

#game.scene-hidden,
#labels.scene-hidden {
  opacity: 0;
  visibility: hidden;
}

#labels {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--game-height);
  pointer-events: none;
}

input,
textarea,
select {
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

.name-label {
  position: absolute;
  transform: translate(-50%, -100%);
  color: #f2f234;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 1px 1px 1px #000;
  white-space: nowrap;
}

.pet-name-label {
  color: #66d9ff;
}

.ranking-leader-name-label {
  color: var(--ranking-glow-color);
  text-shadow: 1px 1px 1px #000, 0 0 4px var(--ranking-glow-color), 0 0 8px var(--ranking-glow-color);
}

.maze-player-vitals {
  position: absolute;
  width: 84px;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.maze-player-vital {
  position: relative;
  width: 84px;
  height: 9px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.9);
  background: rgba(0, 0, 0, 0.72);
  box-sizing: border-box;
}

.maze-player-vital + .maze-player-vital {
  margin-top: 1px;
}

.maze-player-vital span {
  display: block;
  height: 100%;
}

.maze-player-vital.hp span {
  background: #d82f35;
}

.maze-player-vital.mp span {
  background: #2687dc;
}

.maze-player-vital b {
  position: absolute;
  inset: 0;
  color: #fff;
  font-size: 7px;
  line-height: 7px;
  font-weight: 700;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
  white-space: nowrap;
}

.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  min-width: 36px;
  max-width: none;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(15, 15, 15, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
  white-space: pre;
}

.pet-bubble {
  color: #66d9ff;
}

.hidden {
  display: none !important;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  pointer-events: auto;
}

.loading-box {
  width: min(380px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(20, 22, 18, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.loading-box h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.loading-box p {
  min-height: 20px;
  margin: 0 0 14px;
  color: #e8ddb0;
  font-size: 14px;
}

#loadingPercent {
  color: #f7e69e;
  font-variant-numeric: tabular-nums;
}

.loading-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

#loadingBarFill {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6c071, #f6e7a2);
  transition: width 0.22s ease;
}

.loading-screen.error .loading-box {
  border-color: rgba(255, 118, 118, 0.55);
}

.loading-screen.error #loadingBarFill {
  background: #e77474;
}

.connection-lost {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.84);
  pointer-events: auto;
}

.connection-lost-box {
  width: min(400px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid rgba(255, 217, 112, 0.4);
  border-radius: 8px;
  background: rgba(16, 17, 15, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.connection-lost-box h1 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #f7e69e;
}

.connection-lost-box p {
  margin: 0 0 18px;
  color: #f4f5ec;
  font-size: 15px;
}

.connection-lost-box button {
  width: 100%;
}

.connection-lost-box button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(24, 25, 22, 0.88);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.login {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  transform: translate(-50%, -50%);
}

.login h1,
.drawer h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.login {
  display: grid;
  gap: 12px;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.login-tabs button {
  min-height: 30px;
  padding-inline: 5px;
  background: rgba(255, 255, 255, 0.09);
  color: #f4f5ec;
  font-size: 12px;
}

.login-tabs button.active {
  background: #b9a769;
  color: #14130f;
}

.login-message {
  min-height: 18px;
  margin: 0;
  color: #ffd56a;
  font-size: 12px;
}

.login-remember-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-remember-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: #e9ebdf;
  white-space: nowrap;
}

.login-remember-options input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #cdb866;
}

.saved-accounts-panel {
  display: grid;
  gap: 9px;
}

.saved-accounts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f1e7bd;
  font-size: 13px;
}

.saved-accounts-heading span {
  color: #aeb9aa;
  font-variant-numeric: tabular-nums;
}

.saved-accounts-list {
  display: grid;
  gap: 6px;
  max-height: min(310px, 42vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-right: 2px;
}

.saved-accounts-empty {
  margin: 0;
  padding: 24px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #aeb9aa;
  text-align: center;
  font-size: 12px;
}

.saved-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 6px 5px 9px;
  border: 1px solid rgba(128, 177, 143, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.saved-account-identity,
.saved-account-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.saved-account-identity strong {
  overflow: hidden;
  color: #f4f5ec;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-account-number {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: rgba(205, 184, 102, 0.2);
  color: #f5dc7c;
  font-size: 11px;
  font-weight: 700;
}

.saved-account-actions button {
  width: auto;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
}

.saved-account-actions .saved-account-remove {
  border-color: rgba(203, 98, 98, 0.4);
  background: rgba(100, 35, 39, 0.72);
  color: #ffd9d9;
}

.saved-account-add-button {
  border-style: dashed;
  background: rgba(63, 82, 67, 0.78);
  color: #edf4ed;
}

.saved-account-add-form {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(128, 177, 143, 0.3);
  border-radius: 6px;
  background: rgba(6, 12, 8, 0.46);
}

.saved-account-add-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.saved-account-add-actions button:last-child {
  background: rgba(255, 255, 255, 0.09);
  color: #f4f5ec;
}

@media (max-width: 380px) {
  .saved-account-row {
    grid-template-columns: 1fr;
  }

  .saved-account-actions button:first-child {
    flex: 1;
  }
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

input,
button {
  font: inherit;
}

input {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  background: #b9a769;
  color: #14130f;
  font-weight: 700;
  cursor: pointer;
}

.login button {
  width: 100%;
}

.login .text-button {
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #d8c77d;
  text-align: center;
}

.password-reset {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.password-reset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.password-reset-actions button:last-child {
  background: rgba(255, 255, 255, 0.09);
  color: #f4f5ec;
}

.gender-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.gender-select label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.gender-select input {
  min-height: auto;
  margin: 0;
}

@media (any-pointer: fine) {
  :root {
    --neverland-cursor: url("/public/assets/icons/mousep-32.png") 1 1, auto;
    --neverland-pickup-cursor: url("/public/assets/icons/cursor-pickup-idle-1-32.png") 1 1, auto;
    --neverland-pickup-cursor-2: url("/public/assets/icons/cursor-pickup-idle-2-32.png") 1 1, auto;
    --neverland-portal-cursor: url("/public/assets/icons/cursor-portal-idle-1-32.png") 1 1, auto;
    --neverland-portal-cursor-2: url("/public/assets/icons/cursor-portal-idle-2-32.png") 1 1, auto;
    --neverland-npc-cursor: url("/public/assets/icons/cursor-npc-idle-1-32.png") 1 1, auto;
    --neverland-npc-cursor-2: url("/public/assets/icons/cursor-npc-idle-2-32.png") 1 1, auto;
  }

  html,
  body,
  #game,
  .hud,
  button:not(:disabled),
  .slot,
  .shop-item,
  .trash-trade-item,
  .skill-item,
  .chat-tab,
  .ox-status-toggle,
  #onlineCountLabel.gm-clickable {
    cursor: var(--neverland-cursor);
  }

  input,
  textarea,
  select,
  option {
    cursor: auto;
  }

  button:disabled,
  .connection-lost-box button:disabled {
    cursor: wait;
  }

  body.pickup-cursor,
  body.pickup-cursor #game,
  #game.pickup-cursor {
    cursor: none !important;
  }

  body.pickup-cursor.cursor-frame-2,
  body.pickup-cursor.cursor-frame-2 #game,
  #game.pickup-cursor.cursor-frame-2 {
    cursor: none !important;
  }

  body.portal-cursor,
  body.portal-cursor #game,
  #game.portal-cursor {
    cursor: none !important;
  }

  body.portal-cursor.cursor-frame-2,
  body.portal-cursor.cursor-frame-2 #game,
  #game.portal-cursor.cursor-frame-2 {
    cursor: none !important;
  }

  body.npc-cursor,
  body.npc-cursor #game,
  #game.npc-cursor {
    cursor: none !important;
  }

  body.npc-cursor.cursor-frame-2,
  body.npc-cursor.cursor-frame-2 #game,
  #game.npc-cursor.cursor-frame-2 {
    cursor: none !important;
  }

  body.seat-cursor,
  body.seat-cursor #game,
  #game.seat-cursor,
  body.seat-cursor.cursor-frame-2,
  body.seat-cursor.cursor-frame-2 #game,
  #game.seat-cursor.cursor-frame-2 {
    cursor: none !important;
  }

  #game {
    cursor: none !important;
  }

  body.game-custom-cursor-visible,
  body.game-custom-cursor-visible *,
  body.game-custom-cursor-visible #game {
    cursor: none !important;
  }

  .game-custom-cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483647;
    display: none;
    width: 32px;
    height: 32px;
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
  }

  body.game-custom-cursor-visible .game-custom-cursor {
    display: block;
  }
}

@media (any-pointer: fine) and (max-width: 900px), (any-pointer: fine) and (max-height: 650px) {
  :root {
    --neverland-cursor: url("/public/assets/icons/mousep-24.png") 1 1, auto;
    --neverland-pickup-cursor: url("/public/assets/icons/cursor-pickup-idle-1-24.png") 1 1, auto;
    --neverland-pickup-cursor-2: url("/public/assets/icons/cursor-pickup-idle-2-24.png") 1 1, auto;
    --neverland-portal-cursor: url("/public/assets/icons/cursor-portal-idle-1-24.png") 1 1, auto;
    --neverland-portal-cursor-2: url("/public/assets/icons/cursor-portal-idle-2-24.png") 1 1, auto;
    --neverland-npc-cursor: url("/public/assets/icons/cursor-npc-idle-1-24.png") 1 1, auto;
    --neverland-npc-cursor-2: url("/public/assets/icons/cursor-npc-idle-2-24.png") 1 1, auto;
  }

  .game-custom-cursor {
    width: 24px;
    height: 24px;
  }
}

.hud {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.statusbar,
.toolbar,
.quicktravel,
.chat,
.ox-status-toggle,
.mobile-joystick,
.fishing-start,
.character-rotate,
.fishing-panel,
.confirm-dialog,
.drawer {
  pointer-events: auto;
}

.statusbar {
  position: fixed;
  top: calc(var(--vv-top) + 10px);
  left: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(13, 16, 14, 0.72);
  font-size: 13px;
}

#onlineCountLabel.gm-clickable {
  cursor: pointer;
  color: #fff06a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ox-status-wrap {
  position: fixed;
  top: calc(var(--vv-top) + 46px);
  left: 50%;
  z-index: 6;
  width: min(760px, calc(100vw - 40px));
  transform: translateX(-50%);
  pointer-events: none;
}

.ox-status {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 13px 22px;
  border: 1px solid rgba(224, 209, 165, 0.5);
  border-radius: 3px;
  background:
    linear-gradient(rgba(12, 11, 8, 0.78), rgba(12, 11, 8, 0.78)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  color: #eee7cf;
  font-size: 15px;
  line-height: 1.55;
  pointer-events: none;
  text-shadow: 1px 1px 1px #000;
}

.ox-status-toggle {
  position: relative;
  display: block;
  width: auto;
  min-height: 25px;
  margin: 5px 0 0 auto;
  padding: 2px 10px;
  border-radius: 5px;
  background: rgba(185, 167, 105, 0.92);
  font-size: 12px;
  pointer-events: auto;
}

.ox-status.collapsed {
  display: none !important;
}

.ox-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ox-line strong {
  color: #fff;
}

.ox-question-line,
.ox-choice-list {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.ox-choice-list {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.ox-choice-line {
  line-height: 1.25;
}

.ox-choice-line strong {
  color: #fff;
}

.toolbar {
  position: fixed;
  left: 74px;
  top: calc(var(--vv-top) + 52px);
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(13, 16, 14, 0.56);
  backdrop-filter: blur(2px);
}

.toolbar button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.quicktravel {
  position: fixed;
  left: 10px;
  top: calc(var(--vv-top) + 52px);
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: min(620px, calc(100vw - 20px));
}

.quicktravel button {
  min-height: 28px;
  padding: 4px 8px;
  background: rgba(185, 167, 105, 0.92);
  font-size: 12px;
}

.quicktravel .ox-status-toggle {
  width: auto;
  margin: 0;
}

.drawer {
  position: fixed;
  right: 10px;
  bottom: 154px;
  width: min(360px, calc(100vw - 20px));
  max-height: min(62vh, 500px);
  padding: 12px;
  overflow: auto;
}

@media (pointer: fine) and (max-width: 900px), (pointer: fine) and (max-height: 650px) {
  .drawer,
  .bottom-menu,
  .player-info-pop,
  .gift-panel,
  .private-chat {
    max-width: calc(var(--vv-width) - 16px);
    max-height: calc(var(--vv-height) - 96px);
    padding: 10px;
    overflow: auto;
  }

  .drawer {
    right: 8px;
    bottom: 86px;
    width: min(320px, calc(var(--vv-width) - 16px));
  }

  .bottom-menu {
    left: calc(var(--vv-left) + 8px);
    top: calc(var(--vv-top) + 64px);
    width: min(320px, calc(var(--vv-width) - 16px));
  }

  #inventory,
  #shop,
  #admin {
    width: min(340px, calc(var(--vv-width) - 16px));
  }

  .slots,
  .shop-grid,
  .trash-trade-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 5px;
  }

  .slot,
  .shop-item,
  .trash-trade-item {
    min-height: 54px;
    padding: 4px;
  }
}

@media (pointer: fine) and (max-height: 520px) {
  .drawer {
    bottom: 62px;
    max-height: calc(var(--vv-height) - 76px);
  }

  .bottom-menu {
    top: calc(var(--vv-top) + 8px);
    max-height: calc(var(--vv-height) - 76px);
  }
}

.panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.76);
  color: #fff7c7;
  font-size: 18px;
  line-height: 1;
  pointer-events: auto;
}

.panel-close:hover,
.panel-close:focus-visible {
  background: rgba(185, 167, 105, 0.95);
  color: #17140f;
}

.memory-game {
  width: min(380px, calc(100vw - 20px));
  max-height: min(82vh, 620px);
  overflow: hidden;
}

.memory-game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #fff4b8;
  font-size: 14px;
}

.memory-game-recipe {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 244, 184, 0.22);
  border-radius: 5px;
  background: rgba(8, 9, 8, 0.42);
  color: #eee9d2;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.memory-game-recipe:focus-visible {
  outline: 2px solid #e2c870;
  outline-offset: 1px;
}

.memory-game-recipe > div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
}

.memory-game-recipe img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.memory-game-recipe b {
  color: #e2c870;
}

.memory-game-recipe small {
  color: #bfc7bd;
  font-size: 11px;
}

.craft-game-help {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.craft-game-help small {
  color: #bfc7bd;
  font-size: 11px;
  line-height: 1.3;
}

.craft-materials-button {
  min-height: 28px;
  padding: 4px 9px;
  white-space: nowrap;
}

.memory-game-status {
  min-height: 20px;
  margin-bottom: 8px;
  color: #d9ddd8;
  font-size: 12px;
  text-align: center;
}

.craft-game-gauge {
  height: 18px;
  margin: -1px 0 7px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid #777d74;
  border-radius: 4px;
  background: #171a17;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.75);
}

.craft-game-gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: #d5bd55;
  box-shadow: 0 0 5px rgba(255, 224, 91, 0.55);
  transition: width 180ms ease;
}

.craft-game-gauge.magic span {
  background: #a77ae0;
  box-shadow: 0 0 5px rgba(190, 132, 255, 0.65);
}

.craft-game-gauge.complete span {
  background: #73d38d;
  box-shadow: 0 0 7px rgba(104, 235, 140, 0.75);
}

.memory-game-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.memory-game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.memory-game-result {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  display: grid;
  place-items: center;
  gap: 5px;
  width: min(72%, 220px);
  min-height: 112px;
  padding: 12px;
  border: 2px solid #d7ca8a;
  border-radius: 6px;
  background: rgba(16, 17, 15, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72);
  color: #f7f1d6;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.memory-game-result.hidden {
  display: none;
}

.memory-game-result img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.memory-game-result strong {
  color: #ffe67b;
  font-size: 19px;
}

.memory-game-result span {
  font-size: 12px;
  line-height: 1.3;
}

.memory-game-result.failure {
  border-color: #d96a6a;
}

.memory-game-result.failure strong {
  color: #ff8585;
}

.memory-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 184, 0.35);
  border-radius: 5px;
  background: #30342f;
  color: #fff4b8;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.memory-card::before {
  content: "?";
}

.memory-card img {
  display: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.memory-card.revealed,
.memory-card.matched {
  background: #f0ead2;
}

.memory-card.revealed::before,
.memory-card.matched::before {
  display: none;
}

.memory-card.revealed img,
.memory-card.matched img {
  display: block;
}

.memory-card.matched {
  border-color: #7bd89b;
  box-shadow: inset 0 0 0 2px rgba(54, 145, 88, 0.5);
  opacity: 0.68;
}

.memory-card.bomb.revealed {
  border-color: #ff6b6b;
  background: #3c1818;
}

.memory-card.bomb.revealed::after {
  content: "!";
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: #ff6b6b;
  font-size: 18px;
  text-shadow: 0 1px 2px #000;
}

.memory-game-start {
  width: 100%;
  margin-top: 9px;
}

.tailor-game {
  width: min(380px, calc(100vw - 20px));
  max-height: min(88vh, 650px);
  overflow: hidden;
}

.tailor-game-stage {
  position: relative;
  height: min(230px, 34vh);
  min-height: 180px;
  overflow: hidden;
  border: 4px solid #536565;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(82, 101, 101, 0.09) 0 1px, transparent 1px 8px),
    #c7cdca;
  box-shadow: inset 0 0 0 2px #879694, inset 0 0 14px rgba(26, 38, 38, 0.22);
}

.tailor-game-lanes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  height: 100%;
}

.tailor-lane {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-right: 1px dashed rgba(68, 83, 83, 0.38);
  border-radius: 0;
  background: transparent;
}

.tailor-lane:last-of-type {
  border-right: 0;
}

.tailor-lane.selected {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 244, 190, 0.36);
}

.tailor-lane.selected::before,
.tailor-lane.selected::after {
  content: "";
  position: absolute;
  top: calc(72% - 19px);
  z-index: 5;
  width: 4px;
  height: 20px;
  border: 0;
  border-radius: 1px;
  opacity: 0.68;
  transform: rotate(9deg);
  transition: width 70ms ease, height 70ms ease, top 70ms ease, transform 70ms ease;
  pointer-events: none;
}

.tailor-lane.selected::before {
  left: calc(50% - 13px);
  background: #f4d64f;
  box-shadow: 0 0 2px rgba(244, 214, 79, 0.6);
}

.tailor-lane.selected::after {
  left: calc(50% + 6px);
  background: #55a7ff;
  box-shadow: 0 0 2px rgba(85, 167, 255, 0.6);
}

.tailor-game-lanes.needle-yellow-down .tailor-lane.selected::before,
.tailor-game-lanes.needle-blue-down .tailor-lane.selected::after {
  top: calc(72% - 4px);
  width: 10px;
  height: 5px;
  border-radius: 2px;
  opacity: 0.76;
  transform: rotate(-18deg);
}

.tailor-game-lanes.needle-yellow-down .tailor-lane.selected::before {
  left: calc(50% - 16px);
}

.tailor-game-lanes.needle-blue-down .tailor-lane.selected::after {
  left: calc(50% + 4px);
}

.tailor-thread {
  position: absolute;
  z-index: 2;
  width: 5px;
  height: 23px;
  border-radius: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}

.tailor-thread.yellow,
.tailor-stitch.thread-yellow {
  left: calc(50% - 13px);
}

.tailor-thread.blue,
.tailor-stitch.thread-blue {
  left: calc(50% + 6px);
}

.tailor-thread.yellow {
  background: #f7e994;
  box-shadow: 0 0 4px rgba(247, 233, 148, 0.5);
}

.tailor-thread.blue {
  background: #9bcfff;
  box-shadow: 0 0 4px rgba(155, 207, 255, 0.5);
}

.tailor-stitch {
  position: absolute;
  z-index: 4;
  width: 8px;
  height: 7px;
  border-radius: 2px;
  transform: translateY(-50%);
  pointer-events: none;
}

.tailor-stitch.yellow {
  background: #e8bd00;
  box-shadow: 0 0 5px rgba(232, 189, 0, 0.9);
}

.tailor-stitch.blue {
  background: #087cde;
  box-shadow: 0 0 5px rgba(8, 124, 222, 0.9);
}

.tailor-stitch.red {
  background: #f04444;
  box-shadow: 0 0 6px rgba(240, 68, 68, 0.95);
}

.tailor-hit-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 72%;
  z-index: 3;
  height: 2px;
  background: repeating-linear-gradient(135deg, #b73535 0 3px, #e87979 3px 5px);
  box-shadow: 0 1px 1px rgba(83, 25, 25, 0.35);
  pointer-events: none;
}

.tailor-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.tailor-needle {
  min-height: 42px;
  font-weight: 700;
}

.tailor-needle.yellow {
  border-color: #d3b63c;
  background: #9a7e16;
  color: #fff6bd;
}

.tailor-needle.blue {
  border-color: #4e96df;
  background: #245f9b;
  color: #dcefff;
}

.cooking-game {
  width: min(380px, calc(100vw - 20px));
  max-height: min(88vh, 650px);
  overflow: hidden;
}

.cooking-game-stage {
  position: relative;
  height: min(270px, 38vh);
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 184, 0.34);
  border-radius: 5px;
  background: #1b1b19;
}

.cooking-pot {
  position: absolute;
  left: 20%;
  top: 52%;
  width: 128px;
  height: 94px;
  transform: translate(-50%, -50%);
}

.cooking-pot::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -20px;
  z-index: 0;
  height: 34px;
  border: 3px solid #8d9290;
  border-radius: 5px;
  background: #414644;
  box-shadow: inset 0 0 0 4px #252927, 0 5px 8px rgba(0, 0, 0, 0.45);
}

.cooking-pot-body {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  z-index: 2;
  height: 62px;
  border: 3px solid #8f9595;
  border-radius: 4px 4px 30px 30px;
  background: #3d4242;
  box-shadow: inset 0 8px 0 #626868, 0 8px 14px rgba(0, 0, 0, 0.45);
}

.cooking-pot-body::before,
.cooking-pot-body::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 22px;
  height: 8px;
  border-radius: 4px;
  background: #818787;
}

.cooking-pot-body::before { left: -22px; }
.cooking-pot-body::after { right: -22px; }

.cooking-pot-lid {
  position: absolute;
  left: 22px;
  top: 20px;
  z-index: 2;
  width: 84px;
  height: 18px;
  border: 3px solid #9ca1a1;
  border-radius: 50% 50% 4px 4px;
  background: #545959;
}

.cooking-flame {
  position: absolute;
  left: 34%;
  bottom: -13px;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 42% 50%;
  background: #378fff;
  box-shadow: 0 0 10px rgba(48, 139, 255, 0.85);
  opacity: var(--flame-opacity, 0.78);
  transform: translateX(-50%) rotate(45deg) scale(var(--flame-scale, 0.7));
  transition: transform 120ms ease, opacity 120ms ease;
}

.cooking-flame::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 42% 50%;
  background: #c9efff;
}

.cooking-flame.second {
  left: 68%;
}

.cooking-game-stage.heating .cooking-flame {
  transform: translateX(-50%) rotate(45deg) scale(1.25);
}

.cooking-game-stage.cooling .cooking-flame {
  opacity: 0.65;
  transform: translateX(-50%) rotate(45deg) scale(0.35);
}

.cooking-pot-lid::before {
  content: "";
  position: absolute;
  left: 34px;
  top: -12px;
  width: 14px;
  height: 10px;
  border-radius: 4px 4px 0 0;
  background: #858a8a;
}

.cooking-pot i {
  position: absolute;
  top: -5px;
  width: 12px;
  height: 38px;
  border-left: 5px solid rgba(232, 239, 239, 0.36);
  border-radius: 50%;
  opacity: 0.15;
}

.cooking-pot i:nth-of-type(1) { left: 36px; }
.cooking-pot i:nth-of-type(2) { left: 60px; height: 48px; top: -15px; }
.cooking-pot i:nth-of-type(3) { left: 82px; }

.cooking-game-stage.heating .cooking-pot i {
  opacity: 0.9;
  animation: cooking-steam 0.8s ease-in-out infinite alternate;
}

@keyframes cooking-steam {
  from { transform: translateY(5px) scaleX(0.85); }
  to { transform: translateY(-8px) scaleX(1.15); }
}

.cooking-thermometer {
  position: absolute;
  left: 62%;
  top: 24px;
  bottom: 24px;
  width: 52px;
  border: 2px solid #777b78;
  border-radius: 7px;
  background: #292c29;
}

.cooking-safe-zone {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 45%;
  height: 10%;
  border-top: 1px solid #87d58c;
  border-bottom: 1px solid #87d58c;
  background: rgba(95, 194, 106, 0.28);
}

.cooking-temperature-fill {
  position: absolute;
  left: 17px;
  bottom: 7px;
  width: 14px;
  height: 0;
  border-radius: 7px;
  background: #e54b45;
  transition: height 100ms linear;
}

.cooking-temperature-marker {
  position: absolute;
  left: -7px;
  bottom: 0;
  width: 64px;
  height: 3px;
  background: #fff1b0;
  box-shadow: 0 0 5px #fff1b0;
  transition: bottom 100ms linear;
}

.cooking-thermometer > span {
  position: absolute;
  left: 60px;
  width: 70px;
  color: #d8ddd8;
  font-size: 11px;
  white-space: nowrap;
}

.cooking-max-label { top: -4px; }
.cooking-safe-label { top: 44%; color: #9ee6a3 !important; }
.cooking-min-label { bottom: -4px; }

.cooking-temperature-text {
  position: absolute;
  left: 58%;
  bottom: 6px;
  width: 90px;
  color: #fff4b8;
  text-align: center;
}

.cooking-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.cooking-control {
  min-height: 46px;
  font-weight: 700;
  touch-action: none;
}

.cooking-control.heat {
  border-color: #d8694b;
  background: #8e3624;
  color: #ffe5cc;
}

.cooking-control.cool {
  border-color: #818a91;
  background: #495158;
  color: #edf0f2;
}

.cooking-control.active {
  filter: brightness(1.35);
  transform: translateY(1px);
}

.cooking-dial-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 92px;
  margin-top: 6px;
  color: #d9ddd8;
  font-size: 13px;
  font-weight: 700;
}

.cooking-knob-wrap {
  display: grid;
  place-items: center;
  gap: 3px;
}

.cooking-fire-knob {
  position: relative;
  width: 64px;
  min-width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  border: 3px solid #8c9290;
  border-radius: 50%;
  background: #3f4442;
  box-shadow: inset 0 0 0 5px #252826, 0 4px 8px rgba(0, 0, 0, 0.45);
  touch-action: none;
}

.cooking-knob-wrap.strong .cooking-fire-knob {
  border-color: #d76555;
}

.cooking-knob-wrap.weak .cooking-fire-knob {
  border-color: #5d9ed2;
}

.cooking-fire-knob i {
  position: absolute;
  left: calc(50% - 2px);
  top: 8px;
  width: 4px;
  height: 17px;
  border-radius: 2px;
  background: #fff2a8;
  transform: rotate(0deg);
  transform-origin: 2px 24px;
  transition: transform 100ms ease;
  pointer-events: none;
}

.cooking-knob-wrap.strong .cooking-fire-knob i {
  background: #ff8b79;
}

.cooking-knob-wrap.weak .cooking-fire-knob i {
  background: #78bfff;
}

.cooking-fire-knob.active i {
  transform: rotate(48deg);
}

.cooking-fire-knob.active {
  filter: brightness(1.25);
}

.cooking-fire-knob:focus-visible {
  outline: 2px solid #fff2a8;
  outline-offset: 2px;
}

.magic-cooking-stage {
  background: #18151d;
}

.magic-cauldron .cooking-pot-body {
  border-color: #88769c;
  background: #3c3048;
  box-shadow: inset 0 8px 0 #675475, 0 8px 14px rgba(0, 0, 0, 0.5);
}

.magic-cauldron .cooking-pot-lid {
  border-color: #a292b0;
  background: #584766;
}

.magic-cauldron::after {
  display: none;
}

.magic-cooking-stage.active-magic .cooking-pot i {
  opacity: 0.95;
  border-left-color: rgba(202, 142, 255, 0.72);
  animation: cooking-steam 0.45s ease-in-out 2 alternate;
}

.cooking-control.magic-heat {
  border-color: #d65f9d;
  background: #87315f;
  color: #ffe0f0;
}

.cooking-control.magic-cool {
  border-color: #796de2;
  background: #453994;
  color: #e4e1ff;
}

.cooking-control.magic-heat:active,
.cooking-control.magic-cool:active {
  filter: brightness(1.4);
  transform: translateY(1px);
}

.admin-glow-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.glow-swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: #222;
  box-shadow: 0 0 6px currentColor;
}

.glow-swatch.rainbow { background: conic-gradient(#ff6685, #ffe45e, #86ef77, #70d6ff, #c77dff, #ff6685); }
.glow-swatch.yellow { color: #ffe45e; background: #ffe45e; }
.glow-swatch.sky { color: #70d6ff; background: #70d6ff; }
.glow-swatch.lime { color: #9bea73; background: #9bea73; }
.glow-swatch.pink { color: #ff86bd; background: #ff86bd; }
.glow-swatch.off { color: #777; background: #222; box-shadow: none; }

@media (max-width: 720px) {
  .memory-game,
  .tailor-game,
  .cooking-game {
    width: min(350px, calc(var(--vv-width) - 12px));
    max-height: calc(var(--vv-height) - 12px);
    overflow: hidden;
  }

  .memory-game-grid {
    gap: 3px;
  }

  .memory-card {
    padding: 2px;
  }

  .memory-game-recipe {
    gap: 2px;
    margin-bottom: 4px;
    padding: 5px;
  }

  .memory-game-status {
    min-height: 17px;
    margin-bottom: 4px;
  }

  .craft-game-gauge {
    margin-bottom: 4px;
  }

  .tailor-game-stage {
    height: min(180px, 32vh);
    min-height: 145px;
  }

  .tailor-controls {
    margin-top: 5px;
  }

  .tailor-needle {
    min-height: 36px;
  }

  .cooking-game-stage {
    height: min(180px, 31vh);
    min-height: 150px;
  }

  .cooking-pot {
    transform: translate(-50%, -50%) scale(0.78);
  }

  .cooking-thermometer {
    top: 12px;
    bottom: 12px;
  }

  .cooking-dial-control {
    min-height: 70px;
    margin-top: 3px;
  }

  .cooking-fire-knob {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .cooking-fire-knob i {
    top: 6px;
    height: 14px;
    transform-origin: 2px 20px;
  }

  .cooking-controls {
    margin-top: 5px;
  }

  .cooking-control {
    min-height: 38px;
  }

  .memory-game-start {
    min-height: 36px;
    margin-top: 5px;
  }
}

@media (max-height: 560px) {
  .tailor-game,
  .cooking-game {
    max-height: calc(var(--vv-height) - 8px);
    overflow: hidden;
  }

  .tailor-game-stage,
  .cooking-game-stage {
    height: 118px;
    min-height: 118px;
  }

  .tailor-game .memory-game-recipe,
  .cooking-game .memory-game-recipe {
    min-height: 20px;
    margin-bottom: 2px;
    padding: 3px;
    font-size: 10px;
  }

  .tailor-game .memory-game-recipe img,
  .cooking-game .memory-game-recipe img {
    width: 19px;
    height: 19px;
  }

  .tailor-game .memory-game-status,
  .cooking-game .memory-game-status,
  .tailor-game .craft-game-gauge,
  .cooking-game .craft-game-gauge {
    margin-bottom: 2px;
  }

  .tailor-controls,
  .cooking-controls,
  .cooking-dial-control {
    margin-top: 2px;
  }

  .tailor-needle,
  .cooking-control,
  .memory-game-start {
    min-height: 30px;
  }

  .cooking-dial-control {
    min-height: 48px;
  }

  .cooking-fire-knob {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}

.maze-exit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.maze-exit-actions button {
  min-height: 42px;
}

.maze-guardian-trade-open {
  grid-column: 1 / -1;
}

.maze-exchange-body {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
  color: #f5edc9;
  font-size: 13px;
  text-align: center;
}

.maze-exchange-stamps {
  margin-bottom: 8px;
}

.maze-exchange-list {
  display: grid;
  gap: 6px;
}

.maze-exchange-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.maze-exchange-entry > button {
  min-height: 46px;
  padding: 4px 6px;
}

.maze-exchange-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.24);
  text-align: left;
}

.maze-exchange-item .item-icon {
  width: 32px;
  height: 32px;
}

.maze-exchange-item .item-name {
  width: auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
}

.maze-exchange-cost {
  color: #f0d96b;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .maze-exchange-entry {
    grid-template-columns: minmax(0, 1fr) 50px;
  }

  .maze-exchange-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .maze-exchange-item .item-icon {
    width: 26px;
    height: 26px;
  }

  .maze-exchange-cost {
    grid-column: 2;
  }
}

.maze-guardian-trade-panel {
  width: min(430px, calc(100vw - 20px));
  max-height: min(620px, calc(100dvh - 20px));
  overflow: auto;
}

.maze-guardian-trade-help {
  margin-bottom: 10px;
  color: #e7e2cb;
  font-size: 13px;
  text-align: center;
}

.maze-guardian-trade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.maze-guardian-trade-entry {
  display: grid;
  grid-template-rows: minmax(74px, 1fr) 34px;
  gap: 5px;
  min-width: 0;
}

.maze-guardian-trade-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.24);
  text-align: center;
}

.maze-guardian-trade-item .item-name {
  font-size: 11px;
}

.maze-guardian-owned {
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: #f5edc9;
  font-size: 10px;
}

@media (max-width: 520px) {
  .maze-guardian-trade-panel {
    max-height: calc(100dvh - 12px);
  }

  .maze-guardian-trade-grid {
    gap: 6px;
  }

  .maze-guardian-trade-entry {
    grid-template-rows: minmax(64px, 1fr) 32px;
  }
}

.maze-buff-buy {
  width: 100%;
  min-height: 44px;
  font-weight: 700;
}

.maze-buff-description {
  margin-top: 10px;
  color: #e7e2cb;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.relationship-panel {
  width: min(360px, calc(100vw - 20px));
}

.relationship-status {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
  color: #f6efd8;
  font-size: 13px;
  text-align: center;
}

.relationship-menu-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.relationship-menu-button,
.relationship-submit {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-weight: 800;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

.relationship-menu-button.marriage,
.relationship-submit.marriage {
  background: #c94c78;
}

.relationship-menu-button.divorce,
.relationship-submit.divorce {
  background: #416fae;
}

.relationship-submit.forced-divorce {
  background: #7f3434;
}

.relationship-menu-button.active {
  outline: 2px solid #fff4bc;
  outline-offset: -3px;
}

.relationship-form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 152, 190, 0.38);
  border-radius: 6px;
  background: rgba(94, 28, 54, 0.3);
}

.relationship-form.divorce {
  border-color: rgba(126, 177, 240, 0.4);
  background: rgba(29, 57, 94, 0.34);
}

.relationship-form label {
  color: #ffd6e5;
  font-size: 13px;
  font-weight: 700;
}

.relationship-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.relationship-form p {
  margin: 0;
  color: #e9e5d8;
  font-size: 12px;
  line-height: 1.55;
}

.bottom-menu {
  left: 10px;
  top: calc(var(--vv-top) + 88px);
  width: min(360px, calc(100vw - 20px));
  transform: none;
}

.drag-handle {
  cursor: move;
  user-select: none;
  touch-action: none;
  padding-right: 24px;
}

.dragging {
  opacity: 0.94;
  user-select: none;
}

.map-grid {
  display: grid;
  gap: 8px;
}

.map-grid button {
  justify-content: flex-start;
  min-height: 38px;
  text-align: left;
}

.ranking-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-size: 13px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.ranking-row .rank {
  color: #fff06a;
  font-weight: 700;
}

.ranking-row .money {
  color: #f5ffe9;
  font-weight: 700;
}

.online-player-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  font-size: 13px;
}

.online-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.online-player-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.online-player-row .online-name {
  color: #fff06a;
  font-weight: 700;
}

.online-player-row .online-meta {
  color: #f5ffe9;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.online-action-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.online-summon-button,
.online-ban-button {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.online-summon-button:disabled,
.online-ban-button:disabled {
  opacity: 0.45;
}

.job-info {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(231, 208, 69, 0.28);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #f5f0dd;
  font-size: 13px;
  line-height: 1.35;
}

.job-title {
  color: #fff06a;
  font-weight: 800;
}

.fisher-progress-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fisher-auto-toggle {
  margin-top: 6px;
}

.fisher-auto-note {
  margin-top: -2px;
  color: rgba(245, 240, 221, 0.78);
  font-size: 12px;
  line-height: 1.35;
}

.fisher-promote-button {
  min-height: 26px;
  padding: 3px 8px;
  border-color: rgba(255, 240, 106, 0.7);
  background: rgba(221, 196, 103, 0.95);
  color: #17140f;
  font-size: 11px;
  font-weight: 800;
}

.fish-sell-box {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(231, 208, 69, 0.22);
}

.fish-sell-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px auto;
  gap: 6px;
  align-items: center;
}

.fish-sell-row select,
.fish-sell-row input,
.fish-sell-row button {
  min-width: 0;
  height: 30px;
  font-size: 12px;
}

.fish-sell-row input {
  text-align: center;
}

.fish-sell-preview {
  color: #f5ffe9;
  font-weight: 700;
}

.fish-auto-sell-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #f5ffe9;
  font-size: 12px;
  font-weight: 800;
}

.fish-dex-summary {
  color: #f5ffe9;
  font-weight: 800;
}

.fish-dex-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
  max-height: 260px;
  padding: 4px;
  overflow: auto;
  border: 1px solid rgba(231, 208, 69, 0.22);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.18);
}

.fish-dex-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 0;
  padding: 2px;
  border: 1px solid rgba(231, 208, 69, 0.22);
  border-radius: 4px;
  background: rgba(16, 18, 16, 0.7);
  overflow: hidden;
}

.fish-dex-cell img {
  max-width: 92%;
  max-height: 80%;
  image-rendering: pixelated;
}

.fish-dex-cell.locked img {
  filter: grayscale(1) brightness(0.45);
  opacity: 0.68;
}

.fish-dex-cell.discovered {
  background: rgba(56, 80, 58, 0.72);
}

.fish-dex-cell.selected {
  border-color: #fff06a;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 106, 0.8);
}

.fish-dex-detail {
  min-height: 52px;
  padding: 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
  color: #f5f0dd;
}

.friend-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.friend-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7f1d6;
  text-align: left;
}

.friend-remove {
  min-height: 38px;
  padding: 5px 8px;
  border-color: rgba(255, 118, 118, 0.42);
  background: rgba(112, 38, 38, 0.82);
  color: #fff0e8;
  font-size: 12px;
}

.friend-row.online .friend-state {
  color: #89ff78;
}

.friend-row.offline .friend-state {
  color: rgba(247, 241, 214, 0.52);
}

.friend-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-state {
  font-size: 11px;
  font-weight: 800;
}

.guild-current {
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid rgba(231, 208, 69, 0.24);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8f0c6;
  font-size: 13px;
  font-weight: 800;
}

.guild-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.guild-list {
  display: grid;
  gap: 6px;
}

.guild-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
}

.guild-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
}

.guild-member-actions,
.guild-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.guild-action-button,
.guild-mini-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.guild-action-button.danger,
.guild-mini-button.danger {
  border-color: rgba(255, 105, 105, 0.55);
  color: #ffd2d2;
}

.guild-row-title {
  display: grid;
  gap: 2px;
}

.guild-row-name {
  overflow: hidden;
  color: #fff4a8;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-row-name.leader {
  color: #d60404;
}

.guild-row-name.officer {
  color: #0435d6;
}

.guild-row-name.member {
  color: #39d501;
}

.guild-row-name.pending {
  color: #ffa640;
}

.guild-row-meta {
  color: rgba(247, 241, 214, 0.68);
  font-size: 11px;
  font-weight: 800;
}

.guild-row button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.guild-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 12px;
  font-weight: 900;
  text-shadow: 1px 1px 1px #000;
  white-space: nowrap;
}

.guild-label.leader {
  color: #d60404;
}

.guild-label.officer {
  color: #0435d6;
}

.guild-label.member {
  color: #39d501;
}

.guild-label.pending {
  color: #ffa640;
}

.player-info-pop {
  position: fixed;
  z-index: 24;
  width: min(250px, calc(100vw - 20px));
  padding: 12px;
  pointer-events: auto;
}

.player-info-close-x {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f1d6;
  font-size: 17px;
  line-height: 1;
}

.player-info-pop h2 {
  margin: 0 28px 8px 0;
  color: #fff4a8;
  font-size: 17px;
}

.player-info-stats {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  color: #f5f0dd;
  font-size: 13px;
}

.player-info-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.player-info-actions button {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.gift-panel {
  position: fixed;
  right: 380px;
  bottom: 154px;
  width: min(300px, calc(100vw - 20px));
  padding: 12px;
  pointer-events: auto;
}

.gift-panel h2 {
  margin: 0 0 10px;
  padding-right: 24px;
  font-size: 17px;
}

.gift-target {
  margin-bottom: 10px;
  color: #fff4a8;
  font-size: 13px;
  font-weight: 800;
}

.gift-panel label {
  margin-bottom: 8px;
}

.gift-panel select {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.gift-panel option {
  background: #20231e;
  color: #fff;
}

.gift-panel #giftSendButton {
  width: 100%;
}

.private-chat {
  position: fixed;
  right: 380px;
  bottom: 154px;
  width: min(330px, calc(100vw - 20px));
  max-height: min(58vh, 440px);
  padding: 12px;
  overflow: hidden;
  pointer-events: auto;
}

.private-chat h2 {
  margin: 0 0 10px;
  padding-right: 24px;
  font-size: 17px;
}

.private-chat-log {
  display: grid;
  align-content: start;
  gap: 5px;
  height: 210px;
  max-height: 34vh;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(224, 209, 165, 0.24);
  border-radius: 5px;
  background: rgba(6, 8, 6, 0.45);
  font-size: 12px;
}

.private-chat-line {
  line-height: 1.35;
  word-break: break-word;
}

.private-chat-line.mine {
  color: #fff3a6;
}

.private-chat-line.theirs {
  color: #dfffe0;
}

.private-chat-form {
  display: grid;
  grid-template-columns: 1fr 66px;
  gap: 6px;
  margin-top: 8px;
}

.private-chat-form input,
.private-chat-form button {
  min-height: 32px;
}

.equip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.drop-mode-button {
  width: 100%;
  margin-bottom: 10px;
  min-height: 32px;
  background: rgba(54, 58, 50, 0.92);
}

.drop-mode-button.active {
  border-color: rgba(255, 225, 82, 0.95);
  background: rgba(150, 72, 54, 0.94);
  color: #fff8be;
}

.food-tools {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid rgba(224, 209, 165, 0.24);
  border-radius: 6px;
  background: rgba(14, 18, 14, 0.42);
}

.food-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.food-tool-row label {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  font-size: 12px;
}

.food-tool-row select {
  max-width: 170px;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid rgba(224, 209, 165, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #f7f0d4;
}

.food-tool-row button {
  min-height: 30px;
  padding: 4px 10px;
}

.food-threshold input[type="range"] {
  width: 96px;
}

.food-threshold output {
  min-width: 34px;
  color: #fff0a0;
  font-weight: 700;
}

.slots,
.shop-grid,
.trash-trade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.slot,
.shop-item,
.trash-trade-item {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 1px solid rgba(231, 208, 69, 0.78);
  border-radius: 4px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  overflow: hidden;
}

.trash-trade-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px;
  min-width: 0;
}

.shop-sell-box {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(231, 208, 69, 0.28);
}

.shop-sell-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.shop-sell-row select,
.shop-sell-row input,
.shop-sell-row button {
  min-width: 0;
  height: 30px;
  font-size: 12px;
}

.shop-sell-row select {
  flex: 1 1 170px;
}

.shop-sell-row input {
  width: 58px;
  text-align: center;
}

.shop-sell-row button {
  padding: 0 8px;
}

.shop-sell-preview,
.shop-sell-empty {
  color: #f5ffe9;
  font-size: 12px;
  font-weight: 700;
}

.trash-trade-item {
  min-height: 82px;
}

.trash-trade-entry .trash-trade-item {
  width: 100%;
  min-width: 0;
}

.trash-trade-all {
  min-width: 0;
  min-height: 82px;
  border: 1px solid rgba(231, 208, 69, 0.82);
  border-radius: 4px;
  padding: 0;
  background: rgba(198, 178, 103, 0.92);
  color: #141509;
  font-size: 11px;
  font-weight: 900;
}

.trash-trade-all:hover {
  background: #ead580;
}

.trash-trade-all:active {
  transform: translateY(1px);
}

.trash-trade-entry.single {
  grid-template-columns: 1fr;
}

.trash-trade-entry.single .trash-trade-item {
  grid-column: 1 / -1;
}

.trash-trade-count,
.trash-trade-exp {
  color: #fff7bc;
  font-size: 10px;
  line-height: 1.15;
}

.trash-trade-empty {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid rgba(231, 208, 69, 0.32);
  border-radius: 4px;
  color: #f7f1d6;
  font-size: 13px;
  text-align: center;
}

.item-icon {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.45));
}

.item-name {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: #f7f1d6;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-price {
  color: #fff7bc;
  font-size: 10px;
  line-height: 1;
}

.item-fallback {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff7bc;
  font-size: 9px;
  text-align: center;
}

.slot.equipped {
  border-color: #7ee36f;
  background: rgba(86, 160, 70, 0.34);
  color: #f5ffe9;
}

.equipped-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(39, 118, 36, 0.88);
  color: #fff;
  font-size: 9px;
  line-height: 1.2;
}

.stack-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 22px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(15, 16, 12, 0.86);
  color: #fff4a6;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
}

.item-uses {
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 28px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(15, 16, 12, 0.86);
  color: #b9ecff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-shadow: 1px 1px 1px #000;
}

.item-tooltip {
  position: fixed;
  z-index: 80;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 9px 10px;
  border: 1px solid rgba(231, 208, 69, 0.72);
  border-radius: 4px;
  background: rgba(16, 18, 15, 0.96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  color: #f9f5db;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

.item-tooltip-name {
  color: #fff2a6;
  font-size: 13px;
  font-weight: 800;
}

.item-tooltip-id {
  margin-bottom: 5px;
  color: rgba(249, 245, 219, 0.58);
  font-size: 10px;
}

.item-tooltip-line {
  margin-top: 2px;
  white-space: normal;
}

.item-tooltip-line.combat-set-inactive {
  color: rgba(210, 210, 210, 0.58);
}

.item-tooltip-line.combat-set-active {
  color: #ff9f2f;
  font-weight: 800;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.confirm-box {
  width: min(300px, calc(100vw - 40px));
  padding: 18px 20px;
  border: 1px solid rgba(224, 209, 165, 0.5);
  border-radius: 5px;
  background: rgba(28, 30, 28, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.confirm-message {
  margin-bottom: 14px;
  color: #f5f0dd;
  font-weight: 700;
  line-height: 1.45;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-actions button {
  min-height: 34px;
  pointer-events: auto;
}

.craft-materials-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.craft-materials-box {
  position: relative;
  width: min(390px, calc(100vw - 20px));
  max-height: min(520px, calc(100dvh - 20px));
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(224, 209, 165, 0.55);
  border-radius: 5px;
  background: rgba(28, 30, 28, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  color: #f5f0dd;
}

.craft-materials-box h2 {
  margin: 0 30px 10px 0;
  font-size: 16px;
  letter-spacing: 0;
}

.craft-materials-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.craft-materials-rule {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 244, 184, 0.2);
  border-radius: 4px;
  background: rgba(8, 9, 8, 0.44);
  color: #e8e2cb;
  font-size: 12px;
  text-align: center;
}

.craft-materials-rule strong {
  color: #f0cf64;
}

.craft-materials-list {
  display: grid;
  gap: 7px;
}

.craft-recipe-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(224, 209, 165, 0.2);
  border-radius: 4px;
  background: rgba(8, 9, 8, 0.35);
}

.craft-recipe-card > strong {
  color: #fff4b8;
  font-size: 12px;
}

.craft-recipe-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.craft-recipe-heading > strong {
  color: #fff4b8;
  font-size: 12px;
}

.craft-recipe-heading button {
  min-width: 50px;
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}

.craft-recipe-heading button.selected {
  border-color: #f0cf64;
  background: #8d7428;
  color: #fff8d8;
}

.craft-recipe-formula,
.craft-recipe-alternatives,
.craft-recipe-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.craft-recipe-formula {
  flex-wrap: nowrap;
  gap: 3px;
  color: #e2c870;
  font-size: 10px;
}

.craft-recipe-alternatives {
  flex-wrap: nowrap;
  gap: 3px;
}

.craft-recipe-item {
  color: #f1eddd;
  gap: 3px;
  white-space: nowrap;
}

.craft-recipe-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.craft-material-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(224, 209, 165, 0.2);
  border-radius: 4px;
  background: rgba(8, 9, 8, 0.35);
}

@media (max-width: 520px) {
  .craft-game-help {
    gap: 5px;
    margin-bottom: 4px;
  }

  .craft-materials-button {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .craft-game-help small {
    font-size: 10px;
  }
}

.craft-material-row img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.craft-material-row div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.craft-material-row strong {
  color: #fff4b8;
  font-size: 13px;
}

.craft-material-row span {
  color: #e2c870;
  font-size: 11px;
}

.craft-material-row small {
  color: #c8cbc2;
  font-size: 11px;
  line-height: 1.35;
}

.minigame-menu-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.minigame-menu-box {
  position: relative;
  width: min(330px, calc(100vw - 20px));
  padding: 14px;
  border: 1px solid rgba(224, 209, 165, 0.55);
  border-radius: 5px;
  background: rgba(28, 30, 28, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  color: #f5f0dd;
}

.minigame-menu-box h2 {
  margin: 0 30px 12px 0;
  font-size: 16px;
  letter-spacing: 0;
}

.minigame-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.minigame-menu-grid button {
  min-height: 44px;
  color: #f5f0dd;
  font-weight: 700;
}

.ox-cheat-sheet {
  position: fixed;
  z-index: 25;
  width: min(190px, calc(var(--vv-width, 100vw) - 24px));
  max-height: min(210px, calc(var(--vv-height, 100vh) - 24px));
  padding: 12px;
  overflow: auto;
  color: #f5f0dd;
  text-align: center;
}

.ox-cheat-sheet h2 {
  margin: 0 28px 10px 0;
  font-size: 16px;
  text-align: left;
}

.ox-cheat-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.ox-cheat-summary {
  margin-bottom: 10px;
  color: #f5e58d;
  font-weight: 800;
  font-size: 12px;
}

.ox-cheat-current-answer {
  display: grid;
  place-items: center;
  min-height: 88px;
  border: 2px solid rgba(255, 238, 90, 0.78);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffef5a;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}

.ox-cheat-list {
  display: grid;
  gap: 6px;
}

.ox-cheat-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border: 1px solid rgba(224, 209, 165, 0.28);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.ox-cheat-row.current {
  border-color: rgba(255, 238, 90, 0.8);
  background: rgba(255, 238, 90, 0.12);
}

.ox-cheat-answer {
  color: #ffef5a;
  font-weight: 900;
  text-align: center;
}

.ox-cheat-question {
  line-height: 1.35;
}

.ox-cheat-empty {
  color: rgba(255, 255, 255, 0.72);
}

.rows {
  display: grid;
  gap: 12px;
}

.rows input[type="color"] {
  width: 64px;
  min-height: 34px;
  padding: 2px;
  vertical-align: middle;
}

.rows select {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(224, 209, 165, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f0dd;
}

#settings select {
  min-height: 34px;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(224, 209, 165, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f0dd;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.check-row input {
  min-height: auto;
}

.mobile-only-setting {
  display: none;
}

.chat {
  position: fixed;
  left: 10px;
  bottom: 10px;
  width: min(560px, calc(100vw - 20px));
  display: grid;
  gap: 5px;
}

.chat-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

.broadcast-notice {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(8, 10, 8, 0.72);
  color: #ffe95a;
  font-weight: 800;
  text-shadow: 0 1px 0 #000, 0 0 5px #000;
  pointer-events: none;
}

.broadcast-notice.hidden {
  display: none;
}

.broadcast-notice.wedding {
  color: #ff8fca;
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(255, 90, 180, 0.8);
}

.fishing-start {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(154px, calc(env(safe-area-inset-bottom) + 146px));
  z-index: 18;
  min-width: 104px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.fishing-start small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.05;
  opacity: 0.82;
}

.fishing-start.auto-stop {
  min-width: 116px;
}

.run-start.active {
  background: #d8c34f;
  box-shadow: 0 0 0 2px rgba(255, 240, 116, 0.42), 0 8px 24px rgba(0, 0, 0, 0.34);
}

.character-rotate {
  display: none;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(116px, calc(env(safe-area-inset-bottom) + 108px));
  z-index: 18;
  min-width: 104px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.fishing-panel {
  position: fixed;
  left: 50%;
  bottom: max(118px, calc(env(safe-area-inset-bottom) + 110px));
  z-index: 25;
  width: min(420px, calc(100vw - 28px));
  padding: 14px;
  transform: translateX(-50%);
}

.fishing-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.fishing-message {
  min-height: 20px;
  margin-bottom: 10px;
  color: #f5e88d;
  font-size: 13px;
}

.fishing-panel.auto-fishing {
  width: min(190px, calc(100vw - 36px));
  padding: 18px 16px;
  border-color: rgba(245, 232, 141, 0.72);
  box-shadow: 0 0 0 2px rgba(229, 199, 76, 0.28), 0 12px 28px rgba(0, 0, 0, 0.34);
  text-align: center;
}

.fishing-panel.auto-fishing h2,
.fishing-panel.auto-fishing .fishing-meter,
.fishing-panel.auto-fishing .fishing-actions {
  display: none;
}

.fishing-panel.auto-fishing .fishing-message {
  min-height: 0;
  margin: 0;
  color: #fff0a8;
  font-size: 16px;
  font-weight: 900;
}

.fishing-meter {
  position: relative;
  height: 42px;
  overflow: hidden;
  border: 4px solid #070807;
  border-radius: 3px;
  background: #f4f4f0;
}

.fishing-success-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%;
  width: 12%;
  background: #27c66a;
}

.fishing-needle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 5px;
  background: #e5263a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.fishing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.fishing-panel button {
  touch-action: manipulation;
}

.fishing-panel button:disabled {
  opacity: 0.92;
  filter: saturate(0.86);
}

.action-bar {
  display: flex;
  gap: 5px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border-radius: 7px;
  background: rgba(8, 10, 8, 0.62);
}

.emotion-panel {
  position: absolute;
  left: 6px;
  bottom: calc(100% + 6px);
  z-index: 5;
  border: 1px solid rgba(128, 177, 143, 0.4);
  background: rgba(10, 16, 12, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.action-bar button {
  width: 30px;
  min-height: 26px;
  padding: 2px 0;
  border-radius: 5px;
  font-size: 12px;
}

.action-bar .action-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.action-bar .action-icon-button:hover,
.action-bar .action-icon-button:active,
.action-bar .action-icon-button:focus-visible {
  background: transparent;
  box-shadow: none;
}

.action-icon-button img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.action-icon-button:hover img {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

.action-bar #activeSkillButton {
  width: 54px;
}

.action-bar button.active {
  background: #e8d35f;
  color: #17180f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.action-bar button:disabled {
  opacity: 0.45;
}

.chat-toggle {
  width: auto;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.skill-help {
  margin: 2px 0 8px;
  color: #e9dec0;
  font-size: 13px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 7px;
}

.skill-item {
  min-height: 82px;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid rgba(236, 217, 118, 0.45);
  background: rgba(12, 14, 10, 0.42);
  color: #f8f0d8;
}

.skill-item.active {
  border-color: #ffe85a;
  background: rgba(80, 50, 8, 0.78);
}

.skill-item .item-icon {
  width: 28px;
  height: 28px;
}

.skill-meta {
  display: block;
  margin-top: 2px;
  color: #d8c78e;
  font-size: 11px;
  line-height: 1.2;
}

.status-vital {
  display: grid;
  grid-template-columns: auto 72px;
  gap: 6px;
  align-items: center;
  color: #f7f1d6;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}

.status-vital-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(245, 232, 178, 0.42);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.48);
}

.status-vital-fill {
  display: block;
  width: 0%;
  height: 100%;
  transition: width 120ms linear;
}

.status-vital.hp .status-vital-fill {
  background: linear-gradient(90deg, #b8182c, #f05a6d);
}

.status-vital.mp .status-vital-fill {
  background: linear-gradient(90deg, #2374d8, #70c8ff);
}

.status-vital.exp .status-vital-fill {
  background: linear-gradient(90deg, #d59c25, #f5df64);
}

.chat.collapsed #chatLog,
.chat.collapsed .chat-tabs {
  display: none;
}

.chat-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px;
  align-items: stretch;
}

.chat-input-row #chatInput {
  width: 100%;
  min-width: 0;
}

.chat-window-controls {
  display: flex;
  gap: 2px;
  align-items: stretch;
}

.chat-window-controls button {
  min-width: 46px;
  min-height: 0;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}

.chat-window-controls button.active {
  background: #eadb92;
  box-shadow: inset 0 0 0 2px rgba(20, 20, 16, 0.32);
}

.chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0;
}

.chat-tabs button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(231, 208, 69, 0.42);
  border-radius: 5px;
  background: rgba(193, 174, 101, 0.72);
  color: #141411;
  font-size: 12px;
  font-weight: 900;
}

.chat-tabs button.active {
  background: #eadb92;
  box-shadow: inset 0 0 0 2px rgba(20, 20, 16, 0.32);
}

.chat-tabs [data-chat-tab="couple"] {
  border-color: rgba(255, 166, 201, 0.72);
  background: rgba(201, 76, 120, 0.82);
  color: #fff;
}

.chat-tabs [data-chat-tab="couple"].active {
  background: #f19abb;
}

.chat-tabs [data-chat-tab="gm"] {
  border-color: rgba(255, 179, 71, 0.75);
  color: #ffd39a;
}

.chat-tabs [data-chat-tab="gm"].active {
  background: rgba(130, 69, 13, 0.92);
  color: #fff3df;
}

.chat-tabs .chat-toggle {
  margin-left: auto;
}

.menu-toggle {
  display: none;
}

.chat.chat-small #chatLog {
  height: 90px;
  min-height: 48px;
}

.chat.chat-large #chatLog {
  height: 190px;
  max-height: min(52vh, 420px);
}

#chatLog {
  height: 130px;
  min-height: 48px;
  max-height: min(42vh, 360px);
  overflow: auto;
  resize: vertical;
  border-radius: 7px;
  padding: 7px 9px;
  background: rgba(8, 10, 8, 0.68);
  font-size: 13px;
  line-height: 1.35;
}

.chat-line,
.private-chat-line {
  white-space: pre-wrap;
}

.chat-line.chat-guild {
  color: #39d501;
}

.chat-line.chat-system {
  color: #e5ddb8;
}

.mobile-joystick {
  position: fixed;
  z-index: 8;
  left: 0;
  top: 0;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  pointer-events: none;
  touch-action: none;
}

.mobile-joystick-base {
  position: relative;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(8, 10, 8, 0.24);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.08), 0 6px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
}

.mobile-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(185, 167, 105, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
  transform: translate(0, 0);
}

@media (max-width: 720px) {
  .statusbar {
    flex-wrap: wrap;
    gap: 7px 10px;
  }

  .status-vital {
    grid-template-columns: auto 52px;
    font-size: 12px;
  }

  .toolbar {
    left: 10px;
    right: 10px;
    top: calc(var(--vv-top) + 88px);
    bottom: auto;
    grid-template-columns: repeat(3, 1fr);
  }

  .drawer {
    left: 10px;
    right: 10px;
    bottom: 136px;
    width: auto;
  }

  .bottom-menu {
    left: 10px;
    right: 10px;
    top: calc(var(--vv-top) + 180px);
    bottom: auto;
    width: auto;
  }

  .ox-status-wrap {
    top: calc(var(--vv-top) + 154px);
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
  }

  .ox-status {
    min-height: 0;
    max-height: min(34vh, 170px);
    padding: 9px 12px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.4;
  }

  .ox-line {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .ox-status-toggle {
    min-height: 22px;
    margin-top: 4px;
    margin-right: max(4px, env(safe-area-inset-right));
    padding: 2px 8px;
    font-size: 11px;
  }

  .mobile-only-setting {
    display: grid;
  }
}

@media (pointer: coarse) {
  .mobile-only-setting {
    display: grid;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .ox-status-wrap {
    top: calc(var(--vv-top) + 188px);
  }

  .ox-status {
    max-height: min(28vh, 150px);
  }
}

@media (pointer: coarse) {
  button {
    min-height: 28px;
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 11px;
  }

  input,
  select {
    min-height: 28px;
    font-size: 12px;
  }

  .statusbar {
    top: calc(var(--vv-top) + max(5px, env(safe-area-inset-top)));
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    right: auto;
    width: calc(var(--vv-width) - 12px);
    gap: 5px 8px;
    min-height: 28px;
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 11px;
  }

  .status-vital {
    grid-template-columns: auto 44px;
    gap: 4px;
    font-size: 11px;
  }

  .status-vital-track {
    height: 7px;
  }

  .quicktravel {
    top: calc(var(--vv-top) + max(42px, calc(env(safe-area-inset-top) + 36px)));
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    max-width: calc(var(--vv-width) - 12px);
    gap: 4px;
  }

  .quicktravel button,
  .toolbar button {
    min-height: 24px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .toolbar {
    top: calc(var(--vv-top) + max(42px, calc(env(safe-area-inset-top) + 36px)));
    left: calc(var(--vv-left) + max(58px, calc(env(safe-area-inset-left) + 54px)));
    max-width: calc(var(--vv-width) - 72px);
    gap: 4px;
    padding: 3px;
    border-radius: 7px;
  }

  .ox-status-wrap {
    top: calc(var(--vv-top) + max(75px, calc(env(safe-area-inset-top) + 68px)));
    left: calc(var(--vv-left) + 8px);
    right: auto;
    width: min(620px, calc(var(--vv-width) - 20px), calc(100vw - 20px));
    transform: none;
  }

  .ox-status {
    min-height: 0;
    padding: 8px 11px;
    font-size: 11px;
    line-height: 1.35;
  }

  .drawer,
  .bottom-menu,
  .gift-panel,
  .private-chat,
  .ox-cheat-sheet {
    padding: 7px;
    font-size: 11px;
  }

  .drawer {
    width: min(292px, calc(100vw - 12px));
    max-height: min(50vh, 350px);
  }

  #settings,
  #beauty {
    width: min(238px, calc(var(--vv-width) - 16px));
    max-height: min(46vh, 300px);
    padding: 7px;
    font-size: 11px;
  }

  .drawer h2,
  .bottom-menu h2,
  .gift-panel h2,
  .private-chat h2,
  .ox-cheat-sheet h2 {
    margin-bottom: 6px;
    font-size: 13px;
  }

  #settings h2,
  #beauty h2 {
    margin-bottom: 6px;
    font-size: 13px;
  }

  #settings label,
  #beauty label {
    gap: 4px;
    margin-bottom: 5px;
    font-size: 11px;
  }

  #settings input[type="range"],
  #beauty input[type="range"] {
    width: 94px;
  }

  #settings select {
    min-height: 26px;
    margin-left: 4px;
    padding: 3px 6px;
    font-size: 11px;
  }

  #settings button {
    min-height: 26px;
    padding: 3px 6px;
    font-size: 11px;
  }

  #beauty input[type="color"] {
    width: 44px;
    min-height: 26px;
  }

  .map-grid {
    gap: 4px;
  }

  .map-grid button {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .ranking-list,
  .job-info,
  .friend-list,
  .guild-list {
    gap: 4px;
    margin-top: 5px;
    font-size: 10px;
  }

  .fish-sell-row {
    grid-template-columns: minmax(0, 1fr) 48px auto;
    gap: 4px;
  }

  .fish-sell-row select,
  .fish-sell-row input,
  .fish-sell-row button {
    height: 24px;
    font-size: 10px;
    padding: 2px 5px;
  }

  .fisher-promote-button {
    min-height: 22px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .fish-dex-grid {
    gap: 2px;
    max-height: 30vh;
    padding: 3px;
  }

  .fish-dex-cell {
    padding: 1px;
    border-radius: 3px;
  }

  .fish-dex-detail {
    min-height: 44px;
    padding: 5px;
  }

  .ranking-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 4px;
    padding: 4px 5px;
  }

  .friend-row,
  .friend-open,
  .guild-row,
  .guild-member-row {
    gap: 4px;
  }

  .friend-open,
  .guild-row,
  .guild-member-row,
  .guild-current {
    min-height: 28px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .friend-remove,
  .guild-row button,
  .guild-action-button,
  .guild-mini-button {
    min-height: 24px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .friend-state,
  .guild-row-meta {
    font-size: 9px;
  }

  .guild-create {
    gap: 4px;
    margin-bottom: 5px;
  }

  .guild-member-actions,
  .guild-footer-actions {
    gap: 3px;
  }

  .player-info-pop,
  .gift-panel,
  .private-chat,
  .ox-cheat-sheet {
    padding: 7px;
    overflow: auto;
    font-size: 11px;
  }

  .player-info-pop,
  .gift-panel,
  .private-chat {
    width: min(238px, calc(var(--vv-width) - 16px));
    max-height: min(46vh, 300px);
  }

  .ox-cheat-sheet {
    width: min(170px, calc(var(--vv-width) - 16px));
    max-height: min(190px, calc(var(--vv-height) - 16px));
  }

  .player-info-pop h2,
  .ox-cheat-sheet h2 {
    margin-bottom: 6px;
    font-size: 13px;
  }

  .ox-cheat-row {
    grid-template-columns: 26px 1fr;
    gap: 5px;
    padding: 5px;
  }

  .ox-cheat-current-answer {
    min-height: 72px;
    font-size: 52px;
  }

  .player-info-stats,
  .gift-target {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .player-info-actions {
    gap: 4px;
  }

  .player-info-actions button {
    min-height: 24px;
    padding: 3px 4px;
    font-size: 10px;
  }

  .gift-panel label {
    margin-bottom: 4px;
  }

  .gift-panel select {
    min-height: 27px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .gift-panel input {
    min-height: 26px;
    padding: 3px 6px;
    font-size: 11px;
  }

  .gift-panel #giftSendButton {
    min-height: 26px;
    font-size: 11px;
  }

  .private-chat {
    max-height: min(48vh, 315px);
  }

  .private-chat-log {
    height: 118px;
    max-height: 24vh;
    padding: 5px;
    font-size: 10px;
  }

  .private-chat-form {
    grid-template-columns: 1fr 52px;
    gap: 4px;
    margin-top: 5px;
  }

  .food-tools {
    gap: 5px;
    margin-bottom: 6px;
    padding: 5px;
  }

  .food-tool-row {
    gap: 5px;
  }

  .food-tool-row label,
  .food-tool-row select,
  .food-tool-row button {
    min-height: 24px;
    font-size: 10px;
  }

  .food-threshold input[type="range"] {
    width: 72px;
  }

  .confirm-box {
    width: min(270px, calc(100vw - 18px));
    padding: 10px;
  }

  .confirm-message {
    font-size: 12px;
  }

  .confirm-actions button {
    min-height: 26px;
    font-size: 11px;
  }

  .panel-close {
    width: 22px;
    min-height: 22px;
    font-size: 14px;
  }

  .slots,
  .shop-grid,
  .trash-trade-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .slot,
  .shop-item,
  .trash-trade-item,
  .skill-item {
    min-height: 45px;
    padding: 3px;
    font-size: 9px;
  }

  .trash-trade-entry {
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 3px;
  }

  .trash-trade-all {
    min-height: 45px;
    font-size: 8px;
  }

  .item-icon {
    width: 21px;
    height: 21px;
  }

  .item-name,
  .item-price {
    font-size: 8px;
    line-height: 1.1;
  }

  .chat {
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    bottom: max(6px, env(safe-area-inset-bottom));
    width: min(480px, calc(var(--vv-width) - 14px), calc(100vw - 14px));
    gap: 4px;
  }

  .chat-tools {
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 7;
  }

  .chat-tools::-webkit-scrollbar {
    display: none;
  }

  .action-bar {
    gap: 3px;
    padding: 3px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .action-bar button {
    width: 26px;
    min-height: 23px;
    font-size: 11px;
  }

  .action-bar .action-icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .action-icon-button img {
    width: 32px;
    height: 32px;
  }

  .action-bar #activeSkillButton {
    width: 46px;
  }

  .chat-toggle,
  .menu-toggle {
    min-height: 23px;
    padding: 2px 6px;
    font-size: 11px;
  }

  #chatLog {
    height: 70px;
    min-height: 38px;
    padding: 5px 7px;
    font-size: 13px;
    line-height: 1.28;
  }

  .chat.chat-small #chatLog {
    height: 70px;
    min-height: 38px;
  }

  .chat.chat-large #chatLog {
    height: 145px;
    max-height: min(34vh, 180px);
  }

  #chatInput {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 16px;
    line-height: 1.2;
    touch-action: manipulation;
  }

  .mobile-joystick {
    width: 104px;
    height: 104px;
    margin: -52px 0 0 -52px;
  }

  .mobile-joystick-base {
    width: 104px;
    height: 104px;
  }

  .mobile-joystick-knob {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
  }

  .fishing-start {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(104px, calc(env(safe-area-inset-bottom) + 96px));
    min-width: 88px;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .character-rotate {
    display: block;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(66px, calc(env(safe-area-inset-bottom) + 58px));
    min-width: 88px;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .fishing-panel {
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px));
    width: min(340px, calc(var(--vv-width) - 18px));
    padding: 10px;
  }

  .fishing-meter {
    height: 34px;
    border-width: 3px;
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .toolbar {
    grid-template-columns: repeat(9, auto);
    max-width: calc(100vw - 72px);
  }

  .chat {
    width: min(430px, 48vw);
  }

  .drawer {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 76px));
    width: min(286px, 34vw);
    max-height: min(48vh, 315px);
  }

  .bottom-menu {
    top: calc(var(--vv-top) + max(76px, calc(env(safe-area-inset-top) + 68px)));
    left: max(8px, env(safe-area-inset-left));
    width: min(286px, 34vw);
    max-height: min(48vh, 315px);
  }
}

@media (orientation: portrait) and (pointer: coarse) {
  .toolbar {
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    right: auto;
    width: calc(var(--vv-width) - 12px);
    max-width: none;
    top: calc(var(--vv-top) + max(72px, calc(env(safe-area-inset-top) + 64px)));
    grid-template-columns: repeat(3, 1fr);
  }

  .quicktravel {
    top: calc(var(--vv-top) + max(42px, calc(env(safe-area-inset-top) + 36px)));
  }

  .drawer {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(104px, calc(env(safe-area-inset-bottom) + 96px));
    width: auto;
    max-height: min(44vh, 330px);
  }

  .chat {
    left: calc(var(--vv-left) + 6px);
    width: min(calc(var(--vv-width) - 12px), 420px);
  }
}

@media (pointer: coarse) {
  .hud.toolbar-hidden .toolbar {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .chat-tabs .chat-toggle {
    margin-left: 0;
  }

  .statusbar {
    left: calc(var(--vv-left) + 6px);
    right: auto;
    width: calc(var(--vv-width) - 12px);
    max-width: calc(var(--vv-width) - 12px);
    overflow: hidden;
  }

  .toolbar {
    left: calc(var(--vv-left) + 6px);
    right: auto;
    width: calc(var(--vv-width) - 12px);
    max-width: calc(var(--vv-width) - 12px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quicktravel {
    left: calc(var(--vv-left) + 6px);
    right: auto;
    max-width: calc(var(--vv-width) - 12px);
  }

  .bottom-menu {
    left: calc(var(--vv-left) + 6px);
    right: auto;
    width: calc(var(--vv-width) - 12px);
    max-width: calc(var(--vv-width) - 12px);
  }

  .ox-status-wrap {
    left: calc(var(--vv-left) + 8px);
    right: auto;
    width: min(calc(var(--vv-width) - 20px), calc(100vw - 20px));
    max-width: min(calc(var(--vv-width) - 20px), calc(100vw - 20px));
    transform: none;
  }

  .chat {
    left: calc(var(--vv-left) + 6px);
    right: auto;
    width: min(calc(var(--vv-width) - 14px), calc(100vw - 14px));
    max-width: min(calc(var(--vv-width) - 14px), calc(100vw - 14px));
  }
}

@media (pointer: coarse) and (orientation: portrait) and (max-width: 430px) {
  button {
    min-height: 25px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .statusbar {
    gap: 3px 5px;
    min-height: 25px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .status-vital {
    grid-template-columns: auto 38px;
    gap: 3px;
    font-size: 10px;
  }

  .status-vital-track {
    height: 6px;
  }

  .toolbar {
    top: calc(var(--vv-top) + max(62px, calc(env(safe-area-inset-top) + 54px)));
    gap: 3px;
    padding: 3px;
  }

  .toolbar button,
  .quicktravel button {
    min-height: 21px;
    padding: 2px 4px;
    font-size: 9px;
  }

  .action-bar {
    gap: 2px;
    padding: 2px;
  }

  .action-bar button {
    width: 23px;
    min-height: 21px;
    font-size: 10px;
  }

  .action-bar .action-icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .action-icon-button img {
    width: 32px;
    height: 32px;
  }

  .action-bar #activeSkillButton {
    width: 42px;
  }

  .chat-tabs {
    gap: 3px;
    margin: 3px 0;
  }

  .chat-tabs button,
  .chat-toggle,
  .menu-toggle {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 10px;
  }

  #chatLog {
    height: 58px;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1.22;
  }

  .chat.chat-small #chatLog {
    height: 58px;
  }

  .chat.chat-large #chatLog {
    height: 118px;
    max-height: min(28vh, 140px);
  }

  #chatInput {
    min-height: 26px;
    padding: 3px 6px;
    font-size: 16px;
    line-height: 1.15;
  }

  .drawer,
  .bottom-menu,
  .gift-panel,
  .private-chat,
  .player-info-pop {
    padding: 6px;
    font-size: 10px;
  }

  .drawer {
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px));
    max-height: min(40vh, 285px);
  }

  .slots,
  .shop-grid,
  .trash-trade-grid {
    gap: 3px;
  }

  .shop-item,
  .slot {
    min-height: 42px;
    padding: 3px;
  }
}

@media (pointer: coarse) {
  body.chat-keyboard-open .chat {
    top: var(--chat-keyboard-top);
    bottom: auto;
  }

  body.chat-keyboard-open #chatLog {
    height: 46px;
    min-height: 34px;
    max-height: 14vh;
  }

  body.chat-keyboard-open #chatInput {
    min-height: 32px;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  body.chat-keyboard-open #chatLog {
    height: 34px;
    min-height: 30px;
  }
}

@media (pointer: coarse) and (min-aspect-ratio: 4 / 3) {
  .toolbar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.drawer.memory-game,
.drawer.tailor-game,
.drawer.cooking-game {
  z-index: 60;
  width: min(380px, calc(var(--vv-width) - 16px));
  max-height: min(82vh, calc(var(--vv-height) - 16px));
  overflow: hidden;
}

/* The menu artwork is the complete button face. */
.toolbar {
  left: 10px;
  top: calc(var(--vv-top) + 86px);
  width: 72px;
  max-width: 72px;
  grid-template-columns: repeat(2, 32px);
  grid-auto-rows: 44px;
  align-content: start;
  gap: 4px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(8, 10, 8, 0.62);
  backdrop-filter: none;
}

.toolbar .menu-icon-button,
.toolbar .menu-icon-button:hover,
.toolbar .menu-icon-button:active,
.toolbar .menu-icon-button:focus-visible {
  display: grid;
  grid-template-rows: 32px 10px;
  place-items: center;
  box-sizing: content-box;
  width: 32px;
  height: 42px;
  min-width: 32px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.toolbar .menu-icon-button::after {
  content: attr(data-mobile-label);
  display: block;
  font-size: 9px;
  font-weight: 700;
  line-height: 10px;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.toolbar .menu-icon-button img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.toolbar .menu-icon-button:hover img,
.toolbar .menu-icon-button:focus-visible img {
  filter: brightness(1.12);
}

.hud.toolbar-hidden .toolbar {
  display: none;
}

.quicktravel .menu-toggle {
  display: inline-grid;
  place-items: center;
  width: auto;
  margin: 0;
}

@media (pointer: coarse) {
  .toolbar {
    top: calc(var(--vv-top) + max(70px, calc(env(safe-area-inset-top) + 64px)));
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    right: auto;
    bottom: auto;
    width: 72px;
    max-width: 72px;
    grid-template-columns: repeat(2, 32px);
    grid-auto-rows: 44px;
    align-content: start;
  }

}

@media (pointer: coarse) and (orientation: portrait),
       (pointer: coarse) and (orientation: landscape),
       (pointer: coarse) and (min-aspect-ratio: 4 / 3) {
  .toolbar {
    width: 72px;
    max-width: 72px;
    grid-template-columns: repeat(2, 32px);
  }
}

/* Unified window system */
:root {
  --ui-surface: rgba(17, 25, 20, 0.96);
  --ui-surface-strong: rgba(11, 17, 14, 0.985);
  --ui-surface-soft: rgba(35, 47, 38, 0.92);
  --ui-border: rgba(128, 177, 143, 0.48);
  --ui-border-strong: rgba(223, 201, 112, 0.72);
  --ui-accent: #dfc970;
  --ui-accent-hover: #f0dc85;
  --ui-teal: #69bca4;
  --ui-text: #f7f4e9;
  --ui-muted: #b9c5ba;
  --ui-danger: #b95858;
  --ui-radius: 7px;
  --ui-shadow: 0 16px 42px rgba(0, 0, 0, 0.48);
}

.panel,
.confirm-box,
.craft-materials-box,
.minigame-menu-box,
.fishing-panel {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--ui-text);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.drawer,
.bottom-menu,
.gift-panel,
.private-chat,
.player-info-pop {
  z-index: 30;
  width: min(390px, calc(var(--vv-width) - 20px));
  max-width: calc(var(--vv-width) - 20px);
  max-height: min(68vh, 590px, calc(var(--vv-height) - 32px));
  padding: 14px;
  border-color: var(--ui-border);
  scrollbar-color: rgba(223, 201, 112, 0.62) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.drawer::-webkit-scrollbar,
.bottom-menu::-webkit-scrollbar,
#chatLog::-webkit-scrollbar,
.private-chat-log::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.drawer::-webkit-scrollbar-thumb,
.bottom-menu::-webkit-scrollbar-thumb,
#chatLog::-webkit-scrollbar-thumb,
.private-chat-log::-webkit-scrollbar-thumb {
  border-radius: 7px;
  background: rgba(223, 201, 112, 0.62);
}

.drawer > h2,
.bottom-menu > h2,
.gift-panel > h2,
.private-chat > h2,
.player-info-pop > h2 {
  position: sticky;
  top: -14px;
  z-index: 2;
  min-height: 42px;
  margin: -14px -14px 12px;
  padding: 11px 44px 10px 14px;
  border-bottom: 1px solid var(--ui-border);
  border-radius: var(--ui-radius) var(--ui-radius) 0 0;
  background: var(--ui-surface-strong);
  color: #fff6ce;
  font-size: 17px;
  line-height: 20px;
  letter-spacing: 0;
}

.panel-close {
  position: sticky;
  float: none;
  top: 0;
  right: 0;
  z-index: 5;
  display: grid;
  margin: 0 0 -28px auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(91, 48, 48, 0.9);
  color: #ffe9df;
  box-shadow: none;
}

.panel-close:hover,
.panel-close:focus-visible {
  border-color: rgba(255, 213, 190, 0.62);
  background: #a34e4e;
  color: #fff;
}

button {
  border-color: rgba(223, 201, 112, 0.42);
  border-radius: 6px;
  background: #cdb866;
  color: #171a14;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, filter 120ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  border-color: rgba(255, 240, 170, 0.86);
  background: var(--ui-accent-hover);
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(105, 188, 164, 0.9);
  outline-offset: 1px;
}

input,
select,
textarea {
  border: 1px solid rgba(128, 177, 143, 0.48);
  border-radius: 6px;
  background: rgba(5, 10, 7, 0.68);
  color: var(--ui-text);
}

select option {
  background: #111a15;
  color: var(--ui-text);
}

.statusbar {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(128, 177, 143, 0.38);
  border-radius: var(--ui-radius);
  background: rgba(10, 16, 12, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.statusbar > strong {
  color: #fff1a9;
}

.quicktravel {
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(128, 177, 143, 0.34);
  border-radius: var(--ui-radius);
  background: rgba(10, 16, 12, 0.84);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.quicktravel button,
.quicktravel .ox-status-toggle {
  min-height: 30px;
  margin: 0;
  border-color: rgba(223, 201, 112, 0.38);
  background: rgba(54, 69, 56, 0.96);
  color: #f8f3dd;
}

.quicktravel #overviewMap,
.quicktravel .menu-toggle,
.quicktravel .ox-status-toggle,
.quicktravel #activeSkillButton {
  border-color: rgba(217, 109, 116, 0.58);
  background: rgba(91, 37, 45, 0.96);
  color: #fff3f3;
}

.quicktravel #overviewMap:hover:not(:disabled),
.quicktravel #overviewMap:focus-visible:not(:disabled),
.quicktravel #overviewMap:active:not(:disabled),
.quicktravel .menu-toggle:hover:not(:disabled),
.quicktravel .menu-toggle:focus-visible:not(:disabled),
.quicktravel .menu-toggle:active:not(:disabled),
.quicktravel .ox-status-toggle:hover:not(:disabled),
.quicktravel .ox-status-toggle:focus-visible:not(:disabled),
.quicktravel .ox-status-toggle:active:not(:disabled),
.quicktravel #activeSkillButton:hover:not(:disabled),
.quicktravel #activeSkillButton:focus-visible:not(:disabled),
.quicktravel #activeSkillButton:active:not(:disabled) {
  border-color: rgba(255, 173, 177, 0.88);
  background: #a94853;
  color: #fff;
}

.toolbar {
  width: 78px;
  max-width: 78px;
  grid-template-columns: repeat(2, 34px);
  grid-auto-rows: 48px;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(128, 177, 143, 0.38);
  border-radius: var(--ui-radius);
  background: rgba(10, 16, 12, 0.86);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}

.toolbar .menu-icon-button,
.toolbar .menu-icon-button:hover,
.toolbar .menu-icon-button:active,
.toolbar .menu-icon-button:focus-visible {
  width: 34px;
  height: 46px;
  min-width: 34px;
  min-height: 46px;
  grid-template-rows: 33px 11px;
  border: 1px solid transparent;
  border-radius: 5px;
}

.toolbar .menu-icon-button:hover,
.toolbar .menu-icon-button:focus-visible {
  border-color: rgba(223, 201, 112, 0.48);
  background: rgba(223, 201, 112, 0.13);
}

.toolbar .menu-icon-button::after {
  color: #f4f2e9;
  font-size: 9px;
  line-height: 11px;
}

.toolbar .menu-icon-button img {
  width: 31px;
  height: 31px;
}

.map-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.map-grid button {
  min-height: 38px;
  padding: 7px 10px;
  border-color: rgba(128, 177, 143, 0.34);
  background: var(--ui-surface-soft);
  color: var(--ui-text);
}

.ranking-row,
.online-player-row,
.job-info,
.guild-current,
.guild-row,
.guild-member-row,
.friend-row {
  border-color: rgba(128, 177, 143, 0.3);
  background: rgba(255, 255, 255, 0.045);
}

.slots,
.shop-grid,
.trash-trade-grid {
  gap: 7px;
}

.slot,
.shop-item,
.trash-trade-item,
.skill-item {
  border-color: rgba(128, 177, 143, 0.38);
  border-radius: 6px;
  background: rgba(4, 10, 7, 0.5);
}

.slot:hover,
.shop-item:hover,
.trash-trade-item:hover,
.skill-item:hover {
  border-color: var(--ui-border-strong);
  background: rgba(53, 66, 54, 0.72);
}

.food-tools,
.relationship-form,
.memory-game-recipe,
.fish-dex-detail {
  border-color: rgba(128, 177, 143, 0.28);
  background: rgba(4, 10, 7, 0.38);
}

.chat {
  --chat-opacity: 0.35;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(128, 177, 143, 0.34);
  border-radius: var(--ui-radius);
  background: rgb(10 16 12 / var(--chat-opacity));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.chat-resize-handle {
  position: relative;
  height: 13px;
  margin: -3px 0 -2px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.chat-resize-handle::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 54px;
  height: 3px;
  border-radius: 2px;
  background: rgba(207, 221, 208, 0.58);
  transform: translateX(-50%);
  transition: background 120ms ease, width 120ms ease;
}

.chat-resize-handle:hover::after,
.chat-resize-handle:focus-visible::after,
.chat.chat-resizing .chat-resize-handle::after {
  width: 72px;
  background: #dfc970;
}

.chat-resize-handle:focus-visible {
  outline: 1px solid rgba(223, 201, 112, 0.8);
  outline-offset: -1px;
}

.chat.chat-resizing,
.chat.chat-resizing * {
  cursor: ns-resize !important;
  user-select: none !important;
}

.chat.collapsed .chat-resize-handle {
  display: none;
}

.chat-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-vital {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 1px solid;
  border-radius: 5px;
  background: rgb(3 7 5 / calc(var(--chat-opacity) * 0.82));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.74);
}

.chat-vital-hp {
  border-color: rgba(241, 67, 87, 0.82);
}

.chat-vital-mp {
  border-color: rgba(65, 136, 246, 0.86);
}

.chat-vital-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  transition: width 130ms linear;
}

.chat-vital-hp .chat-vital-fill {
  background: linear-gradient(90deg, #9e1528, #ee4058);
}

.chat-vital-mp .chat-vital-fill {
  background: linear-gradient(90deg, #1956a9, #3f8cf1);
}

.chat-vital-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}

.chat-exp-progress {
  position: relative;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border: 1px solid rgba(223, 201, 112, 0.58);
  border-radius: 4px;
  background: rgba(3, 7, 5, 0.88);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.72);
}

.chat-exp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #9c741b, #e0b938 72%, #f5df71);
  box-shadow: inset 0 1px 0 rgba(255, 246, 181, 0.42);
  transition: width 160ms ease-out;
}

.chat-exp-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff6c7;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}

#chatLog {
  border: 1px solid rgba(128, 177, 143, 0.22);
  border-radius: 6px;
  background: rgb(3 7 5 / calc(var(--chat-opacity) * 0.78));
  resize: none;
}

.chat-timestamp {
  color: #9aa99d;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

.chat-tabs {
  gap: 4px;
  margin: 0;
}

.chat-tabs button {
  min-height: 28px;
  border-color: rgba(128, 177, 143, 0.32);
  background: rgba(48, 62, 51, 0.94);
  color: #dce6dd;
}

.chat-tabs button.active {
  border-color: rgba(223, 201, 112, 0.72);
  background: #cdb866;
  color: #171a14;
  box-shadow: none;
}

.chat-window-controls button {
  border-color: rgba(128, 177, 143, 0.3);
  background: rgba(48, 62, 51, 0.94);
  color: #e7eee7;
}

.chat-window-controls .chat-options-toggle {
  width: 32px;
  min-width: 32px;
  padding: 2px;
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: 19px;
  line-height: 1;
}

.chat-emotion-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 30px;
  padding: 0;
  border-color: rgba(128, 177, 143, 0.3);
  background: rgba(48, 62, 51, 0.94);
}

.chat-emotion-toggle img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.chat-options {
  position: absolute;
  right: 6px;
  bottom: 57px;
  z-index: 4;
  display: grid;
  width: min(270px, calc(100% - 12px));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(126, 191, 146, 0.72);
  border-radius: 6px;
  background: rgba(15, 24, 18, 0.97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: #edf4ed;
}

.chat-options-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(128, 177, 143, 0.24);
}

.chat-options-title strong {
  color: #e9d77f;
  font-size: 13px;
}

.chat-options-title button {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border-color: rgba(222, 113, 98, 0.56);
  background: rgba(117, 44, 38, 0.92);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.chat-option-opacity {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  font-size: 12px;
}

.chat-option-opacity input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 20px;
  padding: 0;
  accent-color: #d8bd52;
}

.chat-option-opacity output {
  color: #f7e69a;
  font-variant-numeric: tabular-nums;
}

.chat-option-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  font-size: 12px;
}

.chat-option-check input {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  accent-color: #d8bd52;
}

.chat-clear-button {
  width: 100%;
  border-color: rgba(128, 177, 143, 0.34);
  background: rgba(48, 62, 51, 0.94);
  color: #edf4ed;
}

.login {
  width: min(390px, calc(100vw - 28px));
  padding: 24px;
  border-color: rgba(128, 177, 143, 0.58);
  background: var(--ui-surface-strong);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58);
}

.login h1 {
  margin-bottom: 4px;
  color: #fff1aa;
  text-align: center;
}

.login-tabs {
  padding: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.login-tabs button {
  border-color: transparent;
  background: transparent;
  color: var(--ui-muted);
}

.login-tabs button.active {
  background: #cdb866;
  color: #171a14;
}

@media (max-width: 720px), (pointer: coarse) {
  .statusbar {
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    right: auto;
    width: calc(var(--vv-width) - max(12px, env(safe-area-inset-left) + env(safe-area-inset-right)));
    min-height: 34px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .statusbar::-webkit-scrollbar {
    display: none;
  }

  .drawer,
  .bottom-menu,
  .gift-panel,
  .private-chat,
  .player-info-pop {
    width: min(390px, calc(var(--vv-width) - 18px));
    max-width: calc(var(--vv-width) - 18px);
    max-height: min(72vh, calc(var(--vv-height) - 86px));
    padding: 12px;
  }

  .drawer > h2,
  .bottom-menu > h2,
  .gift-panel > h2,
  .private-chat > h2,
  .player-info-pop > h2 {
    top: -12px;
    margin: -12px -12px 10px;
    padding: 10px 40px 9px 12px;
    font-size: 15px;
  }

  .panel-close {
    top: 0;
  }

  .toolbar {
    width: 78px;
    max-width: 78px;
    grid-template-columns: repeat(2, 34px);
    grid-auto-rows: 48px;
  }

  .map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat {
    padding: 5px;
  }
}

@media (pointer: coarse) and (orientation: portrait) and (max-width: 430px) {
  .drawer,
  .bottom-menu,
  .gift-panel,
  .private-chat,
  .player-info-pop {
    width: calc(var(--vv-width) - 16px);
    max-height: min(70vh, calc(var(--vv-height) - 76px));
    font-size: 11px;
  }

  .slots,
  .shop-grid,
  .trash-trade-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .slot,
  .shop-item,
  .trash-trade-item,
  .skill-item {
    min-height: 54px;
  }

  .item-icon {
    width: 28px;
    height: 28px;
  }

  .item-name,
  .item-price {
    font-size: 9px;
  }

  .chat-input-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .chat-window-controls button {
    min-width: 38px;
    padding-inline: 4px;
  }
}

/* Landscape phones use one compact, horizontally scrollable menu row. */
@media (pointer: coarse) and (orientation: landscape) {
  .statusbar {
    width: calc(var(--vv-width) - max(250px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 244px)));
    max-width: calc(var(--vv-width) - max(250px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 244px)));
    min-height: 32px;
    padding: 5px 8px;
    gap: 4px 8px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 10px;
    white-space: nowrap;
    scrollbar-width: none;
    text-shadow: 0 1px 2px #000, 0 0 4px #000;
  }

  .statusbar::-webkit-scrollbar {
    display: none;
  }

  .quicktravel {
    top: calc(var(--vv-top) + max(6px, env(safe-area-inset-top)));
    left: auto;
    right: max(6px, env(safe-area-inset-right));
    gap: 3px;
    padding: 2px;
  }

  .quicktravel button,
  .quicktravel .ox-status-toggle {
    min-height: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.1;
  }

  .toolbar {
    top: calc(var(--vv-top) + max(44px, calc(env(safe-area-inset-top) + 38px)));
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    right: auto;
    bottom: auto;
    width: calc(var(--vv-width) - max(12px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 6px)));
    max-width: none;
    height: 56px;
    grid-template-columns: none;
    grid-template-rows: 46px;
    grid-auto-flow: column;
    grid-auto-columns: 34px;
    grid-auto-rows: 46px;
    align-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .ox-status-wrap {
    top: calc(var(--vv-top) + max(44px, calc(env(safe-area-inset-top) + 38px)));
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    width: calc(var(--vv-width) - max(12px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 6px)));
    max-width: calc(var(--vv-width) - max(12px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 6px)));
    transform: none;
    z-index: 6;
  }

  .chat {
    left: calc(var(--vv-left) + max(6px, env(safe-area-inset-left)));
    bottom: max(6px, env(safe-area-inset-bottom));
    width: clamp(300px, 52vw, 430px);
    max-width: calc(var(--vv-width) - max(142px, calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 136px)));
    padding: 5px;
    gap: 4px;
  }

  .chat-tools {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .chat-tools::-webkit-scrollbar {
    display: none;
  }

  #chatLog {
    height: 64px;
    max-height: 30vh;
  }

  .chat-vital,
  .chat-exp-progress {
    height: 16px;
  }

  .chat-options {
    bottom: 53px;
    max-height: calc(var(--vv-height) - 24px);
    overflow-y: auto;
  }

  .fishing-start {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .character-rotate {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(48px, calc(env(safe-area-inset-bottom) + 42px));
  }

  .drawer,
  .bottom-menu,
  .gift-panel,
  .private-chat,
  .player-info-pop {
    width: min(520px, calc(var(--vv-width) - 24px));
    max-width: calc(var(--vv-width) - 24px);
    max-height: calc(var(--vv-height) - 24px);
    overflow-y: auto;
  }
}
