* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body {
  font-family: 'Kanit', sans-serif;
  overflow: hidden;
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 38%, #fef3c7 72%, #fffbeb 100%);
  color: #333;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  transition: background 1.2s ease;
}

body.morning-mode { background: linear-gradient(180deg, #93c5fd 0%, #dbeafe 36%, #fed7aa 74%, #fff7ed 100%); }
body.day-mode { background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 40%, #fef08a 80%, #fef9c3 100%); }
body.sunset-mode { background: linear-gradient(180deg, #4a2c5a 0%, #e65c40 52%, #f7b733 100%); }
body.night-mode { background: linear-gradient(180deg, #040812 0%, #0a1628 50%, #16243b 100%); }

:root {
  --font-display: 'Cinzel', serif;
  --font-body: 'Kanit', sans-serif;
  --gold-primary: #e2b857;
  --gold-gradient: linear-gradient(135deg, #ffffff 0%, #fef08a 35%, #e2b857 70%, #d97706 100%);
  --obsidian-bg: radial-gradient(ellipse at 50% 20%, rgba(26, 36, 54, 0.96) 0%, rgba(10, 15, 26, 0.98) 100%);
  --obsidian-card: linear-gradient(155deg, rgba(20, 29, 47, 0.88) 0%, rgba(12, 18, 30, 0.94) 100%);
}

#menu-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--obsidian-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: max(48px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(60px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
}
#menu-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

#menu-screen::-webkit-scrollbar {
  width: 6px;
}
#menu-screen::-webkit-scrollbar-track {
  background: rgba(10, 15, 26, 0.8);
  border-radius: 999px;
}
#menu-screen::-webkit-scrollbar-thumb {
  background: rgba(226, 184, 87, 0.3);
  border-radius: 999px;
}
#menu-screen::-webkit-scrollbar-thumb:hover {
  background: rgba(226, 184, 87, 0.6);
}

.menu-header { text-align: center; margin-bottom: 32px; color: #fff; }
.menu-header h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 8px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(226, 184, 87, 0.25));
}
.menu-header p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #94a3b8;
  letter-spacing: 1.5px;
  font-weight: 300;
  position: relative;
  display: inline-block;
  padding: 0 16px;
}
.menu-header p::before,
.menu-header p::after {
  content: '✦';
  font-size: 0.65rem;
  color: var(--gold-primary);
  opacity: 0.7;
  margin: 0 8px;
  vertical-align: middle;
}

.stage-grid { width: 100%; max-width: 680px; margin: 0 auto; }
.stage-columns-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  width: 100%;
}
.stage-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-width: 270px;
  max-width: 320px;
}

.stage-card {
  position: relative;
  background: var(--obsidian-card);
  border: 1px solid rgba(226, 184, 87, 0.22);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s ease,
              box-shadow 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-height: 185px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.stage-card:hover {
  transform: translateY(-5px) scale(1.018);
  border-color: rgba(226, 184, 87, 0.65);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.55),
              0 0 24px rgba(226, 184, 87, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.card-meta-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.74rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 3px 10px;
  border-radius: 999px;
}
.card-shape-svg {
  width: 13px;
  height: 13px;
  color: var(--gold-primary);
  flex-shrink: 0;
}
.hud-svg {
  width: 17px;
  height: 17px;
  display: block;
}
.btn-hud-icon:hover {
  transform: scale(1.06) !important;
}

.card-stats { margin-top: auto; padding-top: 14px; }
.card-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}
.card-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 10px currentColor;
}
.card-numbers {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  font-weight: 300;
}

.stage-card-delete-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  width: 26px; height: 26px;
  border-radius: 50%; font-size: 0.75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; z-index: 5;
}
.stage-card-delete-btn:hover {
  background: #ef4444; color: #fff;
  border-color: #ef4444;
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.stage-card-add-btn {
  border: 1.5px dashed rgba(226, 184, 87, 0.32);
  background: rgba(15, 23, 42, 0.45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-height: 185px; width: 100%; border-radius: 22px; color: var(--gold-primary);
}
.stage-card-add-btn:hover {
  background: rgba(226, 184, 87, 0.08);
  border-color: var(--gold-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(226, 184, 87, 0.15);
  transform: translateY(-4px) scale(1.015);
}
.stage-card-add-icon { font-size: 1.8rem; filter: drop-shadow(0 2px 6px rgba(226, 184, 87, 0.3)); }
.stage-card-add-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#loading-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: radial-gradient(circle at center, #141e30 0%, #0a0f1c 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0.45s ease;
  pointer-events: none;
}
#loading-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

.seed-loader-box {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 380px; width: 88%;
}
.seed-floating-icon {
  font-size: 3.6rem; margin-bottom: 14px;
  animation: floatBreath 2.6s ease-in-out infinite;
  filter: drop-shadow(0 10px 18px rgba(56, 189, 248, 0.35));
}
@keyframes floatBreath {
  0%, 100% { transform: translateY(0px) scale(1.0); }
  50% { transform: translateY(-12px) scale(1.08); }
}
.seed-loading-title {
  font-size: 1.25rem; font-weight: 700; color: #ffffff;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.seed-loading-sub {
  font-size: 0.85rem; color: #94a3b8; margin-bottom: 22px; min-height: 20px;
}
.seed-progress-track {
  width: 100%; height: 8px; background: rgba(255, 255, 255, 0.12);
  border-radius: 20px; overflow: hidden; position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.seed-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 50%, #818cf8 100%);
  border-radius: 20px; transition: width 0.25s ease-out;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.65);
}
.seed-percentage {
  font-size: 0.82rem; font-weight: 600; color: #cbd5e1; margin-top: 10px;
}

#island-hud {
  position: fixed; inset: 0; pointer-events: none; z-index: 10;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  transition: opacity 0.4s ease;
}
#island-hud.hidden { opacity: 0; pointer-events: none; }
.top-bar { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; }
.top-left-panel {
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.btn-hud {
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-hud:hover {
  background: rgba(255, 255, 255, 0.52);
  color: #0f172a;
}
.btn-hud:active { transform: scale(0.96); }
#btn-daynight { transition: opacity 0.25s ease; }
#btn-daynight.is-cooling {
  opacity: 0.5;
  cursor: default;
}
#btn-daynight.is-cooling:hover { background: transparent; }
#btn-daynight.is-cooling:active { transform: none; }

.search-wrapper { position: relative; display: flex; align-items: center; margin-left: 2px; }
.search-toggle-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.42);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  z-index: 2;
  transition: color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.search-toggle-btn .hud-svg { width: 15px; height: 15px; }
.search-toggle-btn:hover { background: rgba(255, 255, 255, 0.72); color: #0f172a; transform: scale(1.05); }
.search-input {
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  padding: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #0f172a;
  width: 0;
  opacity: 0;
  pointer-events: none;
  transition: width 0.25s ease, background 0.2s, border-color 0.2s, opacity 0.2s, padding 0.2s;
  font-family: inherit;
}
.search-input::placeholder { color: #334155; }
.search-wrapper.is-open .search-toggle-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: transparent;
  border-color: transparent;
}
.search-wrapper.is-open .search-input,
.search-wrapper.is-open .search-input:focus {
  width: 190px;
  padding: 7px 14px 7px 34px;
  opacity: 1;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.search-dropdown {
  position: absolute; top: 44px; left: 0; width: 230px; max-height: 250px; overflow-y: auto;
  background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 16px; box-shadow: 0 14px 35px rgba(0, 0, 0, 0.14); display: none; flex-direction: column; gap: 3px;
  padding: 6px; z-index: 100;
}
.search-dropdown.active { display: flex; }
.search-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.search-item:hover { background: rgba(255, 255, 255, 0.65); transform: translateX(2px); }
.search-item img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.8); }
.search-item-info { display: flex; flex-direction: column; text-align: left; }
.search-item-name { font-size: 0.82rem; font-weight: 700; color: #0f172a; }
.search-item-sub { font-size: 0.68rem; color: #334155; }

.top-right-panel { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: auto; }
.hud-icon-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.hud-utility-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--obsidian-card);
  border: 1px solid rgba(226, 184, 87, 0.36);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hud-utility-pill .btn-setting {
  width: 36px;
  height: 36px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.hud-utility-pill .btn-setting:hover {
  background: rgba(226, 184, 87, 0.16);
  border-color: rgba(226, 184, 87, 0.35);
  box-shadow: none;
}
.stage-indicator {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 25;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  background: var(--obsidian-card);
  border: 1px solid rgba(226, 184, 87, 0.45);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36),
              0 0 16px rgba(226, 184, 87, 0.14),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.stage-indicator::before,
.stage-indicator::after {
  content: '✦';
  font-size: 0.62rem;
  color: var(--gold-primary);
  opacity: 0.85;
  line-height: 1;
}
.stage-indicator-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(226, 184, 87, 0.28));
}
.gfx-badge {
  display: none !important; /* Hidden per user request */
}
/* --- HUD Profile Pill (Under Island Name, styled like Hover Card) --- */
.hud-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  font-family: inherit;
  color: #0f172a;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 190px;
}
.hud-profile-pill:hover {
  background: rgba(255, 255, 255, 0.54);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}
.hud-profile-avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hud-profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.hud-profile-avatar-initial {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}
.hud-profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}
.hud-profile-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.55);
}
.hud-profile-sub {
  font-size: 0.64rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.1;
}
.menu-top-actions {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-profile-pill {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(226, 184, 87, 0.34);
  color: #f8fafc;
}
.menu-profile-pill:hover {
  background: rgba(30, 41, 59, 0.88);
}
.menu-profile-pill .hud-profile-name {
  color: #f8fafc;
  text-shadow: none;
}
.menu-profile-pill .hud-profile-sub {
  color: #cbd5e1;
}
.menu-rank-panel {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  width: 258px;
  z-index: 108;
  background: var(--obsidian-card);
  border: 1px solid rgba(226, 184, 87, 0.24);
  border-radius: 20px;
  padding: 14px 14px 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  transition: padding 0.2s ease, border-color 0.2s ease;
}
.menu-rank-panel.is-collapsed {
  padding: 10px 14px;
}
.menu-rank-head {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(226, 184, 87, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 0 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.menu-rank-panel.is-collapsed .menu-rank-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
}
.menu-rank-panel.is-collapsed .menu-rank-list,
.menu-rank-panel.is-collapsed .menu-rank-empty {
  display: none;
}
.menu-rank-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.menu-rank-chevron {
  font-size: 0.78rem;
  color: #e2b857;
  transition: transform 0.2s ease;
  display: inline-block;
  transform: rotate(180deg);
}
.menu-rank-panel.is-collapsed .menu-rank-chevron {
  transform: rotate(0deg);
}
.menu-rank-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.4px;
}
.menu-rank-sub {
  font-size: 0.64rem;
  color: #94a3b8;
  font-weight: 500;
}
.menu-rank-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.menu-rank-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.menu-rank-item:hover {
  background: rgba(226, 184, 87, 0.11);
  border-color: rgba(226, 184, 87, 0.45);
  transform: translateY(-1px);
}
.menu-rank-item:active {
  transform: scale(0.98);
}
.menu-rank-pos {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.menu-rank-pos.rank-1 { background: linear-gradient(135deg, #fde047, #eab308); color: #0f172a; }
.menu-rank-pos.rank-2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #0f172a; }
.menu-rank-pos.rank-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }
.menu-rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(226, 184, 87, 0.45);
}
.menu-rank-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.menu-rank-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-rank-meta {
  font-size: 0.66rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-rank-score {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2b857;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.menu-rank-empty {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
  padding: 12px 6px;
}
@media (max-width: 1099px) {
  .menu-rank-panel {
    position: static;
    width: 100%;
    max-width: 680px;
    margin: 24px auto 0;
  }
}
@media (max-width: 640px) {
  .menu-rank-panel {
    max-width: 330px;
    margin-top: 20px;
  }
}
.btn-setting {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(226, 184, 87, 0.3);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  color: var(--gold-primary);
  transition: all 0.25s ease;
}
.btn-setting:hover {
  transform: scale(1.08) rotate(45deg);
  border-color: rgba(226, 184, 87, 0.7);
  background: rgba(30, 41, 59, 0.98);
  box-shadow: 0 0 20px rgba(226, 184, 87, 0.25);
}
.hud-photo-bottom-left {
  position: fixed;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 25;
  pointer-events: auto;
}
.hud-photo-bottom-left:hover {
  transform: scale(1.08);
}

#dev-mode-hud {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.45); padding: 6px 14px; border-radius: 30px;
  display: none; align-items: center; gap: 8px; z-index: 120;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12); pointer-events: auto; transition: opacity 0.4s ease;
}
#dev-mode-hud.active { display: flex; }
#dev-mode-hud.cinematic-hide { opacity: 0; pointer-events: none; }

.dev-badge { font-size: 0.72rem; font-weight: 700; background: #f59e0b; color: #0f172a; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.btn-dev-action {
  background: rgba(255, 255, 255, 0.42); border: 1px solid rgba(255, 255, 255, 0.62);
  color: #0f172a; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 0.98rem; line-height: 1;
  cursor: pointer; transition: background 0.15s, transform 0.15s; font-family: inherit; display: inline-flex; align-items: center; justify-content: center;
}
.btn-dev-action:hover { background: rgba(255, 255, 255, 0.72); transform: scale(1.06); }

#ra-build-sidebar {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%) translateX(100%);
  background: rgba(15, 23, 42, 0.78); border-left: 2px solid rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.2); border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-top-left-radius: 20px; border-bottom-left-radius: 20px; padding: 14px 12px; z-index: 125;
  display: none; flex-direction: column; gap: 8px; box-shadow: -8px 0 25px rgba(0, 0, 0, 0.35); pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s;
}
#ra-build-sidebar.active { display: flex; }
#ra-build-sidebar.open { transform: translateY(-50%) translateX(0); }
#ra-build-sidebar.cinematic-hide { opacity: 0; pointer-events: none; }

#ra-toggle-tab {
  position: absolute; left: -34px; top: 50%; transform: translateY(-50%); width: 34px; height: 60px;
  background: rgba(15, 23, 42, 0.88); border-left: 2px solid rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.25); border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  border-top-left-radius: 14px; border-bottom-left-radius: 14px; color: #38bdf8; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25); transition: background 0.2s, color 0.2s;
}
#ra-toggle-tab:hover { background: #1e293b; color: #fff; }
.ra-header { font-size: 0.72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.8px; text-align: center; margin-bottom: 2px; }
.ra-grid { display: grid; grid-template-columns: repeat(2, 70px); gap: 8px; }
.ra-card-btn {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px; padding: 8px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); color: #fff; font-family: inherit;
}
.ra-card-btn:hover { transform: translateY(-2px) scale(1.04); background: rgba(255, 255, 255, 0.2); border-color: #38bdf8; box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25); }
.ra-card-btn:active { transform: scale(0.96); }
.ra-card-icon { font-size: 1.6rem; line-height: 1; }
.ra-card-name { font-size: 0.72rem; font-weight: 600; text-align: center; }
.ra-card-count { font-size: 0.65rem; color: #94a3b8; font-weight: 600; }

#single-floating-card {
  position: fixed; top: 0; left: 0; pointer-events: none; display: none; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.30);
  padding: 5px 12px 5px 6px; border-radius: 30px; box-shadow: 0 10px 26px rgba(0,0,0,0.12);
  border: 1px solid rgba(255, 255, 255, 0.45); white-space: nowrap; z-index: 15; contain: layout style; transition: opacity 0.2s ease;
}
#single-floating-card::after {
  content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid rgba(255, 255, 255, 0.35);
}
.card-thumb { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255, 255, 255, 0.85); }
.card-info { display: flex; flex-direction: column; text-align: left; }
.card-pet-name { font-size: 0.82rem; font-weight: 700; color: #0f172a; line-height: 1.1; text-shadow: 0 1px 2px rgba(255,255,255,0.6); }
.card-sub-info { font-size: 0.68rem; color: #1e293b; font-weight: 600; }

#tomb-modal, #setting-modal, #billboard-modal, #tree-picker-modal, #profile-modal, #auth-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.92);
  background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 28px; padding: 26px 28px; width: 92%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12); z-index: 150; opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s ease;
  contain: layout style; pointer-events: auto; text-align: center; max-height: 85vh; overflow-y: auto; overflow-x: hidden;
}
#tomb-modal.active, #setting-modal.active, #billboard-modal.active, #tree-picker-modal.active, #profile-modal.active, #auth-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
#profile-modal { z-index: 160; }
#auth-modal { z-index: 215; background: rgba(255, 255, 255, 0.95); }

.auth-google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: background 0.18s ease, transform 0.15s ease;
}
.auth-google-btn:hover { background: #f8fafc; transform: translateY(-1px); }
.auth-google-btn:active { transform: scale(0.98); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(15, 23, 42, 0.14);
}
.profile-logout-btn {
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.09);
  color: #b91c1c;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.profile-logout-btn:hover { background: #dc2626; color: #ffffff; }

/* --- Profile Modal & Tomb Owner Badge --- */
.profile-avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.profile-avatar-ring {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 700;
}
.profile-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-cam {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: rgba(15, 23, 42, 0.52);
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-actions {
  display: flex;
  gap: 6px;
}
.profile-mini-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.profile-mini-btn.ghost {
  background: transparent;
  color: #475569;
}
.profile-owned-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
}
.profile-owned-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.profile-owned-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}
.profile-owned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}
.profile-owned-empty {
  font-size: 0.74rem;
  color: #334155;
  text-align: center;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}
.profile-owned-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
}
.profile-owned-item:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}
.profile-owned-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
}
.profile-owned-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.profile-owned-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-owned-sub {
  font-size: 0.68rem;
  color: #475569;
}
.profile-owned-go {
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  flex-shrink: 0;
}

.tomb-owner-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.62);
  font-size: 0.71rem;
  font-weight: 600;
  color: #334155;
}
.tomb-owner-row.tomb-owner-top-left {
  position: absolute;
  top: 12px;
  left: 14px;
  margin-top: 0;
  max-width: calc(100% - 62px);
  z-index: 2;
}
.tomb-owner-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tomb-owner-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.tomb-owner-initial {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #334155;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tomb-owner-mine-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.gb-row-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.profile-avatar-stage {
  position: relative;
  display: inline-flex;
}
.avatar-corner-badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
  pointer-events: none;
}
.flag-svg-icon {
  width: 1.15em;
  height: 0.85em;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.15);
}
.avatar-corner-badge.lg {
  right: -2px;
  bottom: -2px;
  min-width: 24px;
  height: 24px;
  font-size: 0.92rem;
}
.avatar-corner-badge.sm {
  right: -4px;
  bottom: -3px;
  min-width: 13px;
  height: 13px;
  font-size: 0.54rem;
}
.tomb-owner-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.gb-row-avatar {
  position: relative;
}
.tomb-pet-avatar-wrap {
  position: relative;
  display: inline-flex;
  margin-bottom: 4px;
}
.pet-species-corner-badge {
  position: absolute;
  right: -6px;
  bottom: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.18);
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.profile-badge-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.profile-badge-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.profile-badge-chip:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}
.profile-badge-chip.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  font-weight: 700;
}
.profile-badge-custom-input {
  width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 0.76rem;
  text-align: center;
  outline: none;
}
@media (min-width: 641px) {
  #tomb-modal, #billboard-modal { left: 32px; transform: translateY(-50%) translateX(-40px) scale(0.92); width: 320px; }
  #tomb-modal.active, #billboard-modal.active { transform: translateY(-50%) translateX(0) scale(1); }
}

.modal-close {
  position: absolute; top: 12px; right: 14px; background: rgba(255, 255, 255, 0.4); border: none;
  width: 28px; height: 28px; border-radius: 50%; font-size: 1rem; cursor: pointer; color: #1e293b;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.8); color: #0f172a; }

.ui-svg {
  width: 15px; height: 15px; flex-shrink: 0; display: inline-block;
}
.ui-emoji {
  font-size: 15px; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.tomb-header { margin-bottom: 12px; }
#tomb-nav-bar {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 155;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
#tomb-nav-bar.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.tomb-nav-pill-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  transition: background 0.18s ease, transform 0.15s ease;
}
.tomb-nav-pill-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.06);
}
.tomb-nav-pill-btn:active {
  transform: scale(0.94);
}
.tomb-nav-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
.pet-avatar-img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; border: 2.5px solid rgba(255,255,255,0.9); display: block; box-shadow: 0 6px 16px rgba(15,23,42,0.12); }
.pet-type-tag { display: inline-block; font-size: 0.7rem; letter-spacing: 0.3px; background: rgba(255, 255, 255, 0.52); color: #334155; padding: 2px 10px; border-radius: 999px; margin-bottom: 4px; font-weight: 600; border: 1px solid rgba(255, 255, 255, 0.65); }
.pet-name { font-size: 1.24rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.pet-years { font-size: 0.78rem; color: #475569; margin: 2px 0 6px; font-weight: 500; }
.pet-desc { font-size: 0.82rem; color: #1e293b; margin-bottom: 10px; line-height: 1.42; font-style: italic; }

.tomb-stats-bar {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 0.74rem; font-weight: 600; color: #334155;
  padding: 3px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.42); border: 1px solid rgba(255, 255, 255, 0.58);
}
.tomb-stat-item { display: inline-flex; align-items: center; gap: 4px; }
.tomb-stat-btn {
  background: none; border: none; color: inherit; font: inherit; cursor: pointer;
  padding: 0 2px; border-radius: 6px; transition: opacity 0.15s ease;
}
.tomb-stat-btn:hover { opacity: 0.7; }
.tomb-stat-item .ui-svg { width: 13px; height: 13px; opacity: 0.72; }
.tomb-stats-bar .stats-dot { opacity: 0.35; }

.btn-tomb {
  flex: 1; padding: 10px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  font-family: inherit;
}
.btn-tomb:active { opacity: 0.86; }

.free-emotional-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.btn-heart {
  background: #e11d48; color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22);
  padding: 10px 6px; font-size: 0.76rem;
}
.btn-heart:hover:not(:disabled) { background: #be123c; }
.btn-heart.sent, .btn-heart:disabled {
  background: rgba(255, 255, 255, 0.55); color: #9f1239; border-color: rgba(255, 255, 255, 0.7);
  box-shadow: none; cursor: default;
}
.btn-condolence {
  background: rgba(255, 255, 255, 0.62); color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.78);
  padding: 10px 6px; font-size: 0.76rem;
}
.btn-condolence:hover:not(:disabled) { background: rgba(255, 255, 255, 0.88); }
.btn-condolence.sent, .btn-condolence:disabled {
  background: rgba(254, 243, 199, 0.65); color: #92400e; border-color: rgba(255, 255, 255, 0.72);
  cursor: default;
}

.tomb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 6px 2px;
}
.tomb-section-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.4px; color: #475569;
  text-align: left; margin: 0;
}
.tomb-inline-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 184, 87, 0.55);
  background: rgba(15, 23, 42, 0.88);
  color: #fef08a;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  transition: transform 0.14s ease, background 0.15s ease;
}
.tomb-inline-store-btn:hover {
  transform: translateY(-1px);
  background: #0f172a;
}
.tomb-inline-store-btn:active {
  transform: scale(0.96);
}
.offering-tiles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px;
}
.offering-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 10px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.72);
  color: #0f172a; cursor: pointer; font-family: inherit;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.offering-tile:hover { background: rgba(255, 255, 255, 0.86); border-color: rgba(15, 23, 42, 0.2); }
.offering-tile.placed { border-color: rgba(16, 185, 129, 0.55); background: rgba(255, 255, 255, 0.78); }
.offering-tile.active-flower {
  background: rgba(252, 231, 243, 0.88);
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.14);
}
.offering-tile.active-flower .offering-tile-icon { color: #be185d; }
.offering-tile.active-flower .offering-tile-price { color: #9d174d; font-weight: 600; }

.offering-tile.active-candle {
  background: rgba(254, 243, 199, 0.90);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.16);
}
.offering-tile.active-candle .offering-tile-icon { color: #b45309; }
.offering-tile.active-candle .offering-tile-price { color: #92400e; font-weight: 600; }

.offering-tile.active-aura {
  background: rgba(243, 232, 255, 0.88);
  border-color: rgba(168, 85, 247, 0.58);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.16);
}
.offering-tile.active-aura .offering-tile-icon { color: #7e22ce; }
.offering-tile.active-aura .offering-tile-price { color: #6b21a8; font-weight: 600; }
.offering-tile-icon { color: #334155; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1px; }
.offering-tile-icon .ui-svg { width: 17px; height: 17px; }
.offering-tile-name { font-size: 0.76rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.offering-tile-price { font-size: 0.68rem; font-weight: 500; color: #475569; line-height: 1.2; }

.tomb-utility-bar {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.tomb-util-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.42); border: 1px solid rgba(255, 255, 255, 0.58);
  color: #1e293b; font-size: 0.72rem; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.tomb-util-btn .ui-svg { width: 13px; height: 13px; opacity: 0.8; }
.tomb-util-btn:hover { background: rgba(255, 255, 255, 0.8); color: #0f172a; }

.admin-drawer {
  margin-top: 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(239, 68, 68, 0.25);
  overflow: hidden; text-align: left;
}
.admin-drawer-summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 0.74rem; font-weight: 700; color: #991b1b;
  cursor: pointer;
}
.admin-drawer-summary::-webkit-details-marker { display: none; }
.admin-summary-left { display: inline-flex; align-items: center; gap: 6px; }
.admin-summary-left .ui-svg { width: 13px; height: 13px; }
.admin-drawer[open] .ui-chevron { transform: rotate(180deg); }
.ui-chevron { transition: transform 0.2s ease; }
.admin-drawer-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.admin-mini-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-admin-sub {
  flex: 1; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72); color: #1e293b; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.18s ease;
}
.btn-admin-sub:hover { background: rgba(255, 255, 255, 0.95); }
.btn-admin-danger {
  width: 100%; padding: 7px 10px; border-radius: 8px; border: none;
  background: rgba(220, 38, 38, 0.9); color: #fff; font-size: 0.74rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.18s ease;
}
.btn-admin-danger:hover { background: #b91c1c; }

/* --- Unified Modal Header & Settings System (ui-ux-pro-max) --- */
.modal-head { margin-bottom: 14px; text-align: center; }
.modal-head-icon {
  width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 8px;
  background: rgba(255, 255, 255, 0.58); border: 1px solid rgba(255, 255, 255, 0.78);
  color: #0f172a; display: flex; align-items: center; justify-content: center;
}
.modal-head-icon .ui-svg { width: 19px; height: 19px; }
.modal-head-title { font-size: 1.12rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.modal-head-sub { font-size: 0.74rem; color: #475569; margin-top: 2px; }

.setting-section {
  background: rgba(255, 255, 255, 0.52); border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; text-align: left;
}
.setting-section-title { font-size: 0.84rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.setting-section-desc { font-size: 0.71rem; color: #475569; margin-top: 2px; line-height: 1.38; }
.setting-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.setting-compact-card {
  margin-bottom: 0;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.setting-compact-card .setting-select {
  margin-top: 7px;
  padding: 7px 8px;
  font-size: 0.8rem;
  height: 36px;
}
.setting-select { width: 100%; margin-top: 8px; font-weight: 600; color: #0f172a; cursor: pointer; }
.lang-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}
.lang-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: #1e293b;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.lang-seg-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.28);
}
.lang-seg-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}
.lang-flag-svg {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setting-row-text { flex: 1; min-width: 0; }

.setting-community-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.setting-community-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.setting-community-icon svg {
  width: 17px;
  height: 17px;
}
.setting-community-btn {
  padding: 7px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}
.setting-community-btn:hover {
  background: #1e293b;
  transform: translateY(-1px);
}
.setting-community-btn:active {
  transform: scale(0.96);
}

/* Clean Toggle Switch */
.ui-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.ui-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ui-switch-track {
  width: 42px; height: 24px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.22); border: 1px solid rgba(255, 255, 255, 0.65);
  transition: background 0.2s ease; position: relative;
}
.ui-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.22);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ui-switch input:checked + .ui-switch-track { background: #0f172a; }
.ui-switch input:checked + .ui-switch-track::after { transform: translateX(18px); }

.setting-revenue-body { margin-top: 6px; }
.rev-total { font-size: 1rem; font-weight: 700; color: #0f172a; }
.rev-sub { font-size: 0.72rem; font-weight: 500; color: #475569; }
.rev-breakdown { font-size: 0.71rem; color: #334155; margin-top: 3px; }

.btn-primary-dark {
  width: 100%; margin-top: 4px; padding: 10px 14px; border-radius: 12px;
  background: #0f172a; color: #fff; border: none; font-weight: 600;
}
.btn-primary-dark:hover { background: #1e293b; }

/* --- Unified Claim / Edit / Billboard Form System --- */
.pet-name-emoji-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pet-name-emoji-row .pet-name-input {
  flex: 1;
  min-width: 0;
}
.pet-emoji-custom-input {
  width: 78px !important;
  flex-shrink: 0;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
}
.pet-inline-emoji {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
}
.pet-inline-emoji .flag-svg {
  width: 1.05em;
  height: 0.74em;
  border-radius: 2px;
  vertical-align: middle;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.avatar-upload-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.74); cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.avatar-upload-row:hover { background: rgba(255, 255, 255, 0.8); border-color: rgba(15, 23, 42, 0.18); }
.avatar-upload-thumb {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: rgba(255, 255, 255, 0.65); border: 1.5px solid rgba(255, 255, 255, 0.9);
  display: flex; align-items: center; justify-content: center; color: #475569;
}
.avatar-upload-thumb #preview-img { width: 100%; height: 100%; margin: 0; border-radius: 50%; object-fit: cover; }
.avatar-upload-placeholder { display: inline-flex; align-items: center; justify-content: center; }
.avatar-upload-placeholder .ui-svg { width: 18px; height: 18px; }
.avatar-upload-meta { flex: 1; min-width: 0; text-align: left; }
.avatar-upload-title { font-size: 0.78rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.avatar-upload-sub { font-size: 0.67rem; color: #475569; margin-top: 1px; }

.ui-upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 12px 10px; border-radius: 12px; border: 1.5px dashed rgba(15, 23, 42, 0.22);
  background: rgba(255, 255, 255, 0.48); color: #334155; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.ui-upload-zone:hover { background: rgba(255, 255, 255, 0.78); border-color: rgba(15, 23, 42, 0.4); }
.upload-icon { width: 18px; height: 18px; opacity: 0.75; }
.upload-label-text { font-size: 0.76rem; font-weight: 600; color: #1e293b; }

.bb-showcase {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  margin-top: 6px;
}
.bb-showcase-poster-wrap {
  width: 120px; height: 159px; border-radius: 12px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.78); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.45);
}
#bb-showcase-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-showcase-badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; margin-top: 4px;
  background: rgba(255, 255, 255, 0.58); border: 1px solid rgba(255, 255, 255, 0.78);
  font-size: 0.72rem; font-weight: 700; color: #0f172a;
}
.bb-showcase-name { font-size: 1.04rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.bb-showcase-desc { font-size: 0.8rem; color: #334155; line-height: 1.4; }
.bb-showcase-expiry { font-size: 0.7rem; color: #475569; }
.bb-showcase-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 4px; padding: 9px 12px; border-radius: 12px;
  background: #0f172a; color: #fff; text-decoration: none;
  font-size: 0.78rem; font-weight: 600; transition: background 0.18s ease;
}
.bb-showcase-link:hover { background: #1e293b; }
.bb-showcase-link .ui-svg { width: 14px; height: 14px; }

.form-secondary-actions { display: flex; gap: 8px; margin-top: 2px; }
.btn-form-ghost {
  flex: 1; width: 100%; padding: 9px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.48); color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.68); font-size: 0.78rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.18s ease;
}
.btn-form-ghost:hover { background: rgba(255, 255, 255, 0.82); color: #0f172a; }
.btn-form-danger-sub {
  flex: 1; padding: 9px 10px; border-radius: 12px;
  background: rgba(220, 38, 38, 0.12); color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.32); font-size: 0.78rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background 0.18s ease, color 0.18s ease;
}
.btn-form-danger-sub:hover { background: #dc2626; color: #fff; }

.guestbook-del-btn {
  background: rgba(239, 68, 68, 0.15); color: #dc2626; border: none; border-radius: 50%;
  width: 18px; height: 18px; font-size: 0.65rem; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
}
.guestbook-del-btn:hover { background: #ef4444; color: #fff; }

/* --- Static Center Guestbook Speech Bubble (Anchored Right Above Tombstone) --- */
#guestbook-bubble {
  position: fixed;
  top: auto;
  bottom: 57%;
  left: 50%;
  transform: translateX(-50%) scale(0.96);
  transform-origin: bottom center;
  width: 296px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  z-index: 145;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  contain: layout style;
  text-align: left;
}
#guestbook-bubble.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}
.gb-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gb-bubble-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
}
.gb-bubble-close {
  background: rgba(255, 255, 255, 0.45);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  color: #1e293b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}
.gb-bubble-close:hover { background: rgba(255, 255, 255, 0.82); color: #0f172a; }

.gb-bubble-list {
  max-height: 148px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 9px;
  padding-right: 2px;
}
.gb-bubble-empty {
  font-size: 0.75rem;
  color: #334155;
  text-align: center;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px dashed rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  line-height: 1.45;
}
.gb-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 7px 9px;
}
.gb-bubble-row.is-pinned {
  background: rgba(254, 249, 195, 0.65);
  border-color: rgba(217, 119, 6, 0.45);
}
.gb-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 2px;
}
.gb-pinned-badge .ui-svg { width: 10px; height: 10px; }
.gb-admin-actions { display: inline-flex; align-items: center; gap: 4px; }
.gb-pin-btn {
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.gb-pin-btn .ui-svg { width: 11px; height: 11px; }
.gb-pin-btn:hover, .gb-pin-btn.is-pinned { background: #d97706; color: #fff; }
.gb-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.gb-row-content { flex: 1; min-width: 0; }
.gb-row-msg {
  font-size: 0.78rem;
  color: #0f172a;
  line-height: 1.38;
  word-break: break-word;
}
.gb-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 0.65rem;
  color: #475569;
}
.gb-load-more-btn {
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.48);
  color: #1e293b;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease;
}
.gb-load-more-btn:hover { background: rgba(255, 255, 255, 0.82); color: #0f172a; }

.gb-bubble-composer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gb-bubble-composer.is-locked .gb-bubble-input {
  opacity: 0.65;
  cursor: not-allowed;
}
.gb-bubble-composer.is-locked .gb-bubble-send {
  opacity: 0.35;
  cursor: not-allowed;
}
.gb-bubble-input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.68);
  color: #0f172a;
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.gb-bubble-input:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.25);
}
.gb-bubble-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s ease;
}
.gb-bubble-send svg { width: 14px; height: 14px; }
.gb-bubble-send:hover { background: #1e293b; }

.gb-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  padding: 0 4px;
  font-size: 0.65rem;
  color: #475569;
}
#gb-char-count { font-weight: 600; font-variant-numeric: tabular-nums; }
#gb-char-count.near-limit { color: #dc2626; }

.gb-bubble-tail {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.42);
  border-right: 1px solid rgba(255, 255, 255, 0.58);
  border-bottom: 1px solid rgba(255, 255, 255, 0.58);
  pointer-events: none;
}

@media (max-width: 640px) {
  #guestbook-bubble {
    top: 50%;
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    transform-origin: center center;
    width: 90%;
    max-width: 340px;
    z-index: 165;
    background: rgba(255, 255, 255, 0.88);
  }
  #guestbook-bubble.active {
    transform: translate(-50%, -50%) scale(1);
  }
  #guestbook-bubble .gb-bubble-tail {
    display: none;
  }
}
.btn-edit-owner { background: rgba(241, 245, 249, 0.6); color: #0f172a; border: 1px solid rgba(255, 255, 255, 0.65); width: 100%; margin-top: 8px; padding: 9px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-edit-owner:hover { background: rgba(255, 255, 255, 0.85); }
.btn-claim { background: #10b981; color: #fff; width: 100%; margin-top: 8px; border: none; }

.claim-form { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 3px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: #1e293b; }
.claim-input, .claim-select { padding: 8px 12px; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 10px; font-size: 0.82rem; outline: none; background: rgba(255, 255, 255, 0.65); font-family: inherit; }
#billboard-preview-img { width: 84px; height: 111px; object-fit: cover; margin: 6px auto 0; display: none; border-radius: 6px; }

#tree-picker-modal {
  padding: 24px 26px; width: 94%; max-width: 580px; z-index: 160; max-height: 86vh;
}
.tree-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; text-align: left; }
.tree-section-label {
  font-size: 0.76rem; font-weight: 700; color: #334155; letter-spacing: 0.03em;
  text-transform: uppercase; margin-bottom: 8px; padding-left: 4px;
}
.tree-section-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.tree-item-btn {
  background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px; padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 88px; transition: all 0.2s;
}
.tree-item-btn:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.85); box-shadow: 0 8px 20px rgba(0,0,0,0.08); border-color: #10b981; }
.tree-item-btn.selected { background: rgba(236, 253, 245, 0.88); border-color: #10b981; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25); }
.tree-icon { font-size: 1.8rem; line-height: 1; }
.tree-title { font-size: 0.78rem; font-weight: 700; color: #0f172a; line-height: 1.25; }
.tree-sub { font-size: 0.70rem; color: #475569; }
@media (max-width: 600px) {
  .tree-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.menu-legal-footer {
  margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.75rem; color: rgba(226, 232, 240, 0.58); flex-wrap: wrap;
}
.menu-legal-footer a {
  color: rgba(226, 232, 240, 0.72); text-decoration: none; transition: color 0.18s ease;
}
.menu-legal-footer a:hover { color: #facc15; text-decoration: underline; }
.setting-legal-links {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.75rem; color: #64748b; margin: 10px 0 12px;
}
.setting-legal-links a { color: #475569; text-decoration: none; font-weight: 600; }
.setting-legal-links a:hover { color: #0f172a; text-decoration: underline; }

/* --- Lumi Credits Wallet & Polar Top-Up --- */
.credits-balance-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.90));
  border: 1px solid rgba(250, 204, 21, 0.42); border-radius: 16px;
  padding: 10px 14px; margin: 10px 0 12px; text-align: left;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}
.credits-balance-left { display: flex; align-items: center; gap: 10px; }
.credits-symbol {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(250, 204, 21, 0.16); color: #facc15; font-size: 1.05rem; font-weight: 800;
  border: 1px solid rgba(250, 204, 21, 0.4);
}
.credits-balance-label { font-size: 0.68rem; color: #94a3b8; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.credits-balance-num { font-size: 1.02rem; font-weight: 800; color: #fde047; line-height: 1.15; }
.credits-topup-btn {
  background: linear-gradient(135deg, #facc15, #f59e0b); color: #0f172a;
  border: none; border-radius: 12px; padding: 7px 12px; font-size: 0.78rem; font-weight: 800;
  cursor: pointer; font-family: inherit; transition: transform 0.15s ease, filter 0.15s ease;
}
.credits-topup-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

.pay-wallet-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.32);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 10px;
}
.pay-wallet-label { font-size: 0.76rem; color: #cbd5e1; font-weight: 600; }
.pay-wallet-right { display: flex; align-items: center; gap: 6px; }
.pay-wallet-num { font-size: 0.96rem; font-weight: 800; color: #fde047; }
.pay-wallet-refresh {
  background: rgba(255, 255, 255, 0.12); color: #e2e8f0; border: none; border-radius: 50%;
  width: 24px; height: 24px; cursor: pointer; font-size: 0.8rem; line-height: 1;
}
.pay-wallet-refresh:hover { background: rgba(255, 255, 255, 0.24); }
.pay-insufficient-banner {
  background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca; border-radius: 12px; padding: 8px 12px; font-size: 0.76rem; font-weight: 600;
  margin: 8px 0; text-align: center;
}
.pay-topup-section { margin: 10px 0 4px; text-align: left; }
.pay-topup-heading {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; font-weight: 700; color: #cbd5e1; margin-bottom: 8px;
}
.pay-topup-rate { font-size: 0.7rem; color: #94a3b8; font-weight: 600; }
.pay-topup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pay-pack-card {
  position: relative; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 14px;
  padding: 10px 10px 9px; cursor: pointer; text-align: left; color: #f8fafc;
  display: flex; flex-direction: column; gap: 3px; font-family: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.pay-pack-card:hover:not(:disabled) {
  transform: translateY(-2px); border-color: #facc15; background: rgba(250, 204, 21, 0.14);
}
.pay-pack-card:disabled { opacity: 0.6; cursor: wait; }
.pay-pack-card.popular { border-color: rgba(250, 204, 21, 0.55); background: rgba(250, 204, 21, 0.1); }
.pay-pack-badge {
  position: absolute; top: -7px; right: 8px; background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a; font-size: 0.62rem; font-weight: 800; padding: 2px 7px; border-radius: 999px;
}
.pay-pack-credits { font-size: 0.96rem; font-weight: 800; color: #fde047; }
.pay-pack-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.74rem; color: #cbd5e1; }
.pay-pack-usd { font-weight: 800; color: #ffffff; }
.store-credits-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  background: rgba(15, 23, 42, 0.88); color: #fde047; border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 999px; padding: 5px 11px; font-size: 0.78rem; font-weight: 800;
  cursor: pointer; font-family: inherit; transition: transform 0.15s ease;
}
.store-credits-chip:hover { transform: scale(1.04); }

#toast {
  position: fixed; top: 25px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 0.85rem; z-index: 200; opacity: 0; visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  contain: layout style; box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
#toast.active { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

#payment-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.92);
  background: rgba(15, 23, 42, 0.94); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 28px; padding: 24px 26px; width: 92%; max-width: 390px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); z-index: 220; opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s ease;
  contain: layout style; pointer-events: auto; text-align: center;
  color: #f8fafc; max-height: 88vh; overflow-y: auto;
}
#payment-modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.pay-tabs { display: flex; gap: 8px; margin: 12px 0; background: rgba(255,255,255,0.08); padding: 4px; border-radius: 14px; }
.pay-tab-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px; border: none; background: transparent;
  color: #cbd5e1; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.pay-tab-btn.active { background: #10b981; color: #0f172a; font-weight: 700; }
.qr-box {
  background: #ffffff; color: #0f172a; border-radius: 18px; padding: 14px; margin: 10px auto;
  width: 210px; box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.qr-box canvas { width: 150px; height: 150px; display: block; margin: 6px auto; border-radius: 8px; }
.pay-summary-box {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; text-align: left;
}
.pay-price-tag { font-size: 1.35rem; font-weight: 800; color: #34d399; }
.pay-duration-picker { margin-bottom: 10px; text-align: left; }
.pay-duration-label { font-size: 0.74rem; font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
.pay-duration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-duration-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 9px 6px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06); color: #e2e8f0; cursor: pointer; font-family: inherit;
  transition: all 0.18s ease;
}
.pay-duration-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.32); }
.pay-duration-btn.active {
  background: rgba(16, 185, 129, 0.22); border-color: #34d399; color: #ffffff;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35);
}
.pay-duration-days { font-size: 0.78rem; font-weight: 700; }
.pay-duration-price { font-size: 0.92rem; font-weight: 800; color: #34d399; }
.pay-duration-badge {
  position: absolute; top: -8px; right: 6px; padding: 1px 6px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f172a;
  font-size: 0.62rem; font-weight: 800; line-height: 1.3; box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}

#photo-mode-bar {
  position: fixed; bottom: max(26px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 10px;
  background: rgba(15, 23, 42, 0.84); border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 8px 12px; border-radius: 999px; z-index: 190;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
#photo-mode-bar.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.photo-ctrl-btn {
  border: none; border-radius: 999px; padding: 9px 18px; font-size: 0.85rem;
  font-weight: 700; cursor: pointer; font-family: inherit; transition: transform 0.15s, filter 0.2s;
}
.photo-ctrl-btn:active { transform: scale(0.95); }
.photo-capture-btn {
  background: linear-gradient(135deg, #10b981, #059669); color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.photo-capture-btn:hover { filter: brightness(1.08); }
.photo-exit-btn {
  background: rgba(255, 255, 255, 0.15); color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.photo-exit-btn:hover { background: rgba(255, 255, 255, 0.28); }

#photo-flash-overlay {
  position: fixed; inset: 0; background: #ffffff; z-index: 290;
  opacity: 0; pointer-events: none;
}
#photo-flash-overlay.flash {
  animation: cameraFlashAnim 0.42s ease-out forwards;
}
@keyframes cameraFlashAnim {
  0% { opacity: 0.82; }
  100% { opacity: 0; }
}

#confirm-dialog-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.92);
  background: rgba(255, 255, 255, 0.30); border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 28px; padding: 26px 28px; width: 90%; max-width: 360px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14); z-index: 260;
  opacity: 0; visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  contain: layout style; text-align: center; color: #0f172a;
}
#confirm-modal-icon { font-size: 1.8rem; margin-bottom: 8px; }
#confirm-modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
#confirm-modal-msg { font-size: 0.82rem; color: #1e293b; margin-bottom: 18px; line-height: 1.48; white-space: pre-line; }
.confirm-modal-actions { display: flex; gap: 10px; }
#confirm-modal-cancel-btn {
  background: rgba(255, 255, 255, 0.55); color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.75); padding: 9px; font-weight: 600;
}
#confirm-modal-cancel-btn:hover { background: rgba(255, 255, 255, 0.8); }
#confirm-modal-ok-btn {
  background: #ef4444; color: #fff; border: none; padding: 9px; font-weight: 700;
}

@media (max-width: 640px) {
  #menu-screen {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .menu-top-actions {
    position: static;
    width: 100%;
    max-width: 330px;
    justify-content: flex-end;
    margin-bottom: 18px;
    gap: 8px;
  }
  .menu-profile-pill {
    max-width: 165px;
    padding: 3px 10px 3px 4px;
  }
  .menu-profile-pill .hud-profile-sub {
    display: none;
  }
  .menu-header {
    margin-bottom: 22px;
  }
  .menu-header h1 {
    font-size: 1.55rem;
    letter-spacing: 2px;
  }
  .stage-columns-container { flex-direction: column; align-items: center; }
  .stage-column { width: 100%; max-width: 330px; }

  #island-hud {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .top-bar {
    gap: 8px;
  }
  .top-left-panel {
    padding: 3px 5px;
    gap: 4px;
  }
  .btn-hud {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.78rem;
    gap: 4px;
  }
  .top-left-panel.search-expanded #btn-exit-menu,
  .top-left-panel.search-expanded #btn-daynight {
    display: none;
  }
  .search-wrapper {
    margin-left: 2px;
  }
  .search-toggle-btn {
    width: 36px;
    height: 36px;
  }
  .search-wrapper.is-open .search-toggle-btn {
    left: 6px;
  }
  .search-wrapper.is-open .search-input,
  .search-wrapper.is-open .search-input:focus {
    width: 170px;
    min-height: 36px;
    padding: 7px 12px 7px 34px;
  }
  .search-dropdown {
    width: 210px;
  }
  .top-right-panel {
    gap: 6px;
  }
  .stage-indicator {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 6px 13px;
    font-size: 0.76rem;
    letter-spacing: 1px;
  }
  .hud-profile-pill {
    max-width: 128px;
    min-height: 38px;
    padding: 4px 10px 4px 5px;
    gap: 6px;
  }
  .hud-profile-avatar-wrap {
    width: 26px;
    height: 26px;
  }
  .hud-profile-name {
    font-size: 0.75rem;
  }
  .hud-profile-sub {
    display: none;
  }
  .hud-icon-cluster {
    gap: 6px;
  }
  .hud-utility-pill {
    padding: 2px;
  }
  .hud-utility-pill .btn-setting {
    width: 38px;
    height: 38px;
  }
  #island-hud .hud-wheel-top-left {
    left: max(12px, env(safe-area-inset-left));
    top: calc(max(12px, env(safe-area-inset-top)) + 56px);
  }
  #island-hud .hud-store-top-left {
    left: max(12px, env(safe-area-inset-left));
    top: calc(max(12px, env(safe-area-inset-top)) + 108px);
  }
  #island-hud .hud-photo-bottom-left {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) {
  .btn-hud {
    min-height: 40px;
  }
  .modal-close {
    width: 36px;
    height: 36px;
  }
  .modal-close::before {
    content: "";
    position: absolute;
    inset: -4px;
  }
  .tomb-nav-pill-btn {
    width: 42px;
    height: 42px;
  }
  .tomb-nav-pill-btn::before {
    content: "";
    position: absolute;
    inset: -4px;
  }
  .stage-card-delete-btn {
    width: 32px;
    height: 32px;
  }
  .stage-card-delete-btn::before {
    content: "";
    position: absolute;
    inset: -6px;
  }
  .gb-bubble-close {
    position: relative;
    width: 28px;
    height: 28px;
  }
  .gb-bubble-close::before {
    content: "";
    position: absolute;
    inset: -8px;
  }
  .gb-pin-btn,
  .guestbook-del-btn {
    position: relative;
    width: 26px;
    height: 26px;
  }
  .gb-pin-btn::before,
  .guestbook-del-btn::before {
    content: "";
    position: absolute;
    inset: -9px;
  }
  .gb-bubble-send {
    position: relative;
    width: 36px;
    height: 36px;
  }
  .gb-bubble-send::before {
    content: "";
    position: absolute;
    inset: -4px;
  }
  .btn-setting {
    width: 42px;
    height: 42px;
  }
  .hud-utility-pill .btn-setting {
    width: 40px;
    height: 40px;
  }
  .hud-wheel-top-left,
  .hud-store-top-left,
  .hud-photo-bottom-left {
    width: 44px;
    height: 44px;
  }
  .search-toggle-btn {
    width: 38px;
    height: 38px;
  }
  .search-toggle-btn::before {
    content: "";
    position: absolute;
    inset: -3px;
  }
  .profile-badge-chip {
    min-height: 38px;
    padding: 6px 11px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  #island-hud {
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .top-bar { gap: 6px; }
  .btn-hud { min-height: 38px; padding: 7px 11px; font-size: 0.76rem; }
  .stage-indicator, .gfx-badge { padding: 5px 11px; font-size: 0.72rem; }
  .stage-indicator { right: max(12px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
  .btn-setting { width: 40px; height: 40px; font-size: 0.92rem; }
  .hud-utility-pill .btn-setting { width: 38px; height: 38px; }
  #island-hud .hud-wheel-top-left {
    left: max(12px, env(safe-area-inset-left));
    top: calc(max(10px, env(safe-area-inset-top)) + 52px);
    width: 40px;
    height: 40px;
  }
  #island-hud .hud-store-top-left {
    left: max(12px, env(safe-area-inset-left));
    top: calc(max(10px, env(safe-area-inset-top)) + 100px);
    width: 40px;
    height: 40px;
  }
  #island-hud .hud-photo-bottom-left {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: 40px;
    height: 40px;
  }
  .search-wrapper.is-open .search-input,
  .search-wrapper.is-open .search-input:focus {
    width: 155px;
    min-height: 36px;
    padding: 6px 12px 6px 32px;
    font-size: 0.76rem;
  }
  #tomb-modal, #billboard-modal {
    left: 14px;
    top: 53%;
    width: 256px;
    max-width: 256px;
    max-height: calc(100vh - 60px);
    padding: 13px 15px;
    border-radius: 18px;
  }
  #setting-modal, #payment-modal, #tree-picker-modal, #profile-modal {
    max-height: 86vh;
    padding: 16px 18px;
    border-radius: 20px;
  }
  .hud-profile-pill { padding: 3px 9px 3px 4px; gap: 6px; }
  .hud-profile-avatar-wrap { width: 24px; height: 24px; }
  .hud-profile-name { font-size: 0.72rem; }
  .hud-profile-sub { display: none; }
  #guestbook-bubble {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.96);
    transform-origin: center center;
    width: 280px;
    padding: 10px 12px;
    border-radius: 16px;
    max-height: calc(100vh - 48px);
  }
  #guestbook-bubble.active {
    transform: translate(-50%, -50%) scale(1);
  }
  #guestbook-bubble .gb-bubble-tail {
    display: none;
  }
  .gb-bubble-header { margin-bottom: 5px; }
  .gb-bubble-list { max-height: 68px; gap: 5px; }
  .gb-bubble-row { padding: 5px 7px; font-size: 0.72rem; }
  .gb-bubble-composer { margin-top: 6px; }
  .gb-bubble-input { padding: 6px 9px; font-size: 0.74rem; }
  .gb-bubble-send { width: 28px; height: 28px; }
  #photo-mode-bar { bottom: 12px; padding: 6px 10px; }
  .photo-ctrl-btn { padding: 7px 14px; font-size: 0.8rem; }
}

/* --- Mobile Portrait Landscape-Recommendation Overlay --- */
#mobile-landscape-prompt {
  position: fixed;
  inset: 0;
  z-index: 255;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#mobile-landscape-prompt.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.landscape-prompt-card {
  width: 100%;
  max-width: 310px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 24px 22px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  color: #0f172a;
}
.landscape-prompt-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landscape-prompt-icon svg {
  width: 32px;
  height: 32px;
  animation: phoneTiltHint 2.2s ease-in-out infinite;
}
@keyframes phoneTiltHint {
  0%, 20% { transform: rotate(0deg); }
  50%, 75% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
.landscape-prompt-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
.landscape-prompt-desc {
  font-size: 0.8rem;
  line-height: 1.48;
  color: #475569;
  margin: 0 0 18px;
}
.landscape-prompt-primary {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25);
  margin-bottom: 8px;
}
.landscape-prompt-secondary {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Daily Sanctuary Wheel ===== */
#daily-wheel-modal {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.56);
  pointer-events: auto;
}

#daily-wheel-modal.hidden,
#wheel-result-box.hidden,
#btn-wheel-apply.hidden {
  display: none;
}

.hud-wheel-top-left {
  position: fixed;
  top: calc(max(20px, env(safe-area-inset-top)) + 56px);
  left: max(20px, env(safe-area-inset-left));
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.hud-wheel-top-left:hover {
  transform: scale(1.08);
}

.hud-store-top-left {
  position: fixed;
  top: calc(max(20px, env(safe-area-inset-top)) + 108px);
  left: max(20px, env(safe-area-inset-left));
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.hud-store-top-left:hover {
  transform: scale(1.08);
}
.store-notify-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  border: 1.5px solid #ffffff;
  pointer-events: none;
}

.wheel-notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6b6b;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
  animation: wheelPulse 1.6s infinite ease-in-out;
}

@keyframes wheelPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.8; }
}

.daily-wheel-shell {
  position: relative;
  width: min(92vw, 400px);
  padding: 24px 20px 22px;
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(255, 252, 245, 0.98), rgba(242, 247, 255, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  contain: layout style;
  text-align: center;
  color: #1e293b;
}

.wheel-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wheel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #d97706;
  margin-bottom: 4px;
}

.wheel-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: #0f172a;
}

.wheel-subtitle {
  margin: 4px 0 8px;
  font-size: 12.5px;
  color: #64748b;
}

.wheel-pity-bar {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.wheel-tier-legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-common { background: #f1f5f9; color: #475569; }
.legend-common .legend-dot { background: #94a3b8; }

.legend-rare { background: #dbeafe; color: #1d4ed8; }
.legend-rare .legend-dot { background: #3b82f6; }

.legend-mythic { background: #fef3c7; color: #b45309; border: 1px solid rgba(245, 158, 11, 0.45); }
.legend-mythic .legend-dot { background: #f59e0b; }

.wheel-result-box.tier-common {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(148, 163, 184, 0.45);
}

.wheel-result-box.tier-rare {
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.96), rgba(224, 231, 255, 0.92));
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.16);
}

.wheel-result-box.tier-mythic {
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.98), rgba(253, 230, 138, 0.45));
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
}

.wheel-result-badge.tier-common { background: #f1f5f9; color: #475569; }
.wheel-result-badge.tier-rare { background: #dbeafe; color: #1d4ed8; }
.wheel-result-badge.tier-mythic {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #ffffff;
}

.wheel-stage {
  position: relative;
  width: 270px;
  height: 270px;
  margin: 0 auto 16px;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 24px;
  color: #ef4444;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.wheel-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #f59e0b;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22), inset 0 0 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: transform 4.2s cubic-bezier(0.14, 0.86, 0.22, 1);
  will-change: transform;
}

.wheel-disc canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-center-cap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbbf24, #d97706);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fffbeb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wheel-result-box {
  margin: 0 auto 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.wheel-result-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  margin-bottom: 6px;
}

.wheel-result-text {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.wheel-result-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

.wheel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wheel-spin-btn,
.wheel-apply-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.2s ease;
}

.wheel-spin-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.35);
}

.wheel-spin-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.wheel-spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.wheel-apply-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.wheel-placement-banner {
  position: fixed;
  top: calc(max(20px, env(safe-area-inset-top)) + 56px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 11px 16px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  contain: layout style;
  pointer-events: auto;
  max-width: min(94vw, 620px);
}

.wheel-placement-banner.hidden {
  display: none;
}

.wheel-placement-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.wheel-placement-cancel {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.wheel-placement-cancel:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: transparent;
}

.tomb-wheel-effect-pill {
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: #92400e;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(253, 230, 138, 0.65));
  border: 1px solid rgba(245, 158, 11, 0.45);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.16s ease, box-shadow 0.16s ease;
}
.tomb-wheel-effect-pill:hover {
  filter: brightness(1.04);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}
.tomb-wheel-effect-pill:active {
  transform: scale(0.98);
}

.tomb-wheel-effect-time {
  font-size: 0.72rem;
  color: #b45309;
}

/* ===== Admin Gift Box Config Modal ===== */
#gift-config-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.56);
  pointer-events: auto;
}

#gift-config-modal.hidden {
  display: none;
}

.gift-reward-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 16px;
  text-align: left;
}

.gift-opt-btn {
  padding: 10px 11px;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.gift-opt-btn.selected {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.gift-opt-btn:active {
  transform: scale(0.97);
}
.gift-config-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-gift-delete {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-gift-delete:hover {
  background: #dc2626;
  color: #ffffff;
}
.gift-reveal-shell {
  max-width: 390px;
  text-align: center;
}
.gift-reveal-icon {
  font-size: 3.1rem;
  line-height: 1.1;
  margin: 8px 0 6px;
}
.gift-reveal-desc {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.5;
  margin: 8px 0 18px;
}
.gift-reveal-actions {
  display: flex;
  gap: 8px;
}
.gift-reveal-place-btn {
  flex: 1.3;
}

/* --- Interactive Image Cropper Modal --- */
.cropper-overlay {
  position: fixed;
  inset: 0;
  z-index: 270;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
.cropper-overlay.hidden {
  display: none;
}
.cropper-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 20px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #0f172a;
}
.cropper-head {
  text-align: center;
  padding-right: 22px;
  padding-left: 22px;
}
.cropper-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.cropper-subtitle {
  font-size: 0.72rem;
  color: #475569;
  margin-top: 2px;
}
.cropper-stage-wrap {
  width: 100%;
  height: min(320px, 46vh);
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#cropper-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#cropper-canvas:active {
  cursor: grabbing;
}
.cropper-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cropper-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cropper-zoom-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  flex-shrink: 0;
}
.cropper-zoom-slider {
  flex: 1;
  accent-color: #0f172a;
  cursor: pointer;
}
.cropper-zoom-value {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cropper-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}
.cropper-tool-btn {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.cropper-tool-btn:hover {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.3);
}
.cropper-tool-btn:active {
  transform: scale(0.97);
}
.cropper-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.cropper-confirm-btn {
  flex: 1.4;
  margin-top: 0 !important;
}

/* --- Sanctuary Store Modal --- */
.store-overlay {
  position: fixed;
  inset: 0;
  z-index: 206;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
.store-tabs.hidden,
.store-section.hidden,
.store-direct-target-banner.hidden,
.store-overlay.hidden,
.store-empty-notice.hidden,
.store-sections-wrap.hidden,
.store-inv-panel.hidden {
  display: none;
}
.store-direct-target-banner {
  padding: 10px 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(253, 230, 138, 0.55));
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #78350f;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-direct-row {
  font-size: 0.8rem;
}
.store-direct-sub {
  font-size: 0.71rem;
  color: #92400e;
  font-weight: 600;
}
.store-item-card.is-locked {
  opacity: 0.68;
}
.store-buy-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}
.store-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(226, 232, 240, 0.72);
  flex-shrink: 0;
}
.store-tab-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.store-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
}
.store-inventory-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.inv-item-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.inv-item-row:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.22);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.inv-item-row.is-effect {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.95));
}
.inv-item-row.is-effect:hover {
  border-color: rgba(217, 119, 6, 0.65);
}
.inv-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.inv-item-info {
  flex: 1;
  min-width: 0;
}
.inv-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inv-dur-pill {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}
.inv-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 0.69rem;
  color: #64748b;
}
.inv-claim-exp {
  color: #b45309;
  font-weight: 600;
}
.inv-claim-safe {
  color: #047857;
  font-weight: 600;
}
.inv-place-btn {
  padding: 8px 12px;
  border-radius: 11px;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}
.inv-place-btn:hover {
  background: #1e293b;
}
.inv-place-btn:active {
  transform: scale(0.96);
}

/* --- Live Preview Placement Banner Enhancements --- */
.wheel-placement-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.wheel-placement-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.wheel-placement-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wheel-placement-confirm {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.wheel-placement-confirm:hover {
  filter: brightness(1.08);
}
.wheel-placement-confirm:active {
  transform: scale(0.96);
}
.wheel-placement-confirm.hidden {
  display: none;
}
.store-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: min(86vh, 760px);
  max-height: 88vh;
  overflow: hidden;
  padding: 22px 20px 20px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.34);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.store-header {
  text-align: center;
  padding: 0 26px;
  flex-shrink: 0;
}
.store-body-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  padding: 2px 4px 6px 2px;
  margin-right: -4px;
  display: flex;
  flex-direction: column;
}
.store-body-scroll::-webkit-scrollbar {
  width: 5px;
}
.store-body-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.store-body-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
}
.store-body-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.65);
}
.store-inv-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  animation: storeTabFadeIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes storeTabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.store-target-box {
  background: rgba(241, 245, 249, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.store-target-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
}
.store-slot-select {
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
}
.store-slot-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
  align-items: center;
}
.store-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #334155;
}
.store-status-chip.effect {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: rgba(217, 119, 6, 0.45);
  color: #78350f;
}
.store-status-empty {
  font-size: 0.72rem;
  color: #64748b;
}
.store-empty-notice {
  margin: auto 0;
  padding: 24px 16px;
  border-radius: 16px;
  background: rgba(254, 243, 199, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}
.store-sections-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: storeTabFadeIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.store-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.store-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.store-section-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.store-duration-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}
.store-dur-pill {
  border: none;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}
.store-dur-pill:hover {
  color: #0f172a;
}
.store-dur-pill:active {
  transform: scale(0.95);
}
.store-dur-pill.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}
.store-dur-pill[data-days="30"].active {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.32);
}
.store-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.store-section-note {
  font-size: 0.68rem;
  color: #64748b;
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  perspective: 1150px;
}
.store-grid-offerings {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.store-item-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 11px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, box-shadow;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.store-item-card::after {
  content: "";
  position: absolute;
  inset: -120%;
  background: linear-gradient(
    45deg,
    transparent 41.5%,
    rgba(255, 255, 255, 0.40) 44.2%,
    transparent 46.8%,
    rgba(253, 230, 138, 0.36) 49.2%,
    rgba(255, 255, 255, 0.74) 52%,
    rgba(255, 255, 255, 0.18) 55.2%,
    transparent 58.5%
  );
  transform: translate(-28%, 28%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}
.store-item-card:not(.is-mythic):not(.offering)::after {
  background: linear-gradient(
    45deg,
    transparent 41.5%,
    rgba(255, 255, 255, 0.38) 44.2%,
    transparent 46.8%,
    rgba(186, 230, 253, 0.36) 49.2%,
    rgba(255, 255, 255, 0.70) 52%,
    rgba(224, 242, 254, 0.18) 55.2%,
    transparent 58.5%
  );
}
#sanctuary-store-modal.hidden .store-item-card::after {
  animation: none !important;
}
.store-item-card.is-mythic::after {
  animation: storeMythicSheen 5.6s linear infinite;
}
.store-item-card.is-mythic:nth-child(1)::after { animation-delay: 0.3s; }
.store-item-card.is-mythic:nth-child(2)::after { animation-delay: 0.9s; }
.store-item-card.is-mythic:nth-child(3)::after { animation-delay: 1.5s; }
.store-item-card:not(.is-mythic):not(.is-flipping-out):not(.is-flipping-in):not(.is-locked):hover::after {
  animation: storeHoverSheen 1.15s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}
@keyframes storeMythicSheen {
  0% {
    opacity: 0;
    transform: translate(-28%, 28%);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  4% {
    opacity: 0.92;
  }
  25% {
    opacity: 0.92;
  }
  29% {
    opacity: 0;
    transform: translate(28%, -28%);
  }
  100% {
    opacity: 0;
    transform: translate(28%, -28%);
  }
}
@keyframes storeHoverSheen {
  0% {
    opacity: 0;
    transform: translate(-28%, 28%);
  }
  14% {
    opacity: 0.9;
  }
  84% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(28%, -28%);
  }
}
.store-item-card.is-flipping-out {
  pointer-events: none;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}
.store-item-card.is-flipping-in {
  pointer-events: none;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}
.store-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 23, 42, 0.25);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
}
.store-item-card.is-mythic {
  background: linear-gradient(155deg, rgba(255, 251, 235, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
  border-color: rgba(245, 158, 11, 0.42);
}
.store-item-card.is-mythic:hover {
  border-color: rgba(245, 158, 11, 0.72);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.16);
}
.store-item-card.is-active-on-slot {
  border-color: rgba(16, 185, 129, 0.55);
}
.store-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.store-item-icon {
  font-size: 1.45rem;
  line-height: 1;
}
.store-item-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.store-item-badge.mythic {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
}
.store-item-badge.special {
  background: #e0f2fe;
  color: #0369a1;
}
.store-item-badge.offering {
  background: #f1f5f9;
  color: #475569;
}
.store-item-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.store-item-desc {
  font-size: 0.69rem;
  color: #475569;
  line-height: 1.38;
  flex: 1;
}
.store-buy-btn {
  margin-top: 4px;
  width: 100%;
  padding: 8px 8px;
  border-radius: 10px;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.store-buy-btn:hover {
  background: #1e293b;
}
.store-buy-btn:active {
  transform: scale(0.97);
}
.store-buy-btn.mythic {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
}
.store-buy-btn.offering {
  background: #334155;
}
@media (max-width: 540px) {
  .store-shell {
    height: 88vh;
    padding: 18px 14px 16px;
  }
  .store-grid-offerings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dev Performance Profiler Panel */
#dev-profiler-panel {
  position: fixed;
  top: calc(max(20px, env(safe-area-inset-top)) + 144px);
  right: max(20px, env(safe-area-inset-right));
  width: 248px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 184, 87, 0.35);
  border-radius: 16px;
  padding: 12px 14px;
  color: #f1f5f9;
  font-size: 0.76rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  z-index: 230;
  display: none;
  pointer-events: auto;
}
#dev-profiler-panel.active {
  display: block;
}
.dev-prof-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fef08a;
  margin-bottom: 8px;
}
.dev-prof-close {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dev-prof-close:hover {
  background: rgba(255, 255, 255, 0.24);
}
.dev-prof-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.dev-prof-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cbd5e1;
}
.dev-prof-stat-row strong {
  color: #f8fafc;
  font-weight: 600;
}
.dev-prof-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 9px 0;
}
.dev-prof-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dev-prof-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.74rem;
}
.dev-prof-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #10b981;
  cursor: pointer;
  flex-shrink: 0;
}
.dev-prof-reset-btn {
  margin-top: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}
.dev-prof-reset-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
