/* ── M2 World · Medieval Village Hub ────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cinzel+Decorative:wght@400;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --m2w-gold:     #c8941a;
  --m2w-gold-lt:  #e8b840;
  --m2w-gold-dk:  #7a5010;
  --m2w-bg:       rgba(18, 12, 6, 0.88);
  --m2w-bg-solid: #1a120a;
  --m2w-surface:  rgba(30, 20, 10, 0.92);
  --m2w-border:   rgba(168, 120, 50, 0.5);
  --m2w-border2:  rgba(90, 60, 20, 0.4);
  --m2w-text:     #f0e8d8;
  --m2w-dim:      #a89070;
  --m2w-hi:       #f0c040;
  --m2w-serif:    'Cinzel', 'Georgia', serif;
  --m2w-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --m2w-radius:   6px;
}


/* ── Full-screen page resets ────────────────────────────────────────── */
.m2w-fullscreen,
.m2w-fullscreen body {
  margin: 0; padding: 0;
  width: 100vw; height: 100vh;
  overflow: hidden; background: #0a0806;
}

/* ── Outer wrapper ──────────────────────────────────────────────────── */
.m2w-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: var(--m2w-sans);
  color: var(--m2w-text);
  background: #0a0806;
  box-sizing: border-box;
}

.m2w-wrap *, .m2w-wrap *::before, .m2w-wrap *::after {
  box-sizing: border-box;
}

/* Full-screen variant */
.m2w-wrap--full {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Embedded variant (shortcode) */
.m2w-wrap:not(.m2w-wrap--full) {
  max-width: 720px;
  margin: 24px auto;
  border-radius: var(--m2w-radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(168,120,50,0.3);
}

/* ── HUD ────────────────────────────────────────────────────────────── */
.m2w-hud {
  display: flex;
  align-items: center;
  background: var(--m2w-bg-solid);
  border-bottom: 1px solid var(--m2w-border);
  padding: 0 16px;
  height: 40px;
  flex-shrink: 0;
  gap: 12px;
  z-index: 20;
}

.m2w-hud-brand {
  font-family: var(--m2w-serif);
  color: var(--m2w-gold);
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 13px;
  flex: 1;
  text-transform: uppercase;
}

.m2w-hud-name {
  color: var(--m2w-dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.m2w-hud-pts {
  color: var(--m2w-hi);
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
}

/* ── Canvas wrapper ─────────────────────────────────────────────────── */
.m2w-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0806;
  overflow: hidden;
}

/* Embedded: enforce aspect ratio */
.m2w-wrap:not(.m2w-wrap--full) .m2w-canvas-wrap {
  aspect-ratio: 16 / 9;
}

#m2w-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* ── Cursor label ───────────────────────────────────────────────────── */
.m2w-cursor-label {
  display: none;
  position: absolute;
  pointer-events: none;
  background: var(--m2w-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--m2w-border);
  border-radius: 4px;
  color: var(--m2w-gold-lt);
  font-family: var(--m2w-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  white-space: nowrap;
  z-index: 30;
  text-transform: uppercase;
}

/* ── Zone panel ─────────────────────────────────────────────────────── */
.m2w-panel {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  max-height: 0;
  overflow: hidden;
  background: var(--m2w-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--m2w-border);
  border-radius: var(--m2w-radius);
  display: flex;
  flex-direction: column;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
  opacity: 0;
  z-index: 25;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

.m2w-panel:not(.m2w-panel--hidden) {
  max-height: 52%;
  opacity: 1;
}

.m2w-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 20, 10, 0.6);
  border-bottom: 1px solid var(--m2w-border2);
  padding: 8px 14px;
  flex-shrink: 0;
}

.m2w-panel-close {
  background: transparent;
  border: 1px solid var(--m2w-border2);
  border-radius: 4px;
  color: var(--m2w-dim);
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.m2w-panel-close:hover {
  background: rgba(168, 120, 50, 0.15);
  color: var(--m2w-gold-lt);
  border-color: var(--m2w-border);
}

.m2w-panel-icon {
  font-size: 20px;
  line-height: 1;
}

.m2w-panel-title {
  flex: 1;
  font-family: var(--m2w-serif);
  color: var(--m2w-gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── Stats strip ────────────────────────────────────────────────────── */
.m2w-panel-stats {
  display: flex;
  border-bottom: 1px solid var(--m2w-border2);
  flex-shrink: 0;
}

.m2w-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-right: 1px solid var(--m2w-border2);
}

.m2w-stat:last-child { border-right: none; }

.m2w-stat-val {
  color: var(--m2w-hi);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.m2w-stat-label {
  color: var(--m2w-dim);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── Item list ──────────────────────────────────────────────────────── */
.m2w-panel-items {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.m2w-panel-items::-webkit-scrollbar { width: 4px; }
.m2w-panel-items::-webkit-scrollbar-track { background: transparent; }
.m2w-panel-items::-webkit-scrollbar-thumb { background: var(--m2w-gold-dk); border-radius: 2px; }

.m2w-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(40, 28, 12, 0.5);
  font-size: 12px;
  transition: background 0.12s ease;
}

.m2w-item:hover { background: rgba(168, 120, 50, 0.08); }
.m2w-item:last-child { border-bottom: none; }

.m2w-item--enrolled .m2w-item-title { color: var(--m2w-hi); }
.m2w-item--done     .m2w-item-title { color: #80c860; }
.m2w-item--done     .m2w-item-title::after { content: ' \2713'; font-weight: bold; }
.m2w-item--locked   { opacity: 0.45; }
.m2w-item--locked   .m2w-item-title { color: var(--m2w-dim); }
.m2w-item--activity { flex-direction: column; align-items: flex-start; gap: 3px; }

.m2w-item-icon  { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.m2w-item-title { flex: 1; color: var(--m2w-text); line-height: 1.35; font-weight: 500; }
.m2w-item-cost  { color: var(--m2w-hi); font-size: 11px; white-space: nowrap; font-weight: 600; }
.m2w-item-user  { color: var(--m2w-gold); font-size: 11px; font-weight: 600; }
.m2w-item-text  { color: var(--m2w-dim); font-size: 11px; line-height: 1.4; }
.m2w-item-time  { color: #5a4830; font-size: 9px; font-weight: 500; }

/* ── Progress bar ───────────────────────────────────────────────────── */
.m2w-prog {
  width: 60px; height: 5px;
  background: rgba(20, 12, 4, 0.6);
  border: 1px solid var(--m2w-gold-dk);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.m2w-prog-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold));
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ── Button ─────────────────────────────────────────────────────────── */
.m2w-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, rgba(168, 120, 50, 0.2), rgba(100, 60, 20, 0.3));
  border: 1px solid var(--m2w-gold-dk);
  border-radius: 4px;
  color: var(--m2w-gold-lt);
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.m2w-btn:hover {
  background: linear-gradient(180deg, rgba(200, 148, 26, 0.3), rgba(120, 80, 20, 0.4));
  border-color: var(--m2w-gold);
  color: #fff;
  box-shadow: 0 0 12px rgba(200, 148, 26, 0.2);
}

/* ── Panel footer ───────────────────────────────────────────────────── */
.m2w-panel-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--m2w-border2);
  text-align: right;
  flex-shrink: 0;
}

.m2w-panel-footer:empty { display: none; }

/* ── Loading veil ───────────────────────────────────────────────────── */
@keyframes m2w-spin {
  to { transform: rotate(360deg); }
}

@keyframes m2w-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

@keyframes m2w-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(200,148,26,0.4), 0 0 60px rgba(200,148,26,0.1); }
  50%       { text-shadow: 0 0 40px rgba(200,148,26,0.8), 0 0 80px rgba(200,148,26,0.3); }
}

.m2w-loading {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(60,30,8,0.6) 0%, rgba(10,8,6,0) 70%),
    #0a0806;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: opacity 0.5s ease;
}

.m2w-loading--hidden {
  opacity: 0;
  pointer-events: none;
}

.m2w-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.m2w-loading-brand {
  font-family: var(--m2w-serif);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  color: var(--m2w-gold);
  letter-spacing: 10px;
  text-transform: uppercase;
  animation: m2w-glow 3s ease infinite;
}

.m2w-loading-sub {
  color: var(--m2w-dim);
  font-family: var(--m2w-serif);
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-top: -10px;
}

.m2w-loading-ornament {
  color: var(--m2w-gold-dk);
  font-size: 13px;
  letter-spacing: 6px;
  opacity: 0.7;
}

.m2w-spinner {
  color: var(--m2w-gold);
  font-size: 26px;
  display: inline-block;
  animation: m2w-spin 1.2s linear infinite;
  text-shadow: 0 0 16px rgba(200,148,26,0.6);
}

.m2w-load-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(168,120,50,0.18);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.m2w-load-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold), var(--m2w-gold-lt));
  border-radius: 2px;
  transition: width 0.25s ease;
  box-shadow: 0 0 8px rgba(200,148,26,0.5);
}

.m2w-load-text {
  color: var(--m2w-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  animation: m2w-pulse 2s ease infinite;
  margin-top: -4px;
}

.m2w-load-tip {
  color: var(--m2w-dim);
  font-family: var(--m2w-serif);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.5px;
  max-width: 320px;
  text-align: center;
  line-height: 1.5;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.m2w-load-tip--on { opacity: 1; }

/* ── Multiplayer overlays container ─────────────────────────────────── */
.m2w-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 55;  /* must sit above .m2w-tavern (z-index:48) */
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.m2w-overlays--hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

/* ── Player name label (positioned via JS) ─────────────────────────── */
.m2w-player-label {
  position: absolute;
  font-family: var(--m2w-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
  transform: translate(-50%, 0);
  transition: left 0.15s linear, top 0.15s linear;
}

/* ── Streak badge (floats above player label) ───────────────────────── */
.m2w-streak-badge {
  position: absolute;
  font-family: var(--m2w-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid currentColor;
  background: rgba(0,0,0,0.7);
  transform: translate(-50%, -100%);
  margin-top: -3px;
  transition: left 0.15s linear, top 0.15s linear;
}
.m2w-streak--bronze   { color: #c87820; }
.m2w-streak--silver   { color: #90c0e0; }
.m2w-streak--gold     { color: #e8b820; text-shadow: 0 0 6px rgba(232,184,32,0.7); }
.m2w-streak--legendary {
  color: #d070ff;
  text-shadow: 0 0 8px rgba(160,64,240,0.9);
  animation: m2w-legendary-pulse 2s ease-in-out infinite;
}
@keyframes m2w-legendary-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(160,64,240,0.6); }
  50%       { text-shadow: 0 0 14px rgba(208,112,255,1); }
}

/* ── Admin streak test panel ────────────────────────────────────────── */
.m2w-streak-admin {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 10px 14px;
  background: rgba(10,6,2,0.85);
  border: 1px solid #b87020;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  color: #e8b820;
  user-select: none;
}
.m2w-streak-admin-title {
  letter-spacing: 1px;
  font-weight: 700;
  color: #d8a020;
  flex: 0 0 100%;
  margin-bottom: 4px;
}
.m2w-streak-admin-slider {
  flex: 1 1 120px;
  accent-color: #e8b820;
  cursor: pointer;
}
.m2w-streak-admin-val {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}
.m2w-streak-admin-save,
.m2w-streak-admin-reset {
  background: rgba(184,112,32,0.25);
  border: 1px solid #b87020;
  border-radius: 4px;
  color: #e8b820;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  font-family: monospace;
}
.m2w-streak-admin-save:hover,
.m2w-streak-admin-reset:hover { background: rgba(184,112,32,0.45); }

/* ── Chat bubble (Club Penguin style) ──────────────────────────────── */
.m2w-chat-bubble {
  position: absolute;
  background: #fff;
  color: #1a120a;
  font-family: var(--m2w-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 12px;
  border-radius: 14px;
  max-width: 180px;
  word-wrap: break-word;
  text-align: center;
  transform: translate(-50%, -100%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: m2w-bubble-in 0.2s ease-out;
  transition: left 0.15s linear, top 0.15s linear;
}

.m2w-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}

@keyframes m2w-bubble-in {
  from { transform: translate(-50%, -100%) scale(0.5); opacity: 0; }
  to   { transform: translate(-50%, -100%) scale(1);   opacity: 1; }
}

/* ── Chat input bar ────────────────────────────────────────────────── */
.m2w-chat-bar {
  position: absolute;
  bottom: 80px;  /* above toolbar (72px) */
  left: 50%;
  transform: translateX(-50%);
  z-index: 58;  /* above toolbar (57) */
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.m2w-chat-bar--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.m2w-chat-input {
  width: 280px;
  max-width: 80vw;
  padding: 8px 14px;
  font-family: var(--m2w-sans);
  font-size: 13px;
  color: var(--m2w-text);
  background: var(--m2w-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--m2w-border);
  border-radius: 20px;
  outline: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.m2w-chat-input::placeholder { color: var(--m2w-dim); }
.m2w-chat-input:focus { border-color: var(--m2w-gold); }
/* ── Emote wheel ───────────────────────────────────────────────────── */
.m2w-emote-wheel {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--m2w-surface, rgba(30,20,10,0.95));
  border: 1.5px solid var(--m2w-border, rgba(168,120,50,0.5));
  border-radius: 10px;
  padding: 10px 10px 6px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,200,80,0.06);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.m2w-emote-wheel--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.m2w-emote-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

@media (max-width: 500px) {
  .m2w-emote-grid { grid-template-columns: repeat(4, 1fr); }
}

.m2w-emote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 68px;
  min-height: 48px;
  padding: 5px 4px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--m2w-border2, rgba(90,60,20,0.4));
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  color: var(--m2w-text, #f0e8d8);
}

.m2w-emote-btn:hover {
  background: rgba(200,148,26,0.18);
  border-color: var(--m2w-gold, #c8941a);
  transform: scale(1.08);
}

.m2w-emote-sym {
  font-size: 12px;
  line-height: 1.2;
  font-family: 'Courier New', monospace;
  color: var(--m2w-hi, #f0c040);
  white-space: nowrap;
}

.m2w-emote-lbl {
  font-size: 9px;
  font-family: var(--m2w-sans, sans-serif);
  color: var(--m2w-dim, #a89070);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.m2w-emote-hint {
  text-align: center;
  color: var(--m2w-dim, #a89070);
  font-size: 10px;
  margin-top: 7px;
  font-family: var(--m2w-sans, sans-serif);
}

/* ── Floating emote bubble (above player head) ──────────────────────── */
.m2w-floating-emote {
  position: absolute;
  background: rgba(12, 8, 4, 0.90);
  border: 1.5px solid var(--m2w-gold, #c8941a);
  border-radius: 7px;
  padding: 3px 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--m2w-hi, #f0c040);
  white-space: nowrap;
  pointer-events: none;
  animation: m2w-emote-rise 0.25s ease-out forwards, m2w-emote-fade 0.5s ease-in 3.5s forwards;
  z-index: 57;
}

.m2w-floating-emote::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--m2w-gold, #c8941a);
  border-bottom: none;
}

@keyframes m2w-emote-rise {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0;   }
}

@keyframes m2w-emote-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}


/* ── Key-instruction chips (menu, controls) ────────────────────────── */
.m2w-menu-hint,
.m2w-controls-hint {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: var(--m2w-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--m2w-border2);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(200,148,26,0.08);
  font-family: var(--m2w-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--m2w-gold-lt);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  white-space: nowrap;
  transition: color 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
}
.m2w-menu-hint kbd,
.m2w-controls-hint kbd {
  display: inline-block;
  background: rgba(200,148,26,0.12);
  border: 1px solid var(--m2w-gold-dk);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--m2w-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--m2w-gold-lt);
  margin: 0 1px;
}

/* ── Toast (top-left status messages, e.g. login success) ──────────── */
.m2w-toast {
  position: absolute;
  top: 52px; left: 14px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px;
  max-width: 320px;
  background: var(--m2w-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--m2w-border);
  border-left: 3px solid var(--m2w-gold);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 28px rgba(200,148,26,0.12);
  font-family: var(--m2w-serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--m2w-gold-lt);
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.4,0,.2,1);
}
.m2w-toast--show { opacity: 1; transform: translateY(0); }
.m2w-toast--success { border-left-color: #6fbf5f; }
.m2w-toast--error   { border-left-color: #d85050; color: #f0c8c8; }
.m2w-toast-orn { color: var(--m2w-gold); font-size: 10px; }
.m2w-toast-msg { color: inherit; }

/* ── Music toast (keyboard mute hint) ──────────────────────────────── */
.m2w-music-toast {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 200;
  width: min(320px, calc(100% - 28px));
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.4,0,.2,1);
}
.m2w-music-toast--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.m2w-music-toast-glow {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -14px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(200,148,26,0.32) 0%, rgba(200,148,26,0.1) 40%, rgba(200,148,26,0) 75%);
  filter: blur(18px);
  opacity: 0.75;
}
.m2w-music-toast-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  background:
    linear-gradient(180deg, rgba(52,35,18,0.96) 0%, rgba(21,14,8,0.94) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(168, 120, 50, 0.62);
  border-radius: 10px;
  box-shadow:
    0 14px 34px rgba(0,0,0,0.52),
    inset 0 1px 0 rgba(255,234,190,0.08),
    inset 0 0 0 1px rgba(90,60,20,0.18);
  overflow: hidden;
}
.m2w-music-toast-inner::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 9px;
  border: 1px solid rgba(232,184,64,0.08);
  pointer-events: none;
}
.m2w-music-toast-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(232,184,64,0.06), rgba(232,184,64,0) 38%);
  pointer-events: none;
}
.m2w-music-toast-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(200,148,26,0.38);
  background:
    radial-gradient(circle at 32% 30%, rgba(232,184,64,0.28) 0%, rgba(122,80,16,0.14) 52%, rgba(0,0,0,0) 72%);
  box-shadow:
    inset 0 0 18px rgba(200,148,26,0.16),
    0 0 18px rgba(200,148,26,0.12);
  color: var(--m2w-gold-lt);
  font-size: 19px;
  text-shadow: 0 0 10px rgba(232,184,64,0.32);
}
.m2w-music-toast-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.m2w-music-toast-title {
  font-family: var(--m2w-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--m2w-gold);
}
.m2w-music-toast-hint {
  color: var(--m2w-text);
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.m2w-music-toast-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  border: 1px solid var(--m2w-gold-dk);
  border-radius: 4px;
  background: rgba(200,148,26,0.14);
  color: var(--m2w-hi);
  font-family: var(--m2w-sans);
  font-size: 10px;
  font-weight: 700;
}
.m2w-music-toast--muted .m2w-music-toast-glow {
  background: radial-gradient(circle, rgba(122,80,16,0.24) 0%, rgba(122,80,16,0.06) 44%, rgba(122,80,16,0) 75%);
}
.m2w-music-toast--muted .m2w-music-toast-inner {
  border-color: rgba(126, 94, 54, 0.52);
  background: linear-gradient(180deg, rgba(41,28,16,0.96) 0%, rgba(19,13,8,0.94) 100%);
}
.m2w-music-toast--muted .m2w-music-toast-badge {
  color: #b69048;
  border-color: rgba(122,80,16,0.34);
  box-shadow: inset 0 0 16px rgba(122,80,16,0.12);
}
.m2w-music-toast--muted .m2w-music-toast-title {
  color: #d0ab62;
}

/* ── Building interaction prompt ───────────────────────────────────── */
.m2w-interact-prompt {
  position: absolute;
  z-index: 33;
  pointer-events: none;
  transform: translate(-50%, -100%);
  opacity: 1;
  transition: opacity 0.35s ease;
  will-change: left, top;
}
.m2w-interact-prompt--hidden {
  opacity: 0;
  transform: translate(-50%, -96%) scale(0.96);
}
.m2w-interact-prompt-glow {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -14px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(200,148,26,0.32) 0%, rgba(200,148,26,0.08) 42%, rgba(200,148,26,0) 78%);
  filter: blur(16px);
  opacity: 0.8;
}
.m2w-interact-prompt-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 10px;
  background: linear-gradient(180deg, rgba(52,35,18,0.96) 0%, rgba(21,14,8,0.94) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(168,120,50,0.62);
  border-radius: 10px;
  box-shadow:
    0 14px 34px rgba(0,0,0,0.52),
    inset 0 1px 0 rgba(255,234,190,0.08),
    inset 0 0 0 1px rgba(90,60,20,0.18);
  overflow: hidden;
  white-space: nowrap;
}
.m2w-interact-prompt-inner::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 9px;
  border: 1px solid rgba(232,184,64,0.08);
  pointer-events: none;
}
.m2w-interact-prompt-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(232,184,64,0.08), rgba(232,184,64,0) 40%);
  pointer-events: none;
}
.m2w-interact-prompt-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 56px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(200,148,26,0.36);
  background: linear-gradient(180deg, rgba(200,148,26,0.18), rgba(70,44,14,0.26));
  box-shadow:
    inset 0 0 18px rgba(200,148,26,0.14),
    0 0 14px rgba(200,148,26,0.12);
}
.m2w-interact-prompt-key {
  font-family: var(--m2w-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--m2w-hi);
  text-shadow: 0 0 8px rgba(232,184,64,0.16);
}
.m2w-interact-prompt-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m2w-interact-prompt-title {
  font-family: var(--m2w-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.6px;
  color: var(--m2w-gold);
}
.m2w-interact-prompt-hint {
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--m2w-hi);
}

/* ── Controls hint — bottom-left, fades out after a few seconds ──── */
.m2w-controls-hint {
  bottom: 14px;
  left: 14px;
  right: auto;
  font-size: 10px;
  opacity: 0;           /* JS sets to 1 on load, then fades back to 0 */
  visibility: hidden;   /* JS sets visible before fade-in */
  z-index: 15;
  pointer-events: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* ═════════════════════════════════════════════════════════════════════
   DAY CYCLE TIMEBAR
   ===================================================================== */

/* ── Circular compass medallion (top-left) ─────────────────────────────── */
.m2w-timeclock {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 28;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  pointer-events: none;
  user-select: none;
  /* Gold bezel rings */
  box-shadow:
    0 0 0 2px #7a4c08,
    0 0 0 3.5px #c8941a,
    0 0 0 5px #7a4c08,
    0 0 0 6.5px rgba(200,148,26,0.35),
    0 5px 20px rgba(0,0,0,0.65),
    0 2px 8px rgba(0,0,0,0.4);
  overflow: hidden;
}
.m2w-timeclock svg {
  display: block;
  width: 100%;
  height: 100%;
}
.m2w-timeclock--interactive {
  pointer-events: all;
  cursor: pointer;
  transition: box-shadow 0.25s ease;
}
.m2w-timeclock--interactive:hover {
  box-shadow:
    0 0 0 2px #7a4c08,
    0 0 0 3.5px #f0c840,
    0 0 0 5px #7a4c08,
    0 0 0 6.5px rgba(200,148,26,0.55),
    0 5px 24px rgba(0,0,0,0.7),
    0 0 16px rgba(255,180,30,0.38);
}
.m2w-timeclock--interactive:active {
  transform: scale(0.95);
}

.m2w-tb-phase-icon {
  font-size: 15px;
  line-height: 1;
}
.m2w-tb-phase-lbl {
  font-family: var(--m2w-serif);
  font-size: 6px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1;
}

/* ═════════════════════════════════════════════════════════════════════
   X MENU  –  Full overlay RPG menu
   ===================================================================== */

/* Overlay root */
.m2w-menu {
  position: absolute; inset: 0; z-index: 2500;
  pointer-events: none;
}
.m2w-menu:not(.m2w-menu--hidden) { pointer-events: all; }

/* Backdrop */
.m2w-menu-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 3, 1, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.m2w-menu:not(.m2w-menu--hidden) .m2w-menu-backdrop { opacity: 1; }

/* Window */
.m2w-menu-window {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -47%) scale(0.96);
  width: min(940px, 93vw);
  height: min(640px, 90vh);
  background: var(--m2w-bg-solid);
  border: 1px solid var(--m2w-border);
  border-radius: 8px;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(168,120,50,0.15),
    inset 0 1px 0 rgba(168,120,50,0.1);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(.4,0,.2,1);
}
.m2w-menu:not(.m2w-menu--hidden) .m2w-menu-window {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.m2w-menu--hidden { visibility: hidden; }
.m2w-menu:not(.m2w-menu--hidden) { visibility: visible; }

/* Close button */
.m2w-menu-close {
  position: absolute; top: 10px; right: 12px; z-index: 10;
  background: none; border: 1px solid var(--m2w-border2);
  border-radius: 4px; color: var(--m2w-dim);
  width: 28px; height: 28px; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.m2w-menu-close:hover { border-color: var(--m2w-gold-dk); color: var(--m2w-gold-lt); }

/* Tab nav */
.m2w-menu-nav {
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, rgba(40,24,8,0.7) 0%, rgba(20,12,4,0.5) 100%);
  border-bottom: 1px solid var(--m2w-border);
  flex-shrink: 0; padding-right: 46px;
}
.m2w-menu-navbtn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--m2w-dim);
  font-family: var(--m2w-serif); font-size: 10px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  flex: 1; padding: 13px 10px; cursor: pointer; text-align: center;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.m2w-menu-navbtn:hover { color: var(--m2w-gold-lt); }
.m2w-menu-navbtn--active {
  color: var(--m2w-gold) !important;
  border-bottom-color: var(--m2w-gold) !important;
}

/* Panes */
.m2w-menu-pane { display: none; flex: 1; overflow: hidden; position: relative; }
.m2w-menu-pane--active { display: flex; }

/* SVG background art (decorative) */
.m2w-pane-svgbg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  opacity: 0.055; pointer-events: none;
  filter: sepia(80%) hue-rotate(20deg);
}

/* Pane content wrapper */
.m2w-pane-body {
  position: relative; z-index: 1;
  display: flex; flex: 1; overflow: hidden;
  padding: 12px 14px; gap: 14px;
}

/* ── "Press X" hint ──────────────────────────────────────────────────
   Positioning only — shared chip visuals live in the hint block above. */
.m2w-menu-hint {
  bottom: 46px; left: 14px;
}

/* ── Character pane (unified layout) ───────────────────────────────── */
.m2w-pane-body--char {
  flex-direction: column; gap: 10px; overflow-y: auto; padding: 14px 18px;
}
.m2w-pane-body--char::-webkit-scrollbar { width: 3px; }
.m2w-pane-body--char::-webkit-scrollbar-thumb { background: var(--m2w-gold-dk); border-radius: 2px; }

/* Hero row — avatar + name/rank/class inline */
.m2w-hero {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(28,16,6,.55), rgba(40,24,10,.4));
  border: 1px solid var(--m2w-border2); border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(168,120,50,.06);
}
.m2w-hero__avatar {
  width: 56px; height: 56px; flex-shrink: 0;
  font-size: 38px; line-height: 56px; text-align: center;
}
.m2w-hero__info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.m2w-hero__name {
  font-family: var(--m2w-serif); font-size: 18px; font-weight: 700;
  color: var(--m2w-gold-lt); letter-spacing: 1px; line-height: 1.2;
}
.m2w-hero__meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-family: var(--m2w-serif); font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.m2w-hero__class { color: var(--m2w-dim); }
.m2w-hero__rank  { font-weight: 700; }
.m2w-hero__pts   { color: var(--m2w-hi); font-weight: 700; }
.m2w-hero__sep   { color: rgba(168,120,50,.35); font-size: 11px; }
.m2w-hero__desc  { font-size: 10px; font-style: italic; color: var(--m2w-dim); margin-top: 1px; }

/* Class selector row */
.m2w-class-row { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.m2w-char-section-label {
  font-size: 7px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--m2w-gold-dk); flex-shrink: 0;
}
.m2w-char-actions { display: flex; align-items: center; gap: 8px; }
.m2w-char-login-hint { font-size: 9px; color: var(--m2w-dim); font-style: italic; }

/* Class cards — 4-up */
.m2w-char-classes {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; flex-shrink: 0;
}
.m2w-class-card {
  padding: 6px 4px 5px; border: 1px solid var(--m2w-border2); border-radius: 5px;
  cursor: pointer; text-align: center; background: rgba(22,14,6,0.5);
  transition: border-color 0.15s, background 0.15s;
}
.m2w-class-card:hover { border-color: var(--m2w-border); background: rgba(35,22,8,0.7); }
.m2w-class-card--active {
  border-color: var(--m2w-gold) !important;
  background: rgba(168,120,50,0.1) !important;
  box-shadow: 0 0 10px rgba(168,120,50,0.08);
}
.m2w-class-icon { font-size: 18px; line-height: 1; margin: 0 auto 2px; text-align: center; }
.m2w-class-name {
  font-size: 7px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--m2w-dim); line-height: 1.2;
}
.m2w-class-card--active .m2w-class-name { color: var(--m2w-gold-lt); }

/* Bottom panels — coziness + minimap side by side */
.m2w-char-panels {
  display: flex; gap: 12px; flex: 1; min-height: 0; align-items: flex-start;
}
.m2w-char-panels > .m2w-cozy-widget { flex: 1; }
/* Inventory panel (replaces guild territory map) */
.m2w-inv-panel {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(14,22,8,.55), rgba(8,14,4,.6));
  border: 1px solid rgba(90,140,40,0.25); border-radius: 6px;
  min-width: 180px;
}
.m2w-inv-title {
  font-family: var(--m2w-serif); font-size: 8px; font-weight: 700;
  color: #90c840; letter-spacing: 2px; text-transform: uppercase;
}
.m2w-inv-hint {
  font-family: var(--m2w-serif); font-size: 8px; font-style: italic;
  color: rgba(120,180,60,0.45); letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.m2w-inv-grid {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
}
.m2w-inv-empty {
  font-family: var(--m2w-serif); font-size: 10px; font-style: italic;
  color: rgba(140,180,80,0.35); text-align: center; padding: 12px 0;
}
.m2w-inv-section-label {
  font-family: var(--m2w-serif); font-size: 9px; font-style: italic;
  color: rgba(140,180,80,0.4); text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 0 3px; border-top: 1px solid rgba(90,140,40,0.15); margin-top: 4px;
}
.m2w-inv-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 6px;
  padding: 5px 8px;
  background: rgba(80,120,30,0.10);
  border: 1px solid rgba(90,140,40,0.18);
  border-radius: 4px;
}
.m2w-inv-item__name {
  font-family: var(--m2w-serif); font-size: 11px; color: #b0d860;
  grid-column: 1; grid-row: 1;
}
.m2w-inv-item__desc {
  font-family: var(--m2w-serif); font-size: 9px; font-style: italic;
  color: rgba(140,180,80,0.5);
  grid-column: 1; grid-row: 2;
}
.m2w-inv-item__qty {
  font-family: monospace; font-size: 10px; color: #c8941a;
  grid-column: 2; grid-row: 1 / 3;
  align-self: center;
}

/* Quest-pane shop section */
.m2w-quest-shop-section {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--m2w-border2);
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}

/* Habits inline — lives inside character pane below the panels */
.m2w-habits-inline {
  flex-shrink: 0;
  margin-top: 2px; padding-top: 10px;
  border-top: 1px solid var(--m2w-border2);
  display: flex; flex-direction: column; gap: 6px;
}
.m2w-habits-inline .m2w-habits-header { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.m2w-habits-inline .m2w-habits-title { font-size: 11px; letter-spacing: 2px; }
.m2w-habits-inline .m2w-habit-row { padding: 7px 10px; gap: 10px; }
.m2w-habits-inline .m2w-habit-check { width: 22px; height: 22px; font-size: 11px; }
.m2w-habits-inline .m2w-habit-name { font-size: 11px; }
.m2w-habits-inline .m2w-habit-desc { font-size: 9px; }
.m2w-habits-inline .m2w-habits-footer { font-size: 9px; padding-top: 6px; }

/* Guild class member-count tooltip */
.m2w-class-count-tip {
  position: absolute;
  z-index: 99999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px 8px;
  background: linear-gradient(160deg, rgba(28,18,8,0.97) 0%, rgba(40,26,10,0.97) 100%);
  border: 1px solid var(--m2w-gold);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), 0 0 0 1px rgba(200,148,26,0.12) inset;
  transition: opacity 0.12s ease, transform 0.12s ease;
  opacity: 1;
  white-space: nowrap;
}
.m2w-class-count-tip--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
}
.m2w-cct-num {
  display: block;
  font-family: var(--m2w-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--m2w-gold-lt);
  text-shadow: 0 0 18px rgba(232,184,64,0.45);
  letter-spacing: -1px;
}
.m2w-cct-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--m2w-dim);
  text-align: center;
  line-height: 1.5;
}
.m2w-cct-orn {
  display: block;
  font-size: 11px;
  color: var(--m2w-gold);
  margin-top: 2px;
  opacity: 0.7;
}

/* Shop grid */
.m2w-shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 4px; flex-shrink: 0;
}
.m2w-shop-item {
  border: 1px solid var(--m2w-border2); border-radius: 4px;
  padding: 5px 4px; text-align: center; background: rgba(18,12,6,0.6);
  position: relative; transition: border-color 0.15s;
}
.m2w-shop-item:hover { border-color: var(--m2w-border); }
.m2w-shop-item--owned { opacity: 0.55; }
.m2w-shop-icon { font-size: 15px; line-height: 1; margin-bottom: 2px; }
.m2w-shop-name { font-size: 7px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--m2w-dim); line-height: 1.3; }
.m2w-shop-cost { font-size: 8px; color: var(--m2w-hi); font-weight: 600; margin-top: 2px; }
.m2w-shop-buy {
  display: block; margin-top: 3px; width: 100%;
  background: rgba(168,120,50,0.15); border: 1px solid var(--m2w-gold-dk);
  border-radius: 3px; color: var(--m2w-gold-lt); font-size: 7px;
  font-weight: 700; letter-spacing: 0.5px; cursor: pointer; padding: 2px 0;
  transition: all 0.15s;
}
.m2w-shop-buy:hover { background: rgba(168,120,50,0.28); color: #fff; }
.m2w-shop-buy:disabled { opacity: 0.4; cursor: not-allowed; }
.m2w-shop-owned { display: block; margin-top: 3px; font-size: 7px; color: #80c860; font-weight: 600; }
.m2w-shop-bal { color: var(--m2w-hi); font-weight: 700; font-size: 8px; margin-left: 5px; font-family: var(--m2w-sans); letter-spacing: 0; }

/* Menu generic btn */
.m2w-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(168,120,50,0.18), rgba(100,60,20,0.28));
  border: 1px solid var(--m2w-gold-dk); border-radius: 4px;
  color: var(--m2w-gold-lt); font-family: var(--m2w-sans);
  font-size: 9px; font-weight: 600; padding: 4px 12px;
  cursor: pointer; letter-spacing: 0.5px; transition: all 0.15s; text-decoration: none;
}
.m2w-menu-btn:hover { background: rgba(168,120,50,0.32); color: #fff; border-color: var(--m2w-gold); box-shadow: 0 0 10px rgba(168,120,50,0.2); }
.m2w-menu-btn--sm { font-size: 8px; padding: 3px 8px; }

/* ── Habits pane ────────────────────────────────────────────────────── */
.m2w-pane-body--habits { flex-direction: column; gap: 0; padding: 12px 14px; }
.m2w-habits-header {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--m2w-border2); padding-bottom: 10px; margin-bottom: 10px;
}
.m2w-habits-title {
  font-family: var(--m2w-serif); font-size: 15px; font-weight: 700;
  color: var(--m2w-gold); letter-spacing: 2px; text-transform: uppercase;
}
.m2w-habits-date { font-size: 10px; color: var(--m2w-dim); margin-left: auto; font-style: italic; }
.m2w-habits-prog {
  font-size: 10px; font-weight: 700; color: var(--m2w-hi); letter-spacing: 0.5px;
}
.m2w-habits-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.m2w-habits-list::-webkit-scrollbar { width: 3px; }
.m2w-habits-list::-webkit-scrollbar-thumb { background: var(--m2w-gold-dk); border-radius: 2px; }
.m2w-habits-loading { color: var(--m2w-dim); font-size: 11px; font-style: italic; padding: 12px 0; }

.m2w-habit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--m2w-border2); border-radius: 5px;
  background: rgba(18,12,6,0.5); transition: border-color 0.15s, background 0.15s;
}
.m2w-habit-row:hover { border-color: var(--m2w-border); background: rgba(28,18,8,0.7); }
.m2w-habit-row--done { border-color: rgba(80,200,96,0.25) !important; background: rgba(20,40,20,0.4) !important; }

.m2w-habit-check {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--m2w-border); background: transparent;
  cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; color: transparent;
}
.m2w-habit-check:hover { border-color: var(--m2w-gold); }
.m2w-habit-check--done {
  background: rgba(80,200,96,0.2) !important; border-color: #50c860 !important;
  color: #50c860 !important;
}
.m2w-habit-name { flex: 1; font-size: 12px; font-weight: 500; color: var(--m2w-text); line-height: 1.3; }
.m2w-habit-desc { font-size: 10px; color: var(--m2w-dim); margin-top: 2px; }
.m2w-habit-row--done .m2w-habit-name { text-decoration: line-through; opacity: 0.6; }

.m2w-habit-reward {
  flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--m2w-hi);
  opacity: 0; transition: opacity 0.3s ease;
  animation: m2w-reward-pop 0.5s ease forwards;
}
@keyframes m2w-reward-pop {
  0%   { opacity: 0; transform: translateY(6px); }
  50%  { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-10px); }
}
.m2w-habit-reward--show { animation: m2w-reward-pop 1.2s ease forwards; }

.m2w-habits-footer {
  flex-shrink: 0; padding-top: 10px; margin-top: 4px;
  border-top: 1px solid var(--m2w-border2);
  font-size: 11px; color: var(--m2w-dim); display: flex; align-items: center; gap: 10px;
}
.m2w-habits-guest {
  text-align: center; padding: 24px; color: var(--m2w-dim); font-style: italic;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.m2w-habits-guest a { color: var(--m2w-gold-dk); }
.m2w-habits-none {
  text-align: center; padding: 24px; color: var(--m2w-dim); font-style: italic;
}

/* ── Map pane ───────────────────────────────────────────────────────── */
.m2w-pane-body--map {
  flex-direction: row; align-items: stretch; justify-content: flex-start;
  gap: 18px; padding: 16px 18px;
}
.m2w-map-aside {
  flex: 0 0 240px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 14px 10px;
  background: linear-gradient(180deg, rgba(40,24,8,0.45), rgba(15,9,4,0.55));
  border: 1px solid var(--m2w-border2);
  border-radius: var(--m2w-radius);
}
.m2w-map-title {
  font-family: var(--m2w-serif); font-size: 11px; font-weight: 700;
  color: var(--m2w-gold); letter-spacing: 2.5px; text-transform: uppercase;
}
.m2w-map-wrap { position: relative; }
#m2w-minimap {
  display: block;
  border: 1px solid var(--m2w-border);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 0 40px rgba(0,0,0,0.3);
}
.m2w-map-compass {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; pointer-events: none;
}
.m2w-map-compass span {
  position: absolute; font-size: 9px; font-weight: 700;
  font-family: var(--m2w-serif); color: rgba(168,120,50,0.7);
}
.m2w-compass-n { top: 0; left: 50%; transform: translateX(-50%); }
.m2w-compass-s { bottom: 0; left: 50%; transform: translateX(-50%); }
.m2w-compass-e { right: 0; top: 50%; transform: translateY(-50%); }
.m2w-compass-w { left: 0; top: 50%; transform: translateY(-50%); }
.m2w-map-online {
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 2px;
  color: var(--m2w-dim); text-transform: uppercase;
}

/* ── Zoom controls ──────────────────────────────────────────────────── */
.m2w-map-controls {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}

.m2w-zmbtn {
  width: 30px; height: 30px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(50,30,10,0.6), rgba(25,14,5,0.8));
  border: 1px solid var(--m2w-gold-dk);
  color: var(--m2w-gold);
  font-family: var(--m2w-serif); font-size: 18px; font-weight: 700;
  line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(168,120,50,0.15);
}
.m2w-zmbtn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(168,120,50,0.25), rgba(100,60,20,0.4));
  border-color: var(--m2w-gold);
  color: #fff;
  box-shadow: 0 0 12px rgba(168,120,50,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.m2w-zmbtn:active:not(:disabled) {
  transform: scale(0.93);
}
.m2w-zmbtn:disabled {
  opacity: 0.28; cursor: not-allowed; border-color: var(--m2w-border2);
}

/* Zoom track (mini slider between buttons) */
.m2w-zm-track {
  position: relative;
  width: 72px; height: 4px;
  background: rgba(168,120,50,0.12);
  border: 1px solid var(--m2w-border2);
  border-radius: 2px;
  overflow: hidden; flex-shrink: 0;
}
.m2w-zm-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold));
  border-radius: 2px;
  transition: width 0.25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 6px rgba(200,148,26,0.4);
}

.m2w-zm-label {
  font-family: var(--m2w-serif); font-size: 10px; font-weight: 700;
  color: var(--m2w-gold-dk); letter-spacing: 1px;
  min-width: 26px; text-align: left;
  transition: color 0.2s ease;
}

/* ── Course Roadmap (gamified journey) ─────────────────────────────── */
.m2w-rm {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding: 4px 6px 10px;
  overflow-y: auto; overflow-x: hidden;
}
.m2w-rm::-webkit-scrollbar { width: 4px; }
.m2w-rm::-webkit-scrollbar-thumb { background: var(--m2w-gold-dk); border-radius: 2px; }

.m2w-rm-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--m2w-dim); font-family: var(--m2w-serif); letter-spacing: 2px;
  font-size: 12px; animation: m2wRmPulse 1.8s ease-in-out infinite;
}
@keyframes m2wRmPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }

/* Header */
.m2w-rm-header {
  text-align: center; padding: 6px 10px 4px;
  border-bottom: 1px solid var(--m2w-border2);
}
.m2w-rm-eyebrow {
  font-family: var(--m2w-serif); font-size: 9px; font-weight: 700;
  color: var(--m2w-gold-dk); letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 2px;
}
.m2w-rm-title {
  font-family: var(--m2w-serif); font-size: 20px; font-weight: 700;
  color: var(--m2w-gold); letter-spacing: 2.5px; text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(200,148,26,0.35);
}
.m2w-rm-sub {
  font-size: 11px; color: var(--m2w-dim); margin-top: 3px; letter-spacing: 0.3px;
}
.m2w-rm-progress { margin: 10px auto 4px; max-width: 440px; }
.m2w-rm-bar {
  position: relative; height: 8px; border-radius: 4px;
  background: rgba(20,12,4,0.8);
  border: 1px solid var(--m2w-border2);
  overflow: hidden;
}
.m2w-rm-bar-own, .m2w-rm-bar-done {
  position: absolute; inset: 0 auto 0 0; border-radius: 3px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.m2w-rm-bar-own  {
  background: linear-gradient(90deg, rgba(168,120,50,0.35), rgba(232,184,64,0.55));
  box-shadow: inset 0 0 4px rgba(232,184,64,0.25);
}
.m2w-rm-bar-done {
  background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold-lt));
  box-shadow: 0 0 10px rgba(232,184,64,0.5);
}
.m2w-rm-stats {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 6px; font-size: 10px; color: var(--m2w-dim);
  font-family: var(--m2w-serif); letter-spacing: 1.5px; text-transform: uppercase;
}
.m2w-rm-stat b { color: var(--m2w-gold-lt); font-weight: 700; }
.m2w-rm-dot { color: var(--m2w-gold-dk); font-size: 6px; }

/* Roadmap path area */
.m2w-rm-path {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 380;
  margin: 4px 0 2px;
}
.m2w-rm-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.m2w-rm-path-fill {
  transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1);
}
.m2w-rm-nodes { position: absolute; inset: 0; }

/* Waypoint */
.m2w-wp {
  position: absolute;
  width: 0; height: 0;
  display: flex; align-items: center;
}
.m2w-wp--left  { flex-direction: row; }
.m2w-wp--right { flex-direction: row-reverse; }

.m2w-wp-node {
  position: relative;
  width: 58px; height: 58px; flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a2410, #14090400 70%),
              linear-gradient(160deg, #2a1a0a, #120904);
  border: 2px solid var(--m2w-gold-dk);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(168,120,50,0.25),
    inset 0 0 14px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  z-index: 2;
}
.m2w-wp-ring {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  pointer-events: none;
}
.m2w-wp-step {
  position: absolute; top: -6px; left: -6px;
  width: 20px; height: 20px;
  font-family: var(--m2w-serif); font-size: 11px; font-weight: 700;
  color: #1a0e04;
  background: var(--m2w-gold-lt);
  border-radius: 50%;
  border: 1.5px solid #1a0e04;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.55);
}
.m2w-wp-icon { font-size: 22px; line-height: 1; }

/* Card */
.m2w-wp-card {
  position: relative;
  width: 210px; flex-shrink: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(36,22,10,0.96), rgba(18,11,5,0.96));
  border: 1px solid var(--m2w-border2);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), inset 0 1px 0 rgba(168,120,50,0.1);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.m2w-wp--left  .m2w-wp-card { margin-left:  12px; }
.m2w-wp--right .m2w-wp-card { margin-right: 12px; text-align: right; }
.m2w-wp-card::before {
  content: '';
  position: absolute; top: 50%;
  width: 10px; height: 10px;
  transform: translateY(-50%) rotate(45deg);
  background: inherit;
  border: inherit;
  border-right: 0; border-top: 0;
}
.m2w-wp--left  .m2w-wp-card::before { left: -6px; border-right: 0; border-top: 0; border-left: 1px solid var(--m2w-border2); border-bottom: 1px solid var(--m2w-border2); }
.m2w-wp--right .m2w-wp-card::before { right: -6px; border-left: 0; border-bottom: 0; border-right: 1px solid var(--m2w-border2); border-top: 1px solid var(--m2w-border2); }

.m2w-wp-title {
  font-family: var(--m2w-serif); font-size: 12px; font-weight: 700;
  color: var(--m2w-gold-lt); letter-spacing: 0.6px; line-height: 1.25;
}
.m2w-wp-sub {
  font-size: 10px; color: var(--m2w-dim); margin-top: 3px; line-height: 1.35;
  max-height: 26px; overflow: hidden;
}
.m2w-wp-prog {
  height: 3px; margin-top: 6px;
  background: rgba(20,12,4,0.8); border-radius: 2px; overflow: hidden;
}
.m2w-wp-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold-lt));
  box-shadow: 0 0 6px rgba(232,184,64,0.55);
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.m2w-wp-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 7px;
}
.m2w-wp--right .m2w-wp-meta { flex-direction: row-reverse; }
.m2w-wp-status {
  font-family: var(--m2w-serif); font-size: 9px; font-weight: 600;
  color: var(--m2w-dim); letter-spacing: 1.2px; text-transform: uppercase;
}
.m2w-wp-btn {
  font-family: var(--m2w-serif); font-size: 9px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  padding: 5px 10px; border-radius: 3px;
  background: linear-gradient(180deg, rgba(168,120,50,0.25), rgba(100,60,20,0.4));
  border: 1px solid var(--m2w-gold-dk);
  color: var(--m2w-gold-lt);
  text-decoration: none; cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.m2w-wp-btn:hover {
  background: linear-gradient(180deg, var(--m2w-gold), var(--m2w-gold-dk));
  color: #1a0e04;
  box-shadow: 0 0 12px rgba(232,184,64,0.4);
  border-color: var(--m2w-gold-lt);
}
.m2w-wp-btn--ghost { opacity: 0.5; pointer-events: none; }

/* State: locked */
.m2w-wp--locked .m2w-wp-node {
  filter: grayscale(0.8) brightness(0.55);
  border-color: rgba(90,60,20,0.55);
}
.m2w-wp--locked .m2w-wp-step {
  background: #5a4020; color: #14080244;
  border-color: #1a0e04;
}
.m2w-wp--locked .m2w-wp-card { opacity: 0.72; }
.m2w-wp--locked .m2w-wp-title { color: var(--m2w-dim); }
.m2w-wp--locked .m2w-wp-btn {
  background: rgba(40,24,8,0.5);
  border-color: var(--m2w-border2);
  color: var(--m2w-dim);
}
.m2w-wp--locked .m2w-wp-btn:hover {
  background: linear-gradient(180deg, rgba(168,120,50,0.18), rgba(60,40,14,0.4));
  color: var(--m2w-gold-lt);
  border-color: var(--m2w-gold-dk);
  box-shadow: none;
}

/* State: unlocked */
.m2w-wp--unlocked .m2w-wp-node {
  border-color: var(--m2w-gold);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.6),
    0 0 18px rgba(232,184,64,0.35),
    inset 0 1px 0 rgba(232,184,64,0.35);
  animation: m2wWpBreathe 2.6s ease-in-out infinite;
}
.m2w-wp--unlocked .m2w-wp-card { border-color: var(--m2w-gold-dk); }

@keyframes m2wWpBreathe {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 14px rgba(232,184,64,0.3),  inset 0 1px 0 rgba(232,184,64,0.3); }
  50%      { box-shadow: 0 4px 14px rgba(0,0,0,0.6), 0 0 26px rgba(232,184,64,0.6),  inset 0 1px 0 rgba(232,184,64,0.5); }
}

/* State: in progress */
.m2w-wp--in_progress .m2w-wp-node {
  border-color: var(--m2w-gold-lt);
  box-shadow:
    0 4px 14px rgba(0,0,0,0.6),
    0 0 22px rgba(232,184,64,0.55),
    inset 0 1px 0 rgba(232,184,64,0.4);
}
.m2w-wp--in_progress .m2w-wp-ring {
  border-color: rgba(232,184,64,0.6);
  animation: m2wWpSpin 4.5s linear infinite;
  border-top-color: var(--m2w-gold-lt);
}
.m2w-wp--in_progress .m2w-wp-card { border-color: var(--m2w-gold-dk); }

@keyframes m2wWpSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* State: completed */
.m2w-wp--completed .m2w-wp-node {
  background: radial-gradient(circle at 35% 30%, #f8d260, #c8941a 55%, #5a3810 100%);
  border-color: var(--m2w-gold-lt);
  box-shadow:
    0 4px 18px rgba(0,0,0,0.55),
    0 0 28px rgba(232,184,64,0.65),
    inset 0 1px 4px rgba(255,240,200,0.5);
}
.m2w-wp--completed .m2w-wp-icon { color: #1a0e04; text-shadow: 0 1px 0 rgba(255,240,200,0.6); }
.m2w-wp--completed .m2w-wp-step { background: #fff5d0; }
.m2w-wp--completed .m2w-wp-card { border-color: var(--m2w-gold); }
.m2w-wp--completed .m2w-wp-title { color: var(--m2w-gold-lt); }

/* Optional chips row */
.m2w-rm-opts {
  border-top: 1px dashed var(--m2w-border2);
  padding-top: 10px; margin-top: 6px;
}
.m2w-rm-opts-label {
  font-family: var(--m2w-serif); font-size: 10px; font-weight: 700;
  color: var(--m2w-gold-dk); letter-spacing: 2.5px; text-transform: uppercase;
  text-align: center; margin-bottom: 8px;
}
.m2w-rm-opts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.m2w-opt {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(30,18,8,0.85), rgba(14,8,3,0.9));
  border: 1px solid var(--m2w-border2);
  border-radius: 5px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  min-width: 0;
}
.m2w-opt:hover { border-color: var(--m2w-gold-dk); transform: translateY(-1px); }
.m2w-opt-icon {
  flex-shrink: 0; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(18,10,4,0.8);
  border: 1px solid var(--m2w-border2);
  border-radius: 4px;
}
.m2w-opt-body { flex: 1; min-width: 0; }
.m2w-opt-title {
  font-family: var(--m2w-serif); font-size: 10px; font-weight: 700;
  color: var(--m2w-gold-lt); letter-spacing: 0.4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m2w-opt-sub {
  font-size: 9px; color: var(--m2w-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m2w-opt-state {
  font-family: var(--m2w-serif); font-size: 8px; font-weight: 700;
  color: var(--m2w-dim); letter-spacing: 1.2px; text-transform: uppercase;
  white-space: nowrap;
}
.m2w-opt-btn {
  flex-shrink: 0;
  font-family: var(--m2w-serif); font-size: 8px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 3px;
  background: rgba(168,120,50,0.15);
  border: 1px solid var(--m2w-gold-dk);
  color: var(--m2w-gold-lt);
  text-decoration: none;
  transition: all 0.15s ease;
}
.m2w-opt-btn:hover {
  background: linear-gradient(180deg, var(--m2w-gold), var(--m2w-gold-dk));
  color: #1a0e04;
}
.m2w-opt-btn--ghost { opacity: 0.5; pointer-events: none; }
.m2w-opt--locked    { opacity: 0.72; }
.m2w-opt--locked .m2w-opt-icon   { filter: grayscale(0.7); }
.m2w-opt--locked .m2w-opt-title  { color: var(--m2w-dim); }
.m2w-opt--unlocked  .m2w-opt-icon,
.m2w-opt--in_progress .m2w-opt-icon {
  border-color: var(--m2w-gold-dk);
  box-shadow: 0 0 8px rgba(232,184,64,0.25);
}
.m2w-opt--completed .m2w-opt-icon {
  background: radial-gradient(circle at 35% 30%, #f8d260, #c8941a);
  color: #1a0e04;
  border-color: var(--m2w-gold-lt);
  box-shadow: 0 0 12px rgba(232,184,64,0.55);
}
.m2w-opt--completed .m2w-opt-title { color: var(--m2w-gold); }

/* Sign-in nudge */
.m2w-rm-signin {
  text-align: center; padding: 10px;
  font-size: 10px; color: var(--m2w-dim); font-style: italic;
  border: 1px dashed var(--m2w-border2); border-radius: 5px;
  letter-spacing: 0.5px;
}

/* Responsive — stack roadmap + minimap aside on narrow screens */
@media (max-width: 820px) {
  .m2w-pane-body--map { flex-direction: column; }
  .m2w-map-aside { flex: 0 0 auto; width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .m2w-wp-card  { width: 170px; }
}

/* ── Quests pane ────────────────────────────────────────────────────── */
.m2w-pane-body--quests { flex-direction: column; gap: 0; }
/* ── Map pane ── */
.m2w-pane-body--map { flex-direction: column; gap: 0; }
/* ── Shop pane ── */
.m2w-pane-body--shop { flex-direction: column; gap: 0; }
.m2w-shop-bal-header {
  font-family: var(--m2w-serif); font-size: 12px; color: var(--m2w-gold-lt);
  text-align: center; padding: 6px 0 10px; letter-spacing: 1px;
}
.m2w-quest-banner {
  font-family: var(--m2w-serif); font-size: 14px; font-weight: 700;
  color: var(--m2w-gold); letter-spacing: 4px; text-transform: uppercase;
  text-align: center; padding-bottom: 10px; border-bottom: 1px solid var(--m2w-border2);
  flex-shrink: 0; margin-bottom: 10px;
}
.m2w-quest-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.m2w-quest-list::-webkit-scrollbar { width: 3px; }
.m2w-quest-list::-webkit-scrollbar-thumb { background: var(--m2w-gold-dk); border-radius: 2px; }
.m2w-quest-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--m2w-border2); border-radius: 5px;
  background: rgba(18,12,6,0.5); transition: border-color 0.15s;
}
.m2w-quest-item:hover { border-color: var(--m2w-border); }
.m2w-quest-icon { font-size: 20px; flex-shrink: 0; }
.m2w-quest-body { flex: 1; min-width: 0; }
.m2w-quest-title { font-size: 12px; font-weight: 500; color: var(--m2w-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2w-quest-prog { height: 3px; background: rgba(20,12,4,0.8); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.m2w-quest-prog-fill { height: 100%; background: linear-gradient(90deg, var(--m2w-gold-dk), var(--m2w-gold)); border-radius: 2px; }
.m2w-quest-pct { font-size: 9px; color: var(--m2w-dim); margin-top: 2px; }
.m2w-quest-status { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; flex-shrink: 0; padding: 0 8px; }
.m2w-quest-status--done    { color: #80c860; }
.m2w-quest-status--active  { color: var(--m2w-hi); }
.m2w-quest-status--avail   { color: var(--m2w-dim); }
.m2w-quest-empty { padding: 28px 16px; text-align: center; color: var(--m2w-dim); font-style: italic; line-height: 1.6; }
.m2w-quest-section-label { font-family: var(--m2w-serif); font-size: 12px; font-weight: 700; color: var(--m2w-hi); letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 0 2px; border-bottom: 1px solid rgba(200,148,26,0.15); margin-bottom: 4px; }
.m2w-quest-section-sub { font-size: 9px; color: var(--m2w-dim); margin-bottom: 6px; letter-spacing: 0.5px; }
.m2w-quest-item--done { opacity: 0.65; }
.m2w-quest-reward { font-size: 9px; color: var(--m2w-gold-dk); margin-top: 2px; }
.m2w-quest-claim {
  flex-shrink: 0; padding: 3px 10px; font-size: 10px; font-weight: 600;
  color: #0a0806; background: linear-gradient(135deg, var(--m2w-gold), var(--m2w-gold-lt));
  border: none; border-radius: 4px; cursor: pointer; letter-spacing: 0.5px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.m2w-quest-claim:hover { transform: scale(1.05); box-shadow: 0 0 8px rgba(200,148,26,0.5); }

/* ── Dice of Fortune ───────────────────────────────────────────────── */
.m2w-dice-prompt {
  position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(14,8,2,0.92); border: 1px solid rgba(200,148,26,0.5);
  border-radius: 8px; padding: 8px 18px; color: var(--m2w-parch);
  font-family: var(--m2w-serif); font-size: 13px; z-index: 200;
  opacity: 0; transition: opacity 0.4s; pointer-events: none; white-space: nowrap;
}
.m2w-dice-prompt--on { opacity: 1; }
.m2w-dice-prompt kbd { background: rgba(200,148,26,0.2); border: 1px solid rgba(200,148,26,0.4); border-radius: 3px; padding: 1px 5px; font-size: 12px; }

.m2w-dice-overlay {
  position: absolute; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); opacity: 0; transition: opacity 0.3s;
}
.m2w-dice-overlay--on { opacity: 1; }
.m2w-dice-modal {
  background: radial-gradient(ellipse at 30% 20%, rgba(40,28,12,0.98), rgba(14,8,2,0.99));
  border: 2px solid rgba(200,148,26,0.5); border-radius: 14px;
  padding: 24px 32px; min-width: 320px; max-width: 400px; text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,200,80,0.08);
  color: var(--m2w-parch); font-family: var(--m2w-serif);
}
.m2w-dice-title { font-size: 22px; font-weight: 700; color: var(--m2w-gold); letter-spacing: 2px; margin-bottom: 4px; }
.m2w-dice-sub { font-size: 11px; color: var(--m2w-dim); margin-bottom: 8px; font-style: italic; }
.m2w-dice-chips { font-size: 13px; color: var(--m2w-gold); margin-bottom: 14px; letter-spacing: 0.5px; }
.m2w-dice-label { font-size: 13px; color: var(--m2w-hi); margin-bottom: 8px; }
.m2w-dice-bet-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.m2w-dice-bet-btn {
  padding: 6px 16px; font-size: 14px; font-weight: 600; border-radius: 6px;
  background: rgba(200,148,26,0.12); border: 1.5px solid rgba(200,148,26,0.3);
  color: var(--m2w-parch); cursor: pointer; transition: all 0.15s;
  font-family: var(--m2w-serif);
}
.m2w-dice-bet-btn:hover { border-color: var(--m2w-gold); }
.m2w-dice-bet-btn--sel { background: rgba(200,148,26,0.25); border-color: var(--m2w-gold); color: var(--m2w-gold); box-shadow: 0 0 10px rgba(200,148,26,0.3); }
.m2w-dice-roll-btn {
  padding: 10px 28px; font-size: 15px; font-weight: 700; border-radius: 8px;
  background: linear-gradient(135deg, var(--m2w-gold-dk), var(--m2w-gold));
  border: none; color: #0a0806; cursor: pointer; letter-spacing: 1px;
  font-family: var(--m2w-serif); transition: transform 0.15s, box-shadow 0.15s;
}
.m2w-dice-roll-btn:hover { transform: scale(1.04); box-shadow: 0 0 16px rgba(200,148,26,0.5); }
.m2w-dice-hands { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 14px 0; }
.m2w-dice-hand { text-align: center; }
.m2w-dice-hand-label { font-size: 10px; color: var(--m2w-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.m2w-dice-faces { display: flex; gap: 6px; justify-content: center; }
.m2w-dice-face--lg { font-size: 40px; }
.m2w-dice-total { font-size: 20px; font-weight: 700; color: var(--m2w-gold); margin-top: 4px; }
.m2w-dice-vs { font-size: 14px; color: var(--m2w-dim); font-style: italic; }
.m2w-dice-rolling { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.m2w-dice-outcome { font-size: 16px; font-weight: 700; margin: 12px 0 16px; letter-spacing: 0.5px; }
.m2w-dice-outcome--win { color: #80c860; }
.m2w-dice-outcome--tie { color: var(--m2w-hi); }
.m2w-dice-outcome--lose { color: #c85040; }
.m2w-dice-close {
  margin-top: 12px; padding: 6px 18px; font-size: 11px; border-radius: 6px;
  background: none; border: 1px solid rgba(200,148,26,0.3); color: var(--m2w-dim);
  cursor: pointer; font-family: var(--m2w-serif); transition: color 0.15s;
}
.m2w-dice-close:hover { color: var(--m2w-parch); border-color: var(--m2w-gold); }

/* ═════════════════════════════════════════════════════════════════════
   TAVERN INTERIOR
   ===================================================================== */

/* Canvas-level colour grade (Photoshop: Brightness+67 / Contrast+68 / CB +24R +52G +100B)
   Applied via feColorMatrix SVG filter injected by JS; toggled on enterTavern/exitTavern */
#m2w-canvas.m2w-tavern-grade { filter: url(#m2w-tavern-grade); }

.m2w-tavern {
  position: absolute; inset: 0; z-index: 48;
  pointer-events: none; /* pass mouse events through to canvas for raycasting */
}
/* Completely remove from layout when not in tavern — no phantom sidebar */
.m2w-tavern--hidden { display: none; }

/* Fade veil (black, covers canvas during transition) */
.m2w-tavern-veil {
  position: absolute; inset: 0; z-index: 2;
  background: #000; opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.m2w-tavern-veil--dark   { opacity: 1; }
.m2w-tavern-veil--fadein { opacity: 0; }

/* UI layer (sits on top of the 3D canvas) */
.m2w-tavern-ui {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
}
/* Breathing smoke vignette — heavier, darker than scriptorium/PH */
.m2w-tavern-ui::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 28%, rgba(8,3,0,0.40) 60%, rgba(8,3,0,0.78) 100%);
  animation: m2w-tav-vignette-breathe 7s ease-in-out infinite;
}
@keyframes m2w-tav-vignette-breathe {
  0%,100% { opacity: 0.78; }
  50%      { opacity: 1.0;  }
}
/* Warm firelight leak from top */
.m2w-tavern-ui::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 180px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(200,80,10,0.05) 0%, transparent 100%);
}

/* ── Header — hearth-forged arch ─────────────────────────────────────── */
.m2w-tavern-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 72px;
  pointer-events: auto;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg,
      rgba(12,5,1,0.98) 0%,
      rgba(16,8,2,0.92) 40%,
      rgba(16,8,2,0.65) 70%,
      transparent 100%);
}
/* Double-line glow bottom edge — ember orange */
.m2w-tavern-header::before {
  content: '';
  position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(168,60,10,0.15) 10%, rgba(168,60,10,0.50) 30%,
    rgba(220,100,20,0.70) 50%, rgba(168,60,10,0.50) 70%, rgba(168,60,10,0.15) 90%, transparent);
}
.m2w-tavern-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(200,80,10,0.08) 20%, rgba(200,80,10,0.28) 50%, rgba(200,80,10,0.08) 80%, transparent);
}
/* Travelling ember shimmer */
.m2w-tavern-header-shimmer {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
  overflow: hidden; pointer-events: none;
}
.m2w-tavern-header-shimmer::before {
  content: '';
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(240,120,30,0.65), transparent);
  animation: m2w-tav-shimmer-travel 8s ease-in-out infinite;
}
@keyframes m2w-tav-shimmer-travel {
  0%   { left: -40%; }
  100% { left: 140%; }
}

/* ── Exit button ─────────────────────────────────────────────────────── */
.m2w-tavern-exit {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  background: rgba(168,60,10,0.08);
  border: 1px solid rgba(168,60,10,0.25);
  border-radius: 6px;
  color: rgba(220,120,50,0.75);
  font-family: var(--m2w-serif);
  font-size: 11px; font-weight: 600;
  padding: 7px 16px 7px 12px;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  display: flex; align-items: center; gap: 6px;
}
.m2w-tavern-exit:hover {
  background: rgba(168,60,10,0.22);
  border-color: rgba(220,100,30,0.55);
  color: #fff;
  box-shadow: 0 0 16px rgba(220,100,20,0.2);
}
.m2w-tav-exit-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}
.m2w-tavern-exit:hover .m2w-tav-exit-arrow {
  transform: translateX(-3px);
}

/* ── Title cluster ───────────────────────────────────────────────────── */
.m2w-tav-title-group {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m2w-tav-title-row {
  display: flex; align-items: center; gap: 16px;
}
.m2w-tav-filigree {
  display: flex; align-items: center; gap: 4px;
  color: rgba(200,100,20,0.55);
  font-size: 7px;
  letter-spacing: 3px;
  opacity: 0.7;
}
.m2w-tav-filigree-ember {
  font-size: 6px;
  animation: m2w-tav-filigree-pulse 3s ease-in-out infinite;
}
.m2w-tav-filigree-line {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,100,20,0.55), transparent);
}
@keyframes m2w-tav-filigree-pulse {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.m2w-tavern-name {
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 15px; font-weight: 700;
  color: #d4824a; letter-spacing: 6px; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(220,90,20,0.45), 0 0 50px rgba(200,60,10,0.18);
  animation: m2w-tav-title-glow 4s ease-in-out infinite;
}
@keyframes m2w-tav-title-glow {
  0%,100% { text-shadow: 0 0 18px rgba(220,90,20,0.38), 0 0 38px rgba(200,60,10,0.14); color: #d4824a; }
  50%      { text-shadow: 0 0 28px rgba(240,120,30,0.68), 0 0 58px rgba(220,80,20,0.32), 0 0 90px rgba(180,50,10,0.14); color: #e8a060; }
}
.m2w-tav-subtitle {
  font-family: var(--m2w-serif);
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(168,90,30,0.30);
  margin-top: 1px;
  font-style: italic;
}

/* ── Ember sparks (floating particles) ───────────────────────────────── */
.m2w-tav-embers {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 4; overflow: hidden;
}
.m2w-tav-ember {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #e08030; opacity: 0;
  animation: m2w-tav-ember-drift linear infinite;
}
@keyframes m2w-tav-ember-drift {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(1); }
  10%  { opacity: 0.6; }
  50%  { opacity: 0.45; }
  85%  { opacity: 0.15; transform: translateY(-110vh) translateX(20px) scale(0.6); }
  100% { opacity: 0; transform: translateY(-120vh) translateX(25px) scale(0.4); }
}
.m2w-tav-ember:nth-child(1)  { left: 10%; bottom: -5%; animation-duration: 12s; animation-delay: 0s; }
.m2w-tav-ember:nth-child(2)  { left: 24%; bottom: -8%; animation-duration: 16s; animation-delay: 1.5s; width: 3px; height: 3px; background: #ff6020; }
.m2w-tav-ember:nth-child(3)  { left: 38%; bottom: -3%; animation-duration: 14s; animation-delay: 4s;  width: 1.5px; height: 1.5px; }
.m2w-tav-ember:nth-child(4)  { left: 52%; bottom: -6%; animation-duration: 18s; animation-delay: 0.8s; background: #ffa040; }
.m2w-tav-ember:nth-child(5)  { left: 66%; bottom: -4%; animation-duration: 13s; animation-delay: 6s;  width: 2.5px; height: 2.5px; }
.m2w-tav-ember:nth-child(6)  { left: 80%; bottom: -7%; animation-duration: 20s; animation-delay: 2.5s; width: 1.5px; height: 1.5px; }
.m2w-tav-ember:nth-child(7)  { left: 17%; bottom: -2%; animation-duration: 15s; animation-delay: 8s;  background: #ff4010; }
.m2w-tav-ember:nth-child(8)  { left: 44%; bottom: -9%; animation-duration: 17s; animation-delay: 3s;  width: 3px; height: 3px; }
.m2w-tav-ember:nth-child(9)  { left: 71%; bottom: -1%; animation-duration: 11s; animation-delay: 5s;  width: 1.5px; height: 1.5px; background: #ffcc60; }
.m2w-tav-ember:nth-child(10) { left: 89%; bottom: -5%; animation-duration: 19s; animation-delay: 7s; }

/* ── Community board (x2 medieval redesign) ─────────────────────── */
.m2w-tavern-board {
  position: absolute; top: 72px; right: 0; bottom: 52px;
  width: 480px;
  background:
    linear-gradient(180deg, rgba(10,5,2,0.92) 0%, rgba(18,10,4,0.96) 100%);
  border-left: 2px solid rgba(168,80,20,0.35);
  display: flex; flex-direction: column;
  pointer-events: none;
  overflow: hidden;
  box-shadow: -12px 0 36px rgba(0,0,0,0.55), inset 1px 0 0 rgba(168,80,20,0.1);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}
.m2w-tavern-board > * { pointer-events: auto; }
.m2w-tavern-board--collapsed {
  transform: translateX(100%);
  pointer-events: none;
}

/* Collapse (close) button inside header */
.m2w-board-collapse {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid rgba(168,80,20,0.2);
  border-radius: 3px; color: rgba(200,140,60,0.45);
  font-size: 12px; width: 24px; height: 24px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
}
.m2w-board-collapse:hover {
  color: rgba(220,170,80,0.9); border-color: rgba(200,120,40,0.5);
  background: rgba(168,60,10,0.12);
}

/* Re-open tab — fixed to right edge, visible when board is collapsed */
.m2w-board-reopen {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(30,14,5,0.92) 0%, rgba(18,8,3,0.95) 100%);
  border: 1px solid rgba(168,80,20,0.3); border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 12px 10px; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--m2w-serif); font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: #d4a040; cursor: pointer;
  pointer-events: auto;
  box-shadow: -4px 0 12px rgba(0,0,0,0.4);
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}
.m2w-board-reopen:hover {
  background: linear-gradient(180deg, rgba(50,24,8,0.95) 0%, rgba(30,14,5,0.98) 100%);
  color: #f0c060;
}
.m2w-board-reopen--hidden { display: none; }

/* --- Header --- */
.m2w-board-header {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px 10px;
  border-bottom: 2px solid rgba(168,80,20,0.25);
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(80,30,8,0.18) 0%, rgba(40,15,4,0.12) 100%);
}
.m2w-board-corner {
  font-size: 8px; color: rgba(200,120,40,0.4);
}
.m2w-board-icon {
  font-size: 18px; color: #d4a040;
  text-shadow: 0 0 8px rgba(220,130,20,0.5);
}
.m2w-board-title {
  font-family: var(--m2w-serif); font-size: 16px; font-weight: 700;
  color: #d4a040; letter-spacing: 3px; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(200,100,20,0.3);
}

/* Sub-ribbon */
.m2w-board-ribbon {
  text-align: center;
  font-family: var(--m2w-serif); font-size: 10px; font-style: italic;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(168,100,40,0.55);
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(168,60,10,0.12);
  flex-shrink: 0;
}

/* --- Section labels --- */
.m2w-board-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(200,120,50,0.5); padding: 10px 20px 6px; flex-shrink: 0;
}

/* --- Ornate dividers --- */
.m2w-board-divider-ornate {
  text-align: center; padding: 6px 0;
  font-size: 8px; color: rgba(168,80,20,0.3);
  letter-spacing: 4px; flex-shrink: 0;
  border-top: 1px solid rgba(168,60,10,0.1);
  border-bottom: 1px solid rgba(168,60,10,0.1);
}

/* --- Unread message alert --- */
.m2w-board-msg-alert {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  background: linear-gradient(90deg, rgba(180,120,30,0.12) 0%, rgba(120,60,10,0.08) 100%);
  border-bottom: 1px solid rgba(168,60,10,0.12);
  text-decoration: none; cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.m2w-board-msg-alert:hover {
  background: linear-gradient(90deg, rgba(200,140,40,0.2) 0%, rgba(140,70,15,0.14) 100%);
}
.m2w-board-msg-alert--hidden { display: none; }
.m2w-board-msg-seal {
  font-size: 14px;
  animation: m2w-msg-glow 2.5s ease-in-out infinite;
}
.m2w-board-msg-text {
  flex: 1; font-size: 11px; font-style: italic;
  color: rgba(220,180,100,0.75);
  font-family: var(--m2w-serif);
  letter-spacing: 0.5px;
}
.m2w-board-msg-arrow {
  font-size: 14px; color: rgba(200,140,60,0.4);
  transition: color 0.2s;
}
.m2w-board-msg-alert:hover .m2w-board-msg-arrow { color: rgba(220,170,80,0.8); }
@keyframes m2w-msg-glow {
  0%, 100% { color: rgba(200,140,60,0.6); text-shadow: none; }
  50% { color: #d4a040; text-shadow: 0 0 6px rgba(220,160,40,0.5); }
}

/* --- Players --- */
.m2w-board-players {
  padding: 0 16px 8px; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
}
.m2w-board-player {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 5px;
  background: rgba(168,60,10,0.06); border: 1px solid rgba(168,60,10,0.12);
  font-size: 12px;
}
.m2w-board-player-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.m2w-board-player-name { color: rgba(220,180,120,0.9); font-weight: 500; }
.m2w-board-player-you  { color: #c8941a; font-size: 10px; font-style: italic; }

/* --- Post feed --- */
.m2w-board-feed {
  flex: 1; overflow-y: auto; padding: 4px 16px 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.m2w-board-feed::-webkit-scrollbar { width: 4px; }
.m2w-board-feed::-webkit-scrollbar-thumb { background: rgba(168,60,10,0.45); border-radius: 3px; }

/* Individual post card — parchment style */
.m2w-board-post {
  padding: 12px 14px; border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(40,22,8,0.7) 0%, rgba(28,14,5,0.6) 100%);
  border: 1px solid rgba(168,80,20,0.18);
  border-left: 3px solid rgba(200,120,40,0.4);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.m2w-board-post:hover {
  border-left-color: #d4a040;
  background: linear-gradient(135deg, rgba(50,28,10,0.8) 0%, rgba(35,18,6,0.7) 100%);
}

/* Post header: avatar + author + time */
.m2w-board-post-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.m2w-board-post-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(200,120,40,0.35);
  object-fit: cover;
  box-shadow: 0 0 6px rgba(200,100,20,0.2);
}
.m2w-board-post-meta {
  flex: 1; min-width: 0;
}
.m2w-board-post-user {
  font-size: 12px; font-weight: 600; color: #d4a040;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m2w-board-post-time {
  font-size: 9px; color: rgba(168,100,40,0.45);
  font-style: italic; margin-top: 1px;
}

/* Post title */
.m2w-board-post-title {
  font-family: var(--m2w-serif);
  font-size: 13px; font-weight: 700; color: rgba(230,190,130,0.9);
  line-height: 1.4; margin-bottom: 4px;
}

/* Post excerpt */
.m2w-board-post-text {
  font-size: 11px; color: rgba(200,170,130,0.6); line-height: 1.5;
}

/* Post engagement bar */
.m2w-board-post-stats {
  display: flex; align-items: center; gap: 14px;
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid rgba(168,60,10,0.1);
}
.m2w-board-post-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: rgba(200,140,70,0.5);
}
.m2w-board-post-stat-icon {
  font-size: 12px;
}
.m2w-board-post-stat--hot .m2w-board-post-stat-icon {
  color: #e05030;
  text-shadow: 0 0 6px rgba(220,60,20,0.5);
}

/* Rank badge */
.m2w-board-post-rank {
  position: absolute; top: 8px; right: 10px;
  font-family: var(--m2w-serif); font-size: 20px; font-weight: 700;
  color: rgba(200,120,40,0.15);
  line-height: 1;
}

/* Like button (inline in post stats) */
.m2w-board-post-like-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: rgba(200,140,70,0.5);
  transition: color 0.2s;
}
.m2w-board-post-like-btn:hover { color: #e05030; }
.m2w-board-post-like-btn--liked { color: #e05030; }
.m2w-board-post-like-btn--liked .m2w-board-post-stat-icon {
  text-shadow: 0 0 6px rgba(220,60,20,0.5);
}

/* Comment input (inline under post) */
.m2w-board-post-comment-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(168,60,10,0.08);
}
.m2w-board-post-comment-input {
  flex: 1; background: rgba(20,10,4,0.6); border: 1px solid rgba(168,80,20,0.2);
  border-radius: 3px; padding: 5px 8px;
  font-family: var(--m2w-serif); font-size: 10px; color: rgba(220,180,120,0.85);
  outline: none; resize: none;
}
.m2w-board-post-comment-input::placeholder { color: rgba(168,100,40,0.35); font-style: italic; }
.m2w-board-post-comment-input:focus { border-color: rgba(200,120,40,0.45); }
.m2w-board-post-comment-send {
  background: none; border: 1px solid rgba(168,80,20,0.25);
  border-radius: 3px; padding: 4px 8px; cursor: pointer;
  font-size: 10px; color: rgba(200,140,60,0.6);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.m2w-board-post-comment-send:hover { color: #d4a040; border-color: rgba(200,120,40,0.5); }

/* Compose new post */
.m2w-board-compose {
  flex-shrink: 0; position: relative;
}
.m2w-board-compose-toggle {
  position: absolute; right: 14px; top: 0; transform: translateY(-50%);
  background: linear-gradient(135deg, rgba(40,20,6,0.9) 0%, rgba(25,12,4,0.95) 100%);
  border: 1px solid rgba(200,120,40,0.3); border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #d4a040; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}
.m2w-board-compose-toggle:hover {
  background: linear-gradient(135deg, rgba(60,30,8,0.95) 0%, rgba(35,16,5,1) 100%);
  transform: translateY(-50%) scale(1.1);
}
.m2w-board-compose-form--hidden { display: none; }
.m2w-board-compose-form {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(168,60,10,0.1);
}
.m2w-board-compose-title,
.m2w-board-compose-body {
  width: 100%; background: rgba(20,10,4,0.6);
  border: 1px solid rgba(168,80,20,0.2); border-radius: 3px;
  padding: 7px 10px;
  font-family: var(--m2w-serif); font-size: 11px; color: rgba(220,180,120,0.85);
  outline: none; resize: none;
}
.m2w-board-compose-title::placeholder,
.m2w-board-compose-body::placeholder { color: rgba(168,100,40,0.35); font-style: italic; }
.m2w-board-compose-title:focus,
.m2w-board-compose-body:focus { border-color: rgba(200,120,40,0.45); }
.m2w-board-compose-actions { display: flex; gap: 8px; }
.m2w-board-compose-submit {
  flex: 1; background: rgba(168,60,10,0.15); border: 1px solid rgba(200,120,40,0.3);
  border-radius: 3px; padding: 6px;
  font-family: var(--m2w-serif); font-size: 11px; font-weight: 600;
  color: #d4a040; cursor: pointer;
  transition: background 0.2s;
}
.m2w-board-compose-submit:hover { background: rgba(168,60,10,0.28); }
.m2w-board-compose-cancel {
  background: none; border: 1px solid rgba(168,80,20,0.15);
  border-radius: 3px; padding: 6px 12px;
  font-family: var(--m2w-serif); font-size: 11px;
  color: rgba(200,140,60,0.4); cursor: pointer;
}
.m2w-board-compose-cancel:hover { color: rgba(200,140,60,0.7); }
.m2w-board-compose-status {
  font-size: 10px; font-style: italic; min-height: 14px;
  color: rgba(200,140,60,0.5);
}
.m2w-board-compose-status--error { color: #cc4030; }
.m2w-board-compose-status--ok { color: #50a040; }

.m2w-board-empty {
  font-size: 12px; color: rgba(120,80,40,0.5); font-style: italic;
  padding: 20px 0; text-align: center;
}

/* --- Singer --- */
.m2w-board-singer {
  padding: 10px 20px 14px; font-size: 12px; color: rgba(200,170,130,0.6);
  font-style: italic; flex-shrink: 0;
}
.m2w-board-singer--live {
  color: #ff8060 !important; font-style: normal; font-weight: 600;
  animation: m2w-pulse 1.5s ease infinite;
}

/* ── Hint ribbon (bottom) — smoky hearth style ──────────────────────── */
.m2w-tavern-hint {
  position: absolute; bottom: 0; left: 0; right: 480px;
  height: 52px;
  pointer-events: none; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background:
    linear-gradient(0deg,
      rgba(8,3,0,0.95) 0%, rgba(10,5,1,0.75) 50%, transparent 100%);
}
.m2w-tavern-hint::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(168,60,10,0.25) 30%, rgba(168,60,10,0.45) 50%, rgba(168,60,10,0.25) 70%, transparent);
}
.m2w-tav-hint-inner {
  display: flex; align-items: center; gap: 8px; padding: 0 24px;
}
.m2w-tav-hint-glyph {
  font-size: 8px; color: #d07030; opacity: 0.35;
  animation: m2w-tav-hint-glyph-breathe 4s ease-in-out infinite;
}
.m2w-tav-hint-glyph:nth-child(even) { animation-delay: 2s; }
@keyframes m2w-tav-hint-glyph-breathe {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.65; color: #f09040; }
}
.m2w-tav-hint-text {
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 1.2px;
  color: rgba(180,100,40,0.50);
}
.m2w-tav-hint-text kbd {
  display: inline-block;
  background: rgba(168,60,10,0.10); border: 1px solid rgba(168,60,10,0.22);
  border-radius: 3px; padding: 2px 6px;
  font-family: var(--m2w-sans); font-size: 9px;
  color: rgba(220,130,50,0.60); margin: 0 2px; vertical-align: 1px;
}
.m2w-tav-hint-sep {
  width: 1px; height: 14px;
  background: rgba(168,60,10,0.18); margin: 0 4px;
}

/* ── Tavern responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .m2w-tavern-header { height: 56px; }
  .m2w-tavern-name { font-size: 12px; letter-spacing: 3px; }
  .m2w-tav-subtitle { display: none; }
  .m2w-tav-filigree-line { width: 16px; }
  .m2w-tavern-hint { height: 44px; }
  .m2w-tav-hint-text { font-size: 9px; }
  .m2w-tavern-exit { padding: 5px 10px; font-size: 10px; }
}

/* ── Building click loader ──────────────────────────────────────────── */
.m2w-click-loader {
  position: absolute;
  pointer-events: none; z-index: 45;
  transform: translate(-50%, -50%);
  color: var(--m2w-gold);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(200,148,26,0.9);
  animation: m2w-click-rise 0.9s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes m2w-click-rise {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6) rotate(0deg);   }
  45%  { opacity: 1; transform: translate(-50%, -80%) scale(1.3) rotate(135deg); }
  100% { opacity: 0; transform: translate(-50%,-130%) scale(0.7) rotate(360deg); }
}

/* ── Camera pan compass cursor ──────────────────────────────────────── */
/*
   A DOM element is used instead of cursor:url() so we get CSS animations.
   The wrapper is always in the document; opacity/scale do the show/hide.
*/
.m2w-pan-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 34px;
  height: 34px;
  /* centre hotspot on mouse position */
  transform: translate(-50%, -50%);
}
.m2w-pan-cursor__icon {
  width: 100%;
  height: 100%;
  opacity: 0;
  scale: 0.65;
  transition: opacity 0.18s ease, scale 0.22s cubic-bezier(.34,1.5,.64,1);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.75))
          drop-shadow(0 0 8px rgba(200,148,26,0));
}
/* Shown — press/drag initiated */
.m2w-pan-cursor--visible .m2w-pan-cursor__icon {
  opacity: 1;
  scale: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.75))
          drop-shadow(0 0 8px rgba(200,148,26,0.5));
}
/* Active — drag threshold exceeded: compass spins */
.m2w-pan-cursor--active .m2w-pan-cursor__icon {
  opacity: 1;
  scale: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.75))
          drop-shadow(0 0 12px rgba(240,192,64,0.65));
  animation: m2w-compass-spin 14s linear infinite;
}
@keyframes m2w-compass-spin {
  to { transform: rotate(360deg); }
}

/* ── Login panel (overlays menu tabs) ───────────────────────────────── */
.m2w-login-panel {
  position: absolute; inset: 48px 0 0 0; /* below nav */
  z-index: 8;
  background: var(--m2w-bg-solid);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.4,0,.2,1);
}
.m2w-login-panel--hidden {
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
}

.m2w-login-back {
  position: absolute; top: 14px; left: 16px;
  background: none; border: 1px solid var(--m2w-border2); border-radius: 4px;
  color: var(--m2w-dim); font-family: var(--m2w-sans); font-size: 11px;
  padding: 5px 12px; cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.15s;
}
.m2w-login-back:hover { border-color: var(--m2w-border); color: var(--m2w-gold-lt); }

.m2w-login-inner {
  width: min(340px, 88%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.m2w-login-orn {
  font-size: 10px; letter-spacing: 8px; color: var(--m2w-gold-dk);
  opacity: 0.6; margin-bottom: 4px;
}
.m2w-login-title {
  font-family: var(--m2w-serif); font-size: 22px; font-weight: 700;
  color: var(--m2w-gold); letter-spacing: 4px; text-transform: uppercase;
}
.m2w-login-sub {
  font-size: 11px; color: var(--m2w-dim); font-style: italic; margin-bottom: 4px;
}

.m2w-login-form {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
}
.m2w-login-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--m2w-gold-dk); margin-bottom: -4px;
}
.m2w-login-input {
  width: 100%; padding: 9px 12px;
  background: rgba(12, 8, 4, 0.7);
  border: 1px solid var(--m2w-border2); border-radius: 4px;
  color: var(--m2w-text); font-family: var(--m2w-sans); font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.3);
}
.m2w-login-input:focus {
  border-color: var(--m2w-gold-dk);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.3), 0 0 0 2px rgba(168,120,50,0.12);
}
.m2w-login-input::placeholder { color: rgba(168,140,100,0.3); }

.m2w-login-error {
  min-height: 18px; font-size: 11px; color: #e06060;
  font-style: italic; text-align: center; line-height: 1.4;
}

.m2w-login-submit {
  width: 100%; padding: 11px;
  background: linear-gradient(180deg, rgba(168,120,50,0.22), rgba(80,48,16,0.45));
  border: 1px solid var(--m2w-gold-dk); border-radius: 4px;
  color: var(--m2w-gold-lt); font-family: var(--m2w-serif); font-size: 13px;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; transition: all 0.18s;
  box-shadow: inset 0 1px 0 rgba(200,148,26,0.12);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.m2w-login-submit:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(168,120,50,0.4), rgba(100,60,20,0.6));
  border-color: var(--m2w-gold); color: #fff;
  box-shadow: 0 0 18px rgba(168,120,50,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.m2w-login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.m2w-login-submit-orn {
  font-size: 9px; opacity: 0.7;
  animation: m2w-spin 2s linear infinite;
}

.m2w-login-links {
  margin-top: 4px; display: flex; flex-direction: column; gap: 8px;
}
.m2w-login-link {
  font-size: 10px; color: var(--m2w-gold-dk); text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}
.m2w-login-link:hover { color: var(--m2w-gold-lt); }

.m2w-login-recaptcha {
  font-size: 9px; color: var(--m2w-dim); line-height: 1.5;
}
.m2w-login-recaptcha a {
  color: var(--m2w-dim); text-decoration: underline;
}
.m2w-login-recaptcha a:hover { color: var(--m2w-gold-dk); }

/* Hide reCAPTCHA badge — disclosure shown in login form instead */
.grecaptcha-badge { visibility: hidden !important; }

/* ── Singing prompt (near mic stand) ───────────────────────────────── */
.m2w-sing-prompt {
  position: absolute;
  z-index: 32;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -100%);
  transition: opacity 0.4s ease;
  will-change: left, top;
}

.m2w-sing-prompt--hidden {
  opacity: 0;
  pointer-events: none;
}

.m2w-sing-prompt-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,148,26,0.25) 0%, rgba(200,148,26,0) 70%);
  animation: m2w-sing-glow-pulse 2s ease-in-out infinite;
}

@keyframes m2w-sing-glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50%      { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.m2w-sing-prompt-notes {
  display: flex;
  gap: 10px;
}

.m2w-sing-note {
  font-size: 18px;
  color: var(--m2w-gold);
  animation: m2w-note-float 2.5s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(200,148,26,0.5);
}

.m2w-sing-note:nth-child(2) { animation-delay: 0.4s; }
.m2w-sing-note:nth-child(3) { animation-delay: 0.8s; }
.m2w-sing-note:nth-child(4) { animation-delay: 1.2s; }

@keyframes m2w-note-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  25%      { transform: translateY(-8px) rotate(-8deg); opacity: 1; }
  75%      { transform: translateY(-4px) rotate(8deg); opacity: 0.8; }
}

.m2w-sing-prompt-text {
  background: var(--m2w-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--m2w-border);
  border-radius: 16px;
  padding: 6px 16px;
  font-family: var(--m2w-serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--m2w-gold-lt);
  letter-spacing: 1px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 30px rgba(200,148,26,0.1);
}

.m2w-sing-prompt-text kbd {
  display: inline-block;
  background: rgba(200,148,26,0.2);
  border: 1px solid var(--m2w-gold-dk);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--m2w-hi);
  margin: 0 2px;
}

/* ── Singing active badge ─────────────────────────────────────────── */
.m2w-sing-active {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 32;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.m2w-sing-active--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
}

.m2w-sing-active-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(180, 30, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 80, 80, 0.5);
  border-radius: 20px;
  padding: 5px 14px;
  box-shadow: 0 4px 16px rgba(180,30,30,0.3);
}

.m2w-sing-active-icon {
  font-size: 14px;
}

.m2w-sing-active-label {
  font-family: var(--m2w-sans);
  font-size: 11px;
  font-weight: 700;
  color: #ff8080;
  letter-spacing: 2px;
  animation: m2w-pulse 1.5s ease infinite;
}

.m2w-sing-active-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-family: var(--m2w-sans);
}

.m2w-sing-active-hint kbd {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  padding: 0 4px;
  font-family: var(--m2w-sans);
  font-size: 9px;
  font-weight: 600;
}

/* ── Audio visualizer bars (over singing player) ──────────────────── */
.m2w-audio-bars {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  transform: translate(-50%, -100%);
  transition: left 0.15s linear, top 0.15s linear;
  pointer-events: auto;
  cursor: pointer;
  padding: 4px 8px;
}

.m2w-audio-bar {
  width: 3px;
  background: var(--m2w-gold);
  border-radius: 1.5px;
  animation: m2w-bar-bounce 0.8s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(200,148,26,0.4);
}

.m2w-audio-bar:nth-child(1) { height: 8px;  animation-delay: 0s;    }
.m2w-audio-bar:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.m2w-audio-bar:nth-child(3) { height: 18px; animation-delay: 0.3s;  }
.m2w-audio-bar:nth-child(4) { height: 12px; animation-delay: 0.1s;  }
.m2w-audio-bar:nth-child(5) { height: 6px;  animation-delay: 0.25s; }

@keyframes m2w-bar-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1);   }
}

/* Listen tooltip on hover */
.m2w-audio-bars::after {
  content: 'Click to mute';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--m2w-sans);
  font-size: 9px;
  color: var(--m2w-gold-lt);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.m2w-audio-bars:hover::after {
  opacity: 1;
}

/* Listening state */
.m2w-audio-bars.m2w-listening .m2w-audio-bar {
  background: #50c0ff;
  box-shadow: 0 0 8px rgba(80,192,255,0.5);
}

.m2w-audio-bars.m2w-listening::after {
  content: 'Listening... click to mute';
  color: #80d0ff;
}

/* ── Singer Panel (mute/unmute controls) ───────────────────────────── */
.m2w-singer-panel {
  position: fixed;
  bottom: 72px;
  right: 16px;
  z-index: 999;
  background: rgba(12,8,6,0.92);
  border: 1px solid rgba(200,148,26,0.3);
  border-radius: 10px;
  padding: 0;
  min-width: 200px;
  max-width: 280px;
  font-family: var(--m2w-sans);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}
.m2w-singer-panel--hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.m2w-singer-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(200,148,26,0.15);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--m2w-gold);
}
.m2w-singer-panel__close {
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  line-height: 1;
}
.m2w-singer-panel__close:hover { opacity: 1; }
.m2w-singer-panel__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.m2w-singer-panel__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #e0d0c0;
  transition: background 0.15s ease;
}
.m2w-singer-panel__row:hover {
  background: rgba(200,148,26,0.08);
}
.m2w-singer-panel__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m2w-singer-panel__src {
  font-size: 9px;
  color: rgba(200,148,26,0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.m2w-singer-panel__mute {
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(200,148,26,0.2);
  background: rgba(200,148,26,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.m2w-singer-panel__mute:hover {
  background: rgba(200,148,26,0.2);
  border-color: rgba(200,148,26,0.4);
}
.m2w-singer-panel__mute--muted {
  background: rgba(180,40,40,0.2);
  border-color: rgba(180,40,40,0.4);
}
.m2w-singer-panel__mute--muted:hover {
  background: rgba(180,40,40,0.3);
}
.m2w-singer-panel__empty {
  padding: 12px;
  font-size: 11px;
  color: rgba(200,148,26,0.4);
  text-align: center;
  font-style: italic;
}
.m2w-singer-panel__actions {
  display: flex;
  gap: 4px;
  padding: 6px 12px 8px;
  border-top: 1px solid rgba(200,148,26,0.1);
}
.m2w-singer-panel__btn {
  flex: 1;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--m2w-gold-lt);
  border-radius: 4px;
  border: 1px solid rgba(200,148,26,0.15);
  background: rgba(200,148,26,0.05);
  transition: background 0.15s ease;
}
.m2w-singer-panel__btn:hover {
  background: rgba(200,148,26,0.15);
}

/* ── Hand Mic inventory use button ─────────────────────────────────── */
.m2w-inv-item--usable {
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.m2w-inv-item--usable:hover {
  border-color: rgba(200,60,120,0.5);
}
.m2w-inv-item__use {
  margin-top: 4px;
  font-size: 10px;
  color: #f080b0;
  letter-spacing: 0.5px;
}
.m2w-inv-item__use kbd {
  display: inline-block;
  padding: 0 4px;
  font-size: 9px;
  background: rgba(200,60,120,0.15);
  border: 1px solid rgba(200,60,120,0.3);
  border-radius: 3px;
  color: #f0a0c0;
  font-family: var(--m2w-sans);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .m2w-wrap:not(.m2w-wrap--full) {
    margin: 0;
    border-radius: 0;
    max-width: none;
  }

  .m2w-hud { height: 36px; padding: 0 12px; }
  .m2w-hud-brand { font-size: 11px; letter-spacing: 2px; }
  .m2w-panel-title { font-size: 12px; letter-spacing: 1.5px; }

  .m2w-panel {
    left: 4px; right: 4px; bottom: 4px;
  }

  .m2w-panel:not(.m2w-panel--hidden) {
    max-height: 58%;
  }

  .m2w-item { padding: 6px 10px; font-size: 11px; }
  .m2w-btn { font-size: 10px; padding: 3px 10px; }

  .m2w-music-toast {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
  }

  .m2w-music-toast-inner {
    padding: 9px 12px 9px 10px;
    gap: 10px;
  }

  .m2w-music-toast-badge {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .m2w-interact-prompt-inner {
    gap: 10px;
    padding: 8px 11px 8px 9px;
  }

  .m2w-interact-prompt-badge {
    min-width: 50px;
    height: 32px;
  }

  .m2w-interact-prompt-key {
    font-size: 9px;
    letter-spacing: 1.4px;
  }
}

@media (max-width: 380px) {
  .m2w-hud-name { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   SCRIPTORIUM INTERIOR
═══════════════════════════════════════════════════════════════════════ */
.m2w-scriptorium {
  position: absolute; inset: 0; z-index: 48;
  pointer-events: none; /* pass mouse events through to canvas for raycasting */
}
.m2w-scriptorium--hidden { display: none; }

.m2w-scriptorium-veil {
  position: absolute; inset: 0; z-index: 2;
  background: #0a0602; opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.m2w-scrip-veil--dark { opacity: 1; }

.m2w-scriptorium-ui {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
}
/* Warm amber light leak from top */
.m2w-scriptorium-ui::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 180px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(200,160,50,0.04) 0%, transparent 100%);
}

/* ── Header — cathedral arch with gold filigree ───────────────────────── */
.m2w-scrip-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 72px;
  pointer-events: auto;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg,
      rgba(10,8,3,0.98) 0%,
      rgba(12,9,4,0.92) 40%,
      rgba(12,9,4,0.65) 70%,
      transparent 100%);
}
/* Double-line glow bottom edge */
.m2w-scrip-header::before {
  content: '';
  position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(130,90,20,0.15) 10%, rgba(130,90,20,0.5) 30%,
    rgba(200,160,60,0.7) 50%, rgba(130,90,20,0.5) 70%, rgba(130,90,20,0.15) 90%, transparent);
}
.m2w-scrip-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(200,148,26,0.08) 20%, rgba(200,148,26,0.28) 50%, rgba(200,148,26,0.08) 80%, transparent);
}
/* Travelling shimmer */
.m2w-scrip-header-shimmer {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
  overflow: hidden; pointer-events: none;
}
.m2w-scrip-header-shimmer::before {
  content: '';
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(232,192,80,0.7), transparent);
  animation: m2w-scrip-shimmer-travel 7s ease-in-out infinite;
}
@keyframes m2w-scrip-shimmer-travel {
  0%   { left: -40%; }
  100% { left: 140%; }
}

/* ── Exit button ──────────────────────────────────────────────────────── */
.m2w-scriptorium-exit {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  background: rgba(130,90,20,0.08);
  border: 1px solid rgba(130,90,20,0.25);
  border-radius: 6px;
  color: rgba(200,160,60,0.75);
  font-family: var(--m2w-serif);
  font-size: 11px; font-weight: 600;
  padding: 7px 16px 7px 12px;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  display: flex; align-items: center; gap: 6px;
}
.m2w-scriptorium-exit:hover {
  background: rgba(130,90,20,0.2);
  border-color: rgba(180,130,40,0.55);
  color: #fff;
  box-shadow: 0 0 16px rgba(200,160,50,0.15);
}
.m2w-scrip-exit-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}
.m2w-scriptorium-exit:hover .m2w-scrip-exit-arrow {
  transform: translateX(-3px);
}

/* ── Title cluster ────────────────────────────────────────────────────── */
.m2w-scrip-title-group {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m2w-scrip-title-row {
  display: flex; align-items: center; gap: 16px;
}
.m2w-scrip-filigree {
  display: flex; align-items: center; gap: 4px;
  color: rgba(200,148,26,0.55);
  font-size: 7px;
  letter-spacing: 3px;
  opacity: 0.7;
}
.m2w-scrip-filigree-diamond {
  font-size: 6px;
  animation: m2w-scrip-filigree-pulse 3s ease-in-out infinite;
}
.m2w-scrip-filigree-line {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,148,26,0.55), transparent);
}
@keyframes m2w-scrip-filigree-pulse {
  0%,100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
.m2w-scrip-name {
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 15px; font-weight: 700;
  color: #c8a040; letter-spacing: 6px; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(200,160,50,0.4), 0 0 50px rgba(180,130,30,0.15);
  animation: m2w-scrip-title-glow 4s ease-in-out infinite;
}
@keyframes m2w-scrip-title-glow {
  0%,100% { text-shadow: 0 0 18px rgba(200,160,50,0.35), 0 0 38px rgba(180,130,30,0.12); color: #c8a040; }
  50%      { text-shadow: 0 0 28px rgba(232,192,80,0.65), 0 0 58px rgba(200,150,40,0.28), 0 0 90px rgba(180,120,30,0.12); color: #e0c060; }
}
.m2w-scrip-subtitle {
  font-family: var(--m2w-serif);
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(160,120,40,0.30);
  margin-top: 1px;
  font-style: italic;
}

/* ── Ambient CSS particles ────────────────────────────────────────────── */
.m2w-scrip-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 4; overflow: hidden;
}
.m2w-scrip-particle {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #c8a040; opacity: 0;
  animation: m2w-scrip-particle-drift linear infinite;
}
@keyframes m2w-scrip-particle-drift {
  0%   { opacity: 0; transform: translateY(0) translateX(0); }
  15%  { opacity: 0.45; }
  85%  { opacity: 0.25; }
  100% { opacity: 0; transform: translateY(-120vh) translateX(30px); }
}
.m2w-scrip-particle:nth-child(1)  { left:  8%; bottom: -5%; animation-duration: 15s; animation-delay: 0s; }
.m2w-scrip-particle:nth-child(2)  { left: 22%; bottom: -8%; animation-duration: 19s; animation-delay: 2s;  width: 3px; height: 3px; }
.m2w-scrip-particle:nth-child(3)  { left: 37%; bottom: -3%; animation-duration: 17s; animation-delay: 5s;  width: 1.5px; height: 1.5px; }
.m2w-scrip-particle:nth-child(4)  { left: 55%; bottom: -6%; animation-duration: 21s; animation-delay: 1s;  background: #e0b860; }
.m2w-scrip-particle:nth-child(5)  { left: 68%; bottom: -4%; animation-duration: 16s; animation-delay: 7s;  width: 2.5px; height: 2.5px; }
.m2w-scrip-particle:nth-child(6)  { left: 82%; bottom: -7%; animation-duration: 23s; animation-delay: 3s;  width: 1.5px; height: 1.5px; }
.m2w-scrip-particle:nth-child(7)  { left: 15%; bottom: -2%; animation-duration: 18s; animation-delay: 9s;  background: #ff9020; }
.m2w-scrip-particle:nth-child(8)  { left: 45%; bottom: -9%; animation-duration: 20s; animation-delay: 4s;  width: 3px; height: 3px; }
.m2w-scrip-particle:nth-child(9)  { left: 73%; bottom: -1%; animation-duration: 14s; animation-delay: 6s;  width: 1.5px; height: 1.5px; background: #e8d0a0; }
.m2w-scrip-particle:nth-child(10) { left: 91%; bottom: -5%; animation-duration: 22s; animation-delay: 8s; }

/* ── Hint ribbon (bottom) ─────────────────────────────────────────────── */
.m2w-scrip-hint {
  position: absolute; bottom: 0; left: 0; right: 420px;
  height: 52px;
  pointer-events: none; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background:
    linear-gradient(0deg,
      rgba(6,4,1,0.95) 0%, rgba(8,6,2,0.75) 50%, transparent 100%);
}
.m2w-scrip-hint::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(130,90,20,0.25) 30%, rgba(130,90,20,0.4) 50%, rgba(130,90,20,0.25) 70%, transparent);
}
.m2w-scrip-hint-inner {
  display: flex; align-items: center; gap: 8px; padding: 0 24px;
}
.m2w-scrip-hint-glyph {
  font-size: 8px; color: #c8a040; opacity: 0.35;
  animation: m2w-scrip-hint-glyph-breathe 4s ease-in-out infinite;
}
.m2w-scrip-hint-glyph:nth-child(even) { animation-delay: 2s; }
@keyframes m2w-scrip-hint-glyph-breathe {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.65; color: #e0c060; }
}
.m2w-scrip-hint-text {
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 1.2px;
  color: rgba(160,120,40,0.50);
}
.m2w-scrip-hint-text kbd {
  display: inline-block;
  background: rgba(130,90,20,0.10); border: 1px solid rgba(130,90,20,0.22);
  border-radius: 3px; padding: 2px 6px;
  font-family: var(--m2w-sans); font-size: 9px;
  color: rgba(180,140,50,0.60); margin: 0 2px; vertical-align: 1px;
}
.m2w-scrip-hint-sep {
  width: 1px; height: 14px;
  background: rgba(130,90,20,0.18); margin: 0 4px;
}

/* ── Scriptorium responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .m2w-scrip-header { height: 56px; }
  .m2w-scrip-name { font-size: 12px; letter-spacing: 3px; }
  .m2w-scrip-subtitle { display: none; }
  .m2w-scrip-filigree-line { width: 16px; }
  .m2w-scrip-hint { height: 44px; }
  .m2w-scrip-hint-text { font-size: 9px; }
  .m2w-scriptorium-exit { padding: 5px 10px; font-size: 10px; }
}

/* ── Scholar's Ledger sidebar ──────────────────────────────────────── */
.m2w-scrip-board {
  position: absolute; top: 72px; right: 0; bottom: 52px;
  width: 420px;
  background:
    linear-gradient(180deg, rgba(8,6,2,0.94) 0%, rgba(14,10,4,0.97) 100%);
  border-left: 2px solid rgba(130,90,20,0.3);
  display: flex; flex-direction: column;
  pointer-events: none;
  overflow: hidden;
  box-shadow: -12px 0 36px rgba(0,0,0,0.55), inset 1px 0 0 rgba(130,90,20,0.08);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  z-index: 10;
}
.m2w-scrip-board > * { pointer-events: auto; }
.m2w-scrip-board--collapsed {
  transform: translateX(100%);
  pointer-events: none;
}

/* Collapse button */
.m2w-scrip-board-collapse {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid rgba(130,90,20,0.2);
  border-radius: 3px; color: rgba(180,140,50,0.45);
  font-size: 12px; width: 24px; height: 24px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1;
}
.m2w-scrip-board-collapse:hover {
  color: rgba(200,160,60,0.9); border-color: rgba(180,120,30,0.5);
  background: rgba(130,80,10,0.12);
}

/* Re-open tab */
.m2w-scrip-board-reopen {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(20,14,5,0.92) 0%, rgba(12,8,3,0.95) 100%);
  border: 1px solid rgba(130,90,20,0.3); border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 12px 10px; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--m2w-serif); font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: #c8a040; cursor: pointer;
  pointer-events: auto;
  box-shadow: -4px 0 12px rgba(0,0,0,0.4);
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.m2w-scrip-board-reopen:hover {
  background: linear-gradient(180deg, rgba(35,24,8,0.95) 0%, rgba(20,14,5,0.98) 100%);
  color: #e8c050;
}
.m2w-scrip-board-reopen--hidden { display: none; }

/* Header */
.m2w-scrip-board-header {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px 10px;
  border-bottom: 2px solid rgba(130,90,20,0.2);
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(60,40,8,0.15) 0%, rgba(30,18,4,0.10) 100%);
}
.m2w-scrip-board-corner { font-size: 8px; color: rgba(150,110,30,0.4); }
.m2w-scrip-board-icon {
  font-size: 18px; color: #c8a040;
  text-shadow: 0 0 8px rgba(200,150,40,0.4);
}
.m2w-scrip-board-title {
  font-family: var(--m2w-serif); font-size: 16px; font-weight: 700;
  color: #c8a040; letter-spacing: 3px; text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(180,130,30,0.3);
}

/* Sub-ribbon */
.m2w-scrip-board-ribbon {
  text-align: center;
  font-family: var(--m2w-serif); font-size: 10px; font-style: italic;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(150,110,40,0.5);
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(130,80,20,0.10);
  flex-shrink: 0;
}

/* Section labels */
.m2w-scrip-board-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(180,130,50,0.5); padding: 10px 20px 6px; flex-shrink: 0;
}

/* Divider */
.m2w-scrip-board-divider {
  text-align: center; padding: 6px 0;
  font-size: 8px; color: rgba(130,90,20,0.3);
  letter-spacing: 4px; flex-shrink: 0;
  border-top: 1px solid rgba(130,80,20,0.08);
  border-bottom: 1px solid rgba(130,80,20,0.08);
}

/* Scrollable pillar course list */
.m2w-scrip-board-pillars {
  flex: 1; overflow-y: auto; padding: 4px 16px 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
}
.m2w-scrip-board-pillars::-webkit-scrollbar { width: 4px; }
.m2w-scrip-board-pillars::-webkit-scrollbar-thumb { background: rgba(130,80,20,0.45); border-radius: 3px; }

.m2w-scrip-board-empty {
  font-size: 12px; color: rgba(120,80,40,0.5); font-style: italic;
  padding: 14px 0; text-align: center;
}

/* Course card */
.m2w-scrip-course {
  padding: 12px 14px; border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(30,22,8,0.7) 0%, rgba(20,14,5,0.6) 100%);
  border: 1px solid rgba(130,90,20,0.18);
  border-left: 3px solid rgba(180,130,40,0.4);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.m2w-scrip-course:hover {
  border-left-color: #c8a040;
  background: linear-gradient(135deg, rgba(40,28,10,0.8) 0%, rgba(28,18,6,0.7) 100%);
}
.m2w-scrip-course--done { border-left-color: #50a050; }
.m2w-scrip-course--done:hover { border-left-color: #60c060; }

/* Locked state: muted, iron-grey border */
.m2w-scrip-course--locked {
  border-left-color: rgba(80,60,40,0.3);
  background: linear-gradient(135deg, rgba(16,12,6,0.6) 0%, rgba(10,8,4,0.5) 100%);
  opacity: 0.7;
}
.m2w-scrip-course--locked:hover {
  border-left-color: rgba(120,90,50,0.4);
  opacity: 0.85;
}
.m2w-scrip-course--locked .m2w-scrip-course-title { color: rgba(160,130,90,0.6); }
.m2w-scrip-course--locked .m2w-scrip-course-pct { color: rgba(120,80,40,0.4); }
.m2w-scrip-course--locked .m2w-scrip-course-step {
  background: rgba(40,30,15,0.6);
  border-color: rgba(60,40,20,0.3);
  color: rgba(120,90,50,0.5);
}

/* Lock badge */
.m2w-scrip-course-lock-badge {
  position: absolute; top: 8px; right: 10px;
  font-size: 13px; opacity: 0.5;
}

/* Head row: step badge + info */
.m2w-scrip-course-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.m2w-scrip-course-info { flex: 1; min-width: 0; }

/* Step number badge (roman numeral) */
.m2w-scrip-course-step {
  flex-shrink: 0;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  border: 2px solid rgba(160,110,30,0.5);
  background:
    linear-gradient(135deg, rgba(50,36,12,0.9) 0%, rgba(28,18,6,0.95) 100%);
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 15px; font-weight: 700;
  color: #c8a040;
  text-shadow: 0 0 8px rgba(200,150,40,0.3);
}
.m2w-scrip-course--done .m2w-scrip-course-step {
  border-color: rgba(70,140,60,0.5);
  color: #60b060;
  text-shadow: 0 0 8px rgba(60,140,40,0.3);
}

/* Subtitle under course title */
.m2w-scrip-course-sub {
  font-family: var(--m2w-serif);
  font-size: 10px; font-style: italic;
  color: rgba(150,110,50,0.5);
  line-height: 1.3; margin-top: 1px;
}

/* ── Medieval illuminated frame ── */
.m2w-scrip-course-frame {
  position: relative; flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 4px;
  /* double-border illusion: outer gold + inner dark */
  border: 2px solid rgba(160,110,30,0.6);
  box-shadow:
    inset 0 0 0 1px rgba(90,60,15,0.9),
    0 0 10px rgba(160,110,20,0.15),
    inset 0 0 8px rgba(0,0,0,0.6);
  background:
    linear-gradient(135deg, rgba(40,28,10,0.9) 0%, rgba(20,12,4,0.95) 100%);
  overflow: hidden;
}
/* Corner filigree accents (pseudo-elements) */
.m2w-scrip-course-frame::before,
.m2w-scrip-course-frame::after {
  content: '\25C6'; /* diamond */
  position: absolute; font-size: 6px;
  color: rgba(200,150,50,0.45);
  z-index: 2; line-height: 1;
  text-shadow: 0 0 3px rgba(200,140,30,0.3);
}
.m2w-scrip-course-frame::before { top: 1px; left: 2px; }
.m2w-scrip-course-frame::after  { bottom: 1px; right: 2px; }

/* Done state: green-tinted frame */
.m2w-scrip-course--done .m2w-scrip-course-frame {
  border-color: rgba(70,140,60,0.5);
  box-shadow:
    inset 0 0 0 1px rgba(40,80,30,0.8),
    0 0 10px rgba(60,140,40,0.12),
    inset 0 0 8px rgba(0,0,0,0.6);
}
.m2w-scrip-course--done .m2w-scrip-course-frame::before,
.m2w-scrip-course--done .m2w-scrip-course-frame::after {
  color: rgba(100,180,70,0.4);
}

/* The actual image */
.m2w-scrip-course-img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(0.25) saturate(0.85) brightness(0.85);
  transition: filter 0.3s, transform 0.3s;
}
.m2w-scrip-course:hover .m2w-scrip-course-img {
  filter: sepia(0.1) saturate(1) brightness(1);
  transform: scale(1.06);
}

/* Placeholder when no thumbnail */
.m2w-scrip-course-img-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: radial-gradient(ellipse at 40% 30%, rgba(60,40,15,0.8), rgba(16,10,4,0.95));
}

/* Small variant for browse cards */
.m2w-scrip-course-frame--sm {
  width: 38px; height: 38px;
  border-width: 1.5px;
}
.m2w-scrip-course-frame--sm::before,
.m2w-scrip-course-frame--sm::after { font-size: 5px; }
.m2w-scrip-course-frame--sm .m2w-scrip-course-img-ph { font-size: 16px; }

.m2w-scrip-course-title {
  font-family: var(--m2w-serif);
  font-size: 13px; font-weight: 700; color: rgba(220,190,130,0.9);
  line-height: 1.4;
}

/* Progress bar */
.m2w-scrip-course-progress {
  height: 6px; border-radius: 3px;
  background: rgba(130,90,20,0.15);
  overflow: hidden;
}
.m2w-scrip-course-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #a07020, #c8a040);
  transition: width 0.6s ease;
}
.m2w-scrip-course--done .m2w-scrip-course-bar {
  background: linear-gradient(90deg, #408040, #60b060);
}

.m2w-scrip-course-pct {
  font-size: 10px; color: rgba(180,140,60,0.6);
  font-family: var(--m2w-serif); letter-spacing: 0.5px;
  margin-top: 2px;
}
.m2w-scrip-course--done .m2w-scrip-course-pct { color: rgba(80,160,80,0.8); }

/* Done badge */
.m2w-scrip-course-done-badge {
  position: absolute; top: 8px; right: 10px;
  font-size: 14px;
}

/* Browse card */
.m2w-scrip-browse-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 4px;
  background: rgba(20,14,6,0.5);
  border: 1px solid rgba(130,90,20,0.12);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.m2w-scrip-browse-item:hover {
  background: rgba(30,20,8,0.7);
  border-color: rgba(130,90,20,0.3);
}
.m2w-scrip-browse-title {
  font-family: var(--m2w-serif);
  font-size: 12px; font-weight: 600; color: rgba(200,170,120,0.8);
  line-height: 1.4; flex: 1; min-width: 0;
}

/* Footer with open-in-new-tab link */
.m2w-scrip-board-footer {
  flex-shrink: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(130,80,20,0.12);
  text-align: center;
}
.m2w-scrip-board-open {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--m2w-serif); font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: #c8a040; text-decoration: none;
  padding: 6px 16px; border-radius: 4px;
  border: 1px solid rgba(130,90,20,0.3);
  background: rgba(130,90,20,0.08);
  transition: all 0.2s;
}
.m2w-scrip-board-open:hover {
  background: rgba(130,90,20,0.2);
  border-color: rgba(180,130,40,0.5);
  color: #e8c050;
}

/* ── Book hover tooltip ────────────────────────────────────────────── */
.m2w-book-tooltip {
  position: absolute; z-index: 60;
  width: 210px;
  transform: translate(-50%, calc(-100% - 18px));
  background: linear-gradient(160deg, #1a1208 0%, #110d06 100%);
  border: 1px solid #7a5810;
  border-radius: 6px;
  padding: 13px 15px 11px;
  box-shadow:
    0 0 22px rgba(180,130,30,0.14),
    0 10px 36px rgba(0,0,0,0.65),
    inset 0 0 40px rgba(90,55,8,0.06);
  pointer-events: auto;
  transition: opacity 0.18s ease;
}
/* Arrow pointing down from tooltip */
.m2w-book-tooltip::after {
  content: '';
  position: absolute; bottom: -8px; left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #7a5810;
  border-bottom: 0;
}
.m2w-book-tooltip--hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.m2w-btip-orn {
  font-size: 7px; letter-spacing: 4px; color: rgba(160,110,30,0.45);
  text-align: center; margin-bottom: 8px;
}
.m2w-btip-title {
  font-family: var(--m2w-serif); font-size: 13px; font-weight: 700;
  color: #e8c060; line-height: 1.3; margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(232,192,80,0.2);
}
.m2w-btip-status {
  font-family: var(--m2w-sans); font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 9px;
}
.m2w-btip-status--done     { color: #c8941a; }
.m2w-btip-status--progress { color: #e07830; }
.m2w-btip-status--locked   { color: rgba(120,80,40,0.5); }
.m2w-btip-step {
  font-family: var(--m2w-sans); font-size: 8px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(180,130,50,0.5); margin-bottom: 3px;
}
.m2w-btip-sub {
  font-family: var(--m2w-serif); font-size: 10px; font-style: italic;
  color: rgba(160,120,50,0.5); line-height: 1.3; margin-bottom: 6px;
}

.m2w-btip-prog {
  height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px;
  overflow: hidden; margin-bottom: 10px;
}
.m2w-btip-prog-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #c8941a, #e0b030);
  transition: width 0.3s ease;
}

.m2w-btip-cta {
  display: inline-block;
  font-family: var(--m2w-sans); font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 3px;
  text-decoration: none;
  transition: all 0.15s;
}
.m2w-btip-cta--done {
  background: rgba(200,148,26,0.15); border: 1px solid rgba(200,148,26,0.4);
  color: #c8941a;
}
.m2w-btip-cta--done:hover {
  background: rgba(200,148,26,0.28); color: #ffe080; border-color: rgba(200,148,26,0.7);
}
.m2w-btip-cta--progress {
  background: rgba(200,110,30,0.15); border: 1px solid rgba(200,110,30,0.4);
  color: #e07830;
}
.m2w-btip-cta--progress:hover {
  background: rgba(200,110,30,0.28); color: #ffb060; border-color: rgba(200,110,30,0.7);
}
.m2w-btip-cta--locked {
  background: rgba(80,50,15,0.12); border: 1px solid rgba(80,50,15,0.3);
  color: rgba(140,100,50,0.5);
}
.m2w-btip-cta--locked:hover {
  background: rgba(80,50,15,0.22); color: rgba(180,130,50,0.7);
}
.m2w-btip-cta--disabled {
  background: rgba(80,60,20,0.08); border: 1px solid rgba(80,60,20,0.2);
  color: rgba(120,90,30,0.4); cursor: default;
}

/* ── Librarian NPC speech bubble ─────────────────────────────────────────── */
.m2w-librarian-bubble {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.34,1.2,.64,1);
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.9));
}
.m2w-librarian-bubble--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 20px));
}
.m2w-librarian-bubble__inner {
  background: linear-gradient(150deg, #12081e 0%, #221440 100%);
  border: 1.5px solid rgba(140,110,200,0.5);
  border-radius: 10px;
  padding: 12px 18px 13px;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.6),
    0 6px 28px rgba(0,0,0,0.85),
    0 0 22px rgba(120,80,200,0.15),
    inset 0 1px 0 rgba(180,140,240,0.08);
  position: relative;
  max-width: 340px;
  text-align: center;
}
/* tail */
.m2w-librarian-bubble__inner::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: rgba(140,110,200,0.5);
  border-bottom: none;
}
.m2w-librarian-bubble__inner::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #221440;
  border-bottom: none;
  z-index: 1;
}
.m2w-librarian-bubble__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: #d0c0f0;
  letter-spacing: .03em;
  line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 14px rgba(160,120,240,0.2);
}

/* ── Spellbook easter-egg modal ──────────────────────────────────────────── */
.m2w-spellbook-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(4,2,0,0.82); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  pointer-events: auto;
}
.m2w-spellbook--visible { display: flex; }
.m2w-spellbook-modal {
  background: radial-gradient(ellipse at 50% 30%, #1e140c 0%, #0e0804 100%);
  border: 2px solid #6a4820; border-radius: 12px;
  padding: 32px 36px 28px; max-width: 420px; width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(180,100,20,0.25), inset 0 0 40px rgba(0,0,0,0.5);
  animation: m2w-sbIn .35s ease-out;
}
@keyframes m2w-sbIn {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.m2w-spellbook-img {
  width: 120px; height: auto; margin-bottom: 18px;
  filter: drop-shadow(0 0 18px rgba(160,80,220,0.5));
  animation: m2w-sbFloat 3s ease-in-out infinite;
}
@keyframes m2w-sbFloat {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%     { transform: translateY(-6px) rotate(1deg); }
}
.m2w-spellbook-title {
  color: #d4a040; font-size: 18px; letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(200,120,30,0.6);
  margin-bottom: 8px; font-weight: normal;
  font-family: var(--m2w-serif, Georgia, serif);
}
.m2w-spellbook-text {
  color: #b09060; font-size: 14px; line-height: 1.5; margin-bottom: 24px;
  font-family: var(--m2w-serif, Georgia, serif);
}
.m2w-sb-btn {
  display: inline-block; padding: 10px 28px; margin: 0 8px;
  border: 1.5px solid; border-radius: 6px; cursor: pointer;
  font-family: var(--m2w-serif, Georgia, serif); font-size: 14px; letter-spacing: 1px;
  transition: all .2s; background: none;
}
.m2w-sb-btn--yes {
  background: rgba(90,40,10,0.5); border-color: #a06820; color: #e0b860;
}
.m2w-sb-btn--yes:hover { background: rgba(140,70,20,0.6); box-shadow: 0 0 16px rgba(200,120,30,0.4); }
.m2w-sb-btn--no {
  background: rgba(30,20,14,0.5); border-color: #4a3820; color: #8a7050;
}
.m2w-sb-btn--no:hover { background: rgba(50,30,18,0.6); }

/* ── Manuscript reader overlay ───────────────────────────────────────────── */
.m2w-manuscript-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(4,2,0,0.86); backdrop-filter: blur(5px);
  align-items: center; justify-content: center;
  pointer-events: auto;
}
.m2w-manuscript--visible { display: flex; }
.m2w-manuscript-modal {
  position: relative;
  background: radial-gradient(ellipse at 50% 20%, #1e160c 0%, #0c0804 100%);
  border: 2px solid rgba(160,120,50,0.5);
  border-radius: 12px;
  padding: 32px 28px 28px;
  max-width: 520px; width: 92%;
  max-height: 82vh;
  box-shadow: 0 0 80px rgba(160,100,20,0.18), inset 0 0 50px rgba(0,0,0,0.5);
  animation: m2w-msIn .4s ease-out;
}
@keyframes m2w-msIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.m2w-manuscript-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: #8a7050; font-size: 22px; line-height: 1;
  transition: color 0.2s;
}
.m2w-manuscript-close:hover { color: #f0d060; }
.m2w-manuscript-scroll {
  max-height: 70vh; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(160,120,50,0.3) transparent;
}
.m2w-manuscript-body {
  font-family: var(--m2w-serif, Georgia, serif);
  color: #c8b890; font-size: 11.2px; line-height: 1.7;
  letter-spacing: 0.2px;
}
.m2w-manuscript-body p {
  margin: 0 0 14px; text-indent: 1.5em;
}
.m2w-manuscript-body p:first-child { text-indent: 0; }
.m2w-manuscript-body .m2w-ms-salutation {
  text-indent: 0; font-style: italic; color: #a09070;
}
.m2w-manuscript-body .m2w-ms-sign {
  text-indent: 0; text-align: right; margin-top: 20px;
  font-style: italic; color: #d4a040;
  letter-spacing: 1px;
}
.m2w-manuscript-body .m2w-ms-date {
  text-indent: 0; text-align: right;
  font-size: 11px; color: #7a6040;
  font-style: italic; letter-spacing: 1px;
}
.m2w-manuscript-body .m2w-ms-postscript {
  text-indent: 0; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid rgba(160,120,50,0.2);
  font-size: 12px; color: #a08060;
  font-style: italic; letter-spacing: 0.5px;
}

/* Inventory item — readable (clickable) */
.m2w-inv-item--readable { cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.m2w-inv-item--readable:hover {
  border-color: rgba(180,140,50,0.4);
  background: rgba(120,90,30,0.15);
}

/* ── Notice Board overlay ─────────────────────────────────────────────────── */
.m2w-noticeboard-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,5,2,0.80); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  pointer-events: auto;
}
.m2w-noticeboard--visible { display: flex; }
.m2w-noticeboard-modal {
  position: relative;
  background: radial-gradient(ellipse at 50% 10%, #e8d4a0 0%, #c9b47a 60%, #a8914e 100%);
  border: 3px solid #7a5c28;
  border-radius: 4px;
  padding: 28px 30px 30px;
  max-width: 480px; width: 92%;
  max-height: 80vh;
  box-shadow:
    0 0 0 6px rgba(90,60,20,0.25),
    0 8px 40px rgba(0,0,0,0.6),
    inset 0 0 30px rgba(120,80,20,0.12);
  animation: m2w-nbIn .35s ease-out;
}
@keyframes m2w-nbIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
.m2w-noticeboard-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: #6a4a18; font-size: 20px; line-height: 1;
  transition: color 0.15s;
}
.m2w-noticeboard-close:hover { color: #2a1a04; }
.m2w-noticeboard-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(100,70,20,0.35);
  padding-bottom: 12px;
}
.m2w-noticeboard-pin {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d44, #820);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.m2w-noticeboard-title {
  margin: 0;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 15px; font-weight: bold; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #3a2408;
}
.m2w-noticeboard-scroll {
  max-height: 58vh; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,70,20,0.35) transparent;
}
.m2w-noticeboard-body {
  font-family: var(--m2w-serif, Georgia, serif);
  color: #2e1c06; font-size: 13px; line-height: 1.75;
  letter-spacing: 0.15px;
}
.m2w-noticeboard-body p {
  margin: 0 0 12px;
}
.m2w-noticeboard-body h3 {
  margin: 0 0 10px;
  font-size: 14px; font-weight: bold;
  color: #1e0e02; letter-spacing: 0.5px;
}
.m2w-noticeboard-body em {
  color: #5a3a10; font-style: italic;
}
.m2w-noticeboard-body .m2w-nb-divider {
  border: none; border-top: 1px solid rgba(100,70,20,0.3);
  margin: 14px 0;
}
.m2w-noticeboard-body .m2w-nb-sig {
  text-align: right; font-style: italic;
  color: #4a2c0a; font-size: 12px; margin-top: 8px;
}

/* ── Wish Fountain overlay ───────────────────────────────────────────────── */
.m2w-wish-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,4,12,0.82); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  pointer-events: auto;
}
.m2w-wish--visible { display: flex; }
.m2w-wish-modal {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(60,100,180,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(20,60,120,0.3) 0%, transparent 50%),
    linear-gradient(175deg, #0c1a2e 0%, #0a1420 40%, #060d18 100%);
  border: 1.5px solid rgba(100,160,255,0.35);
  border-radius: 14px;
  padding: 0;
  max-width: 420px; width: 92%;
  box-shadow:
    0 0 60px rgba(60,120,220,0.18),
    0 0 0 1px rgba(80,140,255,0.08),
    0 12px 48px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(140,180,255,0.1);
  animation: m2w-wishIn .45s cubic-bezier(.23,1,.32,1);
  overflow: hidden;
}
@keyframes m2w-wishIn {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}
.m2w-wish-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: rgba(140,180,255,0.5); font-size: 22px; line-height: 1;
  transition: color 0.2s; z-index: 2;
}
.m2w-wish-close:hover { color: #8cc8ff; }

/* Water shimmer header */
.m2w-wish-header {
  position: relative;
  text-align: center;
  padding: 28px 24px 20px;
  overflow: hidden;
}
.m2w-wish-header::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,100,180,0.12) 0%, transparent 100%);
  pointer-events: none;
}
.m2w-wish-header::after {
  content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100,160,255,0.4), transparent);
}
.m2w-wish-icon {
  font-size: 36px;
  display: block; margin-bottom: 6px;
  filter: drop-shadow(0 0 12px rgba(80,160,255,0.5));
  animation: m2w-wishFloat 3s ease-in-out infinite;
}
@keyframes m2w-wishFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.m2w-wish-title {
  margin: 0;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 18px; font-weight: bold;
  color: #c0d8ff;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(80,140,255,0.3);
}
.m2w-wish-subtitle {
  margin: 6px 0 0;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 11px; color: rgba(140,170,220,0.6);
  font-style: italic; letter-spacing: 0.5px;
}

/* Wish body */
.m2w-wish-body {
  padding: 20px 24px 24px;
}

/* Wish category cards */
.m2w-wish-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.m2w-wish-cat {
  position: relative;
  background: rgba(20,40,70,0.6);
  border: 1px solid rgba(80,130,200,0.15);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  overflow: hidden;
}
.m2w-wish-cat::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(80,140,255,0.08), transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.m2w-wish-cat:hover {
  border-color: rgba(100,160,255,0.4);
  background: rgba(25,50,85,0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(60,120,220,0.15);
}
.m2w-wish-cat:hover::before { opacity: 1; }
.m2w-wish-cat--selected {
  border-color: rgba(100,180,255,0.6) !important;
  background: rgba(30,60,100,0.8) !important;
  box-shadow: 0 0 24px rgba(60,140,255,0.2), inset 0 0 20px rgba(60,120,220,0.08) !important;
}
.m2w-wish-cat__icon {
  font-size: 24px; display: block; margin-bottom: 6px;
  position: relative; z-index: 1;
}
.m2w-wish-cat__label {
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 11px; color: #8aa8d0;
  letter-spacing: 0.5px; position: relative; z-index: 1;
  transition: color 0.2s;
}
.m2w-wish-cat--selected .m2w-wish-cat__label { color: #c0d8ff; }

/* Text input */
.m2w-wish-input-wrap {
  position: relative; margin-bottom: 16px;
}
.m2w-wish-input {
  width: 100%; box-sizing: border-box;
  background: rgba(10,20,40,0.7);
  border: 1px solid rgba(80,130,200,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  color: #b0c8e8;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 13px; line-height: 1.5;
  resize: none; height: 64px;
  transition: border-color 0.2s;
  outline: none;
}
.m2w-wish-input::placeholder { color: rgba(120,150,190,0.4); font-style: italic; }
.m2w-wish-input:focus { border-color: rgba(100,160,255,0.45); }
.m2w-wish-charlimit {
  position: absolute; bottom: 6px; right: 10px;
  font-size: 9px; color: rgba(120,150,190,0.3);
  font-family: var(--m2w-serif, Georgia, serif);
}

/* Toss coin button */
.m2w-wish-toss {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, rgba(40,80,140,0.7), rgba(30,60,120,0.8));
  border: 1px solid rgba(100,160,255,0.3);
  border-radius: 10px;
  padding: 13px 20px;
  color: #c0d8ff;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 14px; font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.m2w-wish-toss::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s;
}
.m2w-wish-toss:hover::before { left: 150%; }
.m2w-wish-toss:hover {
  background: linear-gradient(135deg, rgba(50,95,160,0.8), rgba(40,75,140,0.9));
  border-color: rgba(120,180,255,0.5);
  box-shadow: 0 0 30px rgba(60,120,220,0.2);
  transform: translateY(-1px);
}
.m2w-wish-toss:disabled {
  opacity: 0.4; cursor: default; transform: none;
}
.m2w-wish-toss:disabled:hover { background: linear-gradient(135deg, rgba(40,80,140,0.7), rgba(30,60,120,0.8)); border-color: rgba(100,160,255,0.3); box-shadow: none; }
.m2w-wish-toss:disabled::before { display: none; }
.m2w-wish-toss__coin {
  display: inline-block; font-size: 18px;
  transition: transform 0.3s;
}
.m2w-wish-toss:hover .m2w-wish-toss__coin { transform: rotateY(180deg); }

/* Coin animation (in-flight) */
.m2w-wish-coin-flight {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 10;
}
.m2w-wish-coin-flight__coin {
  font-size: 42px;
  animation: m2w-coinToss 1.6s cubic-bezier(.2,.8,.3,1) forwards;
  filter: drop-shadow(0 0 16px rgba(255,200,60,0.6));
}
@keyframes m2w-coinToss {
  0%   { transform: translateY(0)    rotateY(0)      scale(1);   opacity: 1; }
  30%  { transform: translateY(-80px) rotateY(540deg) scale(1.3); opacity: 1; }
  60%  { transform: translateY(-40px) rotateY(900deg) scale(1.1); opacity: 1; }
  100% { transform: translateY(60px)  rotateY(1260deg) scale(0.3); opacity: 0; }
}

/* Sparkle burst after coin lands */
.m2w-wish-sparkles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 11;
  overflow: hidden;
}
.m2w-wish-sparkle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(100,180,255,0.8));
  box-shadow: 0 0 6px rgba(100,180,255,0.6);
  animation: m2w-sparkleBurst 1.2s ease-out forwards;
}
@keyframes m2w-sparkleBurst {
  0%   { transform: translate(0,0) scale(0); opacity: 1; }
  20%  { transform: translate(var(--sx), var(--sy)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--sx) * 2.5), calc(var(--sy) * 2.5)) scale(0); opacity: 0; }
}

/* Success state */
.m2w-wish-granted {
  text-align: center; padding: 30px 20px;
  animation: m2w-grantedIn 0.5s ease-out;
}
@keyframes m2w-grantedIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.m2w-wish-granted__star {
  font-size: 48px; display: block; margin-bottom: 10px;
  filter: drop-shadow(0 0 20px rgba(100,180,255,0.5));
  animation: m2w-starPulse 2s ease-in-out infinite;
}
@keyframes m2w-starPulse {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(100,180,255,0.5)); }
  50%     { transform: scale(1.1); filter: drop-shadow(0 0 30px rgba(100,200,255,0.7)); }
}
.m2w-wish-granted__text {
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 16px; color: #c0d8ff;
  letter-spacing: 1px; margin-bottom: 6px;
}
.m2w-wish-granted__sub {
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 11px; color: rgba(140,170,220,0.5);
  font-style: italic;
}

/* Wish log (past wishes) */
.m2w-wish-log {
  margin-top: 16px;
  border-top: 1px solid rgba(80,130,200,0.15);
  padding-top: 12px;
}
.m2w-wish-log__title {
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 10px; color: rgba(120,150,190,0.4);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.m2w-wish-log__list {
  list-style: none; margin: 0; padding: 0;
  max-height: 90px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(80,130,200,0.2) transparent;
}
.m2w-wish-log__item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 0;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 11px; color: rgba(160,185,220,0.5);
  border-bottom: 1px solid rgba(80,130,200,0.06);
}
.m2w-wish-log__item:last-child { border-bottom: none; }
.m2w-wish-log__icon { flex-shrink: 0; font-size: 12px; }
.m2w-wish-log__text { flex: 1; font-style: italic; }
.m2w-wish-log__date { font-size: 9px; color: rgba(120,150,190,0.3); white-space: nowrap; }

/* Daily limit notice */
.m2w-wish-cooldown {
  text-align: center; padding: 8px;
  font-family: var(--m2w-serif, Georgia, serif);
  font-size: 11px; color: rgba(140,170,220,0.45);
  font-style: italic;
}

/* ── Zoom control ────────────────────────────────────────────────────────── */
.m2w-zoom-ctrl {
  position: absolute;
  right: 12px;
  bottom: 80px;   /* sits right above the toolbar */
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: all;
  transition: opacity 0.3s ease;
}
.m2w-zoom-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--m2w-bg, rgba(14,10,4,0.82));
  border: 1px solid rgba(168,120,50,0.28);
  border-radius: 5px;
  color: rgba(200,160,70,0.8);
  font-size: 15px; font-weight: 700;
  line-height: 1; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}
.m2w-zoom-btn:hover {
  background: rgba(168,120,50,0.2);
  color: #ffd580;
}
.m2w-zoom-hint {
  font-family: var(--m2w-serif);
  font-size: 8px; letter-spacing: 0.5px;
  color: rgba(200,160,70,0.0);
  transition: color 0.25s ease;
  line-height: 1; padding: 1px 0;
  user-select: none; pointer-events: none;
}
.m2w-zoom-hint--visible {
  color: rgba(200,160,70,0.7);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM TOOLBAR  –  tavern-shelf action bar
   All buttons are circular medals set into the dark oak plank.
   Guild medallion is the identity anchor — slightly larger, gold-ringed.
═══════════════════════════════════════════════════════════════════════════ */

.m2w-toolbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  z-index: 57;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  background:
    radial-gradient(ellipse 40% 180% at 50% 140%, rgba(200,130,20,0.18) 0%, transparent 55%),
    repeating-linear-gradient(
      1.8deg,
      transparent 0px, transparent 5px,
      rgba(255,190,70,0.014) 5px, rgba(255,190,70,0.014) 6px
    ),
    linear-gradient(180deg,
      #201308 0%,
      #160d05 30%,
      #110a03 60%,
      #0a0602 100%);
  border-top: none;
  box-shadow:
    0 -8px 40px rgba(0,0,0,0.85),
    0 -2px 16px rgba(140,80,10,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: all;
  transition: opacity 0.2s ease;
}
/* ── Gold filigree top edge — double line ─────────────────────────────── */
.m2w-toolbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(160,110,30,0.20) 5%,
    rgba(220,165,50,0.65) 20%,
    rgba(255,210,80,1) 50%,
    rgba(220,165,50,0.65) 80%,
    rgba(160,110,30,0.20) 95%,
    transparent 100%);
  pointer-events: none;
}
/* ── Second gold hairline (warm underlap) ─────────────────────────────── */
.m2w-toolbar::after {
  content: '';
  position: absolute;
  top: 2px; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(200,148,26,0.12) 20%,
    rgba(200,148,26,0.28) 50%,
    rgba(200,148,26,0.12) 80%,
    transparent);
  pointer-events: none;
}

/* ── Travelling shimmer across top edge ───────────────────────────────── */
.m2w-tb-shimmer {
  position: absolute; top: -1px; left: 0; right: 0; height: 3px;
  overflow: hidden; pointer-events: none; z-index: 1;
}
.m2w-tb-shimmer::before {
  content: '';
  position: absolute; top: 0; left: -40%; width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,210,80,0.7), transparent);
  animation: m2w-tb-shimmer-travel 8s ease-in-out infinite;
}
@keyframes m2w-tb-shimmer-travel {
  0%   { left: -30%; }
  100% { left: 130%; }
}

/* ── Warm ambient glow — breathing ────────────────────────────────────── */
.m2w-tb-glow {
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 24px;
  background: radial-gradient(ellipse 70% 100% at 50% 0%,
    rgba(220,160,40,0.10) 0%,
    transparent 100%);
  pointer-events: none;
  animation: m2w-tb-glow-breathe 5s ease-in-out infinite;
}
@keyframes m2w-tb-glow-breathe {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

.m2w-toolbar--behind-menu {
  opacity: 0;
  pointer-events: none;
}
.m2w-toolbar--loading {
  opacity: 0;
  pointer-events: none;
}
.m2w-zoom-ctrl--loading {
  opacity: 0;
  pointer-events: none;
}

/* ── Ornamental divider between guild seal and action coins ────────────── */
.m2w-tb-divider {
  width: 1px;
  height: 36px;
  flex-shrink: 0;
  margin: 0 6px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(200,148,40,0.15) 15%,
    rgba(200,148,40,0.5) 50%,
    rgba(200,148,40,0.15) 85%,
    transparent 100%);
  box-shadow: 0 0 4px rgba(200,148,40,0.12);
}

/* ── Circular coin (all buttons) ────────────────────────────────────────── */
.m2w-tb-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 32%, rgba(60,40,12,0.5) 0%, transparent 70%),
    linear-gradient(160deg, #1e1308 0%, #110a04 60%, #0a0602 100%);
  border: 1.5px solid rgba(160,110,30,0.38);
  box-shadow:
    inset 0 1px 0  rgba(255,210,90,0.10),
    inset 0 2px 6px rgba(0,0,0,0.5),
    inset 0 -1px 2px rgba(0,0,0,0.5),
    0 2px 8px rgba(0,0,0,0.55),
    0 0 0 0.5px rgba(80,50,10,0.4);
  color: rgba(210,160,60,0.82);
  font-size: 19px;
  cursor: pointer;
  font-family: var(--m2w-sans);
  user-select: none;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.28s, transform 0.12s ease-out;
}
.m2w-tb-btn:hover {
  color: #ffe698;
  border-color: rgba(220,165,40,0.65);
  background:
    radial-gradient(circle at 40% 32%, rgba(80,55,15,0.6) 0%, transparent 70%),
    linear-gradient(160deg, #2a1a0a 0%, #180f05 60%, #0e0802 100%);
  box-shadow:
    inset 0 1px 0  rgba(255,210,90,0.15),
    inset 0 2px 6px rgba(0,0,0,0.4),
    0 0 16px rgba(200,130,20,0.30),
    0 0 6px  rgba(220,160,40,0.18),
    0 2px 8px rgba(0,0,0,0.5),
    0 0 0 0.5px rgba(120,80,15,0.5);
  transform: translateY(-2px);
}
.m2w-tb-btn:active {
  transform: translateY(0);
  transition-duration: 0.04s;
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(0,0,0,0.3),
    0 1px 3px rgba(0,0,0,0.5);
}

/* Shortcut toast — JS-positioned floating tooltip
   JS sets top/left so the toast sits above the hovered button, centred. */
.m2w-shortcut-toast {
  position: fixed;
  z-index: 9999;
  white-space: nowrap;
  font-family: var(--m2w-serif, 'Cinzel', serif);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--m2w-gold-lt, #e8b840);
  background:
    linear-gradient(180deg, rgba(30,20,8,0.94) 0%, rgba(16,10,4,0.97) 100%);
  border: 1px solid rgba(180,120,30,0.45);
  border-radius: 6px;
  padding: 5px 11px;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.6),
    0 0 8px rgba(160,110,20,0.12),
    inset 0 1px 0 rgba(255,210,90,0.08);
  pointer-events: none;
  opacity: 0;
  translate: -50% calc(-100% + 4px);
  transition: opacity 0.22s ease, translate 0.22s ease;
}
.m2w-shortcut-toast--show {
  opacity: 1;
  translate: -50% -100%;
}
/* tiny arrow pointing down */
.m2w-shortcut-toast::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(180,120,30,0.45);
}

.m2w-tb-icon {
  display: block;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.m2w-tb-lbl {
  font-family: var(--m2w-serif);
  font-size: 7px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.52;
  line-height: 1;
  transition: opacity 0.18s;
}
.m2w-tb-btn:hover .m2w-tb-lbl {
  opacity: 0.85;
}

/* ── Guild medallion — identity anchor, slightly larger ────────────────────
   JS sets textContent directly → no child spans; labels via CSS only.
────────────────────────────────────────────────────────────────────────── */
.m2w-tb-btn--guild {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(200,148,26,0.48);
  font-size: 26px;
  line-height: 1;
  background:
    radial-gradient(circle at 38% 30%, rgba(80,55,15,0.45) 0%, transparent 65%),
    radial-gradient(circle at 60% 70%, rgba(40,25,5,0.6) 0%, transparent 60%),
    linear-gradient(155deg, #2a1a08 0%, #1a1004 40%, #0d0802 100%);
  box-shadow:
    0 0 0 1px rgba(100,65,10,0.5),
    0 0 0 3px rgba(40,25,8,0.6),
    0 0 0 4px rgba(140,95,20,0.20),
    0 4px 18px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,210,90,0.14),
    inset 0 -2px 8px rgba(0,0,0,0.55);
  padding-bottom: 14px;
  gap: 0;
}
.m2w-tb-btn--guild::after {
  content: 'GUILD';
  position: absolute;
  bottom: 9px; left: 0; right: 0;
  font-family: var(--m2w-serif);
  font-size: 6.5px;
  letter-spacing: 1.8px;
  text-align: center;
  color: rgba(200,148,26,0.58);
  line-height: 1;
  pointer-events: none;
  transition: color 0.18s;
}
.m2w-tb-btn--guild:hover::after {
  color: rgba(240,190,50,0.8);
}
.m2w-tb-btn--guild:hover {
  border-color: rgba(230,180,50,0.72);
  background:
    radial-gradient(circle at 38% 30%, rgba(100,70,18,0.55) 0%, transparent 65%),
    radial-gradient(circle at 60% 70%, rgba(50,30,8,0.6) 0%, transparent 60%),
    linear-gradient(155deg, #352010 0%, #201408 40%, #100a04 100%);
  box-shadow:
    0 0 0 1px rgba(180,120,25,0.6),
    0 0 0 3px rgba(50,30,8,0.6),
    0 0 0 4px rgba(160,110,25,0.25),
    0 0 22px rgba(200,130,20,0.35),
    0 4px 18px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,210,90,0.20),
    inset 0 -2px 8px rgba(0,0,0,0.55);
  transform: translateY(-2px);
}

/* ── Emote coin — slightly wider to seat the kaomoji ───────────────────── */
.m2w-tb-btn--emote {
  width: 64px;
  height: 52px;
  border-radius: 26px; /* pill — kaomoji needs the width */
}
.m2w-tb-btn--emote .m2w-tb-icon {
  font-size: 11px;
  filter: none;
}

/* Push controls-hint above toolbar */
.m2w-controls-hint { bottom: 80px !important; }

/* Push emote wheel above toolbar */
.m2w-emote-wheel { bottom: 126px !important; }

/* ── Player card popup ─────────────────────────────────────────────── */
.m2w-player-card {
  position: absolute;
  z-index: 80;
  min-width: 140px;
  padding: 10px 14px;
  background: rgba(16,10,4,0.92);
  border: 1px solid rgba(130,90,20,0.35);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 16px rgba(200,130,30,0.1);
  font-family: var(--m2w-serif);
  transform: translate(-50%, 0);
  pointer-events: all;
  animation: m2w-pcard-in 0.2s ease;
}
.m2w-player-card--hidden { display: none; }
.m2w-pcard-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.m2w-pcard-icon { font-size: 18px; line-height: 1; }
.m2w-pcard-name {
  font-size: 13px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(220,170,80,0.9);
  text-shadow: 0 0 10px rgba(200,130,30,0.3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m2w-pcard-class {
  font-size: 9px; letter-spacing: 1px;
  color: rgba(180,130,50,0.6);
  margin-bottom: 4px;
}
.m2w-pcard-streak {
  font-size: 9px; letter-spacing: 1px;
  color: rgba(180,130,50,0.5);
  margin-bottom: 8px;
}
.m2w-pcard-streak:empty { display: none; }
@keyframes m2w-pcard-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Make player labels clickable */
.m2w-player-label { cursor: pointer; pointer-events: all; }
.m2w-player-label:hover { color: rgba(220,170,80,0.95); text-shadow: 0 0 8px rgba(200,130,30,0.5); }

/* ═══════════════════════════════════════════════════════════════════════════
   MARC'S DEN INTERIOR OVERLAY
═══════════════════════════════════════════════════════════════════════════ */
.m2w-marcden {
  position: absolute; inset: 0;
  z-index: 57;
  pointer-events: none; /* pass mouse events through to canvas for raycasting (secret book) */
  user-select: none;
}
.m2w-marcden--hidden { display: none; }

.m2w-marcden-veil {
  position: absolute; inset: 0; z-index: 1;
  background: #0a0602; opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.m2w-marcden-veil--dark { opacity: 1; }

.m2w-marcden-ui {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
}
/* Warm amber light leak from top */
.m2w-marcden-ui::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 180px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(200,120,40,0.05) 0%, transparent 100%);
}

/* ── Header — cathedral arch with copper filigree ─────────────────────── */
.m2w-marcden-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 72px;
  pointer-events: auto;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg,
      rgba(12,7,2,0.98) 0%,
      rgba(16,9,3,0.92) 40%,
      rgba(16,9,3,0.65) 70%,
      transparent 100%);
}
/* Double-line glow bottom edge */
.m2w-marcden-header::before {
  content: '';
  position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(160,90,20,0.15) 10%, rgba(160,90,20,0.5) 30%,
    rgba(220,150,50,0.7) 50%, rgba(160,90,20,0.5) 70%, rgba(160,90,20,0.15) 90%, transparent);
}
.m2w-marcden-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(200,130,30,0.08) 20%, rgba(200,130,30,0.28) 50%, rgba(200,130,30,0.08) 80%, transparent);
}

/* Travelling shimmer */
.m2w-marcden-header-shimmer {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
  overflow: hidden; pointer-events: none;
}
.m2w-marcden-header-shimmer::before {
  content: '';
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220,150,60,0.75), transparent);
  animation: m2w-marcden-shimmer-travel 8s ease-in-out infinite;
}
@keyframes m2w-marcden-shimmer-travel {
  0%   { left: -40%; }
  100% { left: 140%; }
}

/* ── Exit button ──────────────────────────────────────────────────────── */
.m2w-marcden-exit {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  background: rgba(140,80,20,0.08);
  border: 1px solid rgba(140,80,20,0.25);
  border-radius: 6px;
  color: rgba(210,150,60,0.75);
  font-family: var(--m2w-serif);
  font-size: 11px; font-weight: 600;
  padding: 7px 16px 7px 12px;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  display: flex; align-items: center; gap: 6px;
  pointer-events: all;
}
.m2w-marcden-exit:hover {
  background: rgba(140,80,20,0.22);
  border-color: rgba(200,130,50,0.55);
  color: #fff;
  box-shadow: 0 0 16px rgba(200,140,50,0.15);
}
.m2w-marcden-exit-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}
.m2w-marcden-exit:hover .m2w-marcden-exit-arrow {
  transform: translateX(-3px);
}

/* ── Title cluster ────────────────────────────────────────────────────── */
.m2w-marcden-title-group {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m2w-marcden-title-row {
  display: flex; align-items: center; gap: 16px;
}
.m2w-marcden-filigree {
  display: flex; align-items: center; gap: 4px;
  color: rgba(190,120,40,0.60);
  font-size: 7px;
  letter-spacing: 3px;
  opacity: 0.75;
}
.m2w-marcden-filigree-diamond {
  font-size: 6px;
  animation: m2w-marcden-filigree-pulse 3s ease-in-out infinite;
}
.m2w-marcden-filigree-line {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190,120,40,0.60), transparent);
}
@keyframes m2w-marcden-filigree-pulse {
  0%,100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
.m2w-marcden-name {
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 15px; font-weight: 700;
  color: #c87830; letter-spacing: 6px; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(200,120,40,0.45), 0 0 50px rgba(180,90,20,0.18);
  animation: m2w-marcden-title-glow 4s ease-in-out infinite;
}
@keyframes m2w-marcden-title-glow {
  0%,100% { text-shadow: 0 0 18px rgba(200,120,40,0.40), 0 0 38px rgba(180,90,20,0.14); color: #c87830; }
  50%      { text-shadow: 0 0 28px rgba(240,160,60,0.70), 0 0 58px rgba(210,120,40,0.30), 0 0 90px rgba(180,90,20,0.14); color: #e09848; }
}
.m2w-marcden-subtitle {
  font-family: var(--m2w-serif);
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(160,100,40,0.32);
  margin-top: 1px;
  font-style: italic;
}

/* ── Ambient CSS particles ────────────────────────────────────────────── */
.m2w-marcden-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 4; overflow: hidden;
}
.m2w-marcden-particle {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #c87830; opacity: 0;
  animation: m2w-marcden-particle-drift linear infinite;
}
@keyframes m2w-marcden-particle-drift {
  0%   { opacity: 0; transform: translateY(0) translateX(0); }
  15%  { opacity: 0.40; }
  85%  { opacity: 0.22; }
  100% { opacity: 0; transform: translateY(-120vh) translateX(25px); }
}
.m2w-marcden-particle:nth-child(1)  { left: 12%; bottom: 0%; animation-duration: 18s; animation-delay: 0s;    width: 2px; height: 2px; }
.m2w-marcden-particle:nth-child(2)  { left: 28%; bottom: 10%; animation-duration: 22s; animation-delay: 2.5s; width: 1px; height: 1px; background: #e0a050; }
.m2w-marcden-particle:nth-child(3)  { left: 44%; bottom: 5%;  animation-duration: 16s; animation-delay: 5s;   width: 2px; height: 2px; }
.m2w-marcden-particle:nth-child(4)  { left: 60%; bottom: 20%; animation-duration: 20s; animation-delay: 1s;   width: 1px; height: 1px; }
.m2w-marcden-particle:nth-child(5)  { left: 75%; bottom: 0%;  animation-duration: 24s; animation-delay: 3.5s; width: 2px; height: 2px; background: #d09040; }
.m2w-marcden-particle:nth-child(6)  { left: 88%; bottom: 15%; animation-duration: 17s; animation-delay: 7s;   width: 1px; height: 1px; }
.m2w-marcden-particle:nth-child(7)  { left: 20%; bottom: 30%; animation-duration: 21s; animation-delay: 9s;   width: 2px; height: 2px; background: #e0a050; }
.m2w-marcden-particle:nth-child(8)  { left: 55%; bottom: 8%;  animation-duration: 19s; animation-delay: 4s;   width: 1px; height: 1px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MEDITATION CHAMBER  –  hidden sub-interior beneath Marc's Den
   ═══════════════════════════════════════════════════════════════════════════ */
.m2w-meditation {
  position: absolute; inset: 0;
  z-index: 58;
  pointer-events: none;
  user-select: none;
}
.m2w-meditation--hidden { display: none; }
.m2w-meditation-veil {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(20,8,44,0.92), rgba(0,0,0,1));
  opacity: 0; pointer-events: none; z-index: 1;
  transition: opacity 0.7s ease;
}
.m2w-meditation-veil--dark { opacity: 1; }
.m2w-meditation-ui {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 2;
  display: flex; flex-direction: column;
}
.m2w-meditation-topbar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 16px 0;
  pointer-events: all;
  font-family: var(--m2w-serif);
  font-size: 11px; letter-spacing: 3px;
  color: rgba(200,140,255,0.72);
  text-shadow: 0 0 18px rgba(160,80,255,0.45);
}
.m2w-meditation-name {
  font-size: 15px; letter-spacing: 4px;
  color: rgba(220,170,255,0.95);
  text-shadow: 0 0 22px rgba(180,100,255,0.7);
}
.m2w-meditation-badge {
  font-size: 9px; color: rgba(180,110,230,0.75);
  text-shadow: 0 0 10px rgba(150,80,220,0.8);
}
.m2w-meditation-exit {
  background: rgba(60,20,110,0.25);
  border: 1px solid rgba(150,80,220,0.45);
  border-radius: 5px;
  color: rgba(210,160,255,0.85);
  padding: 6px 14px;
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  pointer-events: all;
  box-shadow: 0 0 16px rgba(120,60,200,0.25);
}
.m2w-meditation-exit:hover {
  background: rgba(110,50,180,0.45); color: #fff;
  border-color: rgba(220,150,255,0.7);
  box-shadow: 0 0 22px rgba(180,100,255,0.55);
}
.m2w-meditation-particles {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.m2w-meditation-mote {
  position: absolute; width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,160,255,0.95), rgba(150,80,220,0.2) 60%, transparent 70%);
  filter: blur(0.5px);
  animation: m2w-med-drift 14s linear infinite;
  opacity: 0;
}
.m2w-meditation-mote:nth-child(1) { left: 12%; top: 85%; animation-duration: 14s; animation-delay: 0s;  }
.m2w-meditation-mote:nth-child(2) { left: 28%; top: 90%; animation-duration: 11s; animation-delay: 2s; }
.m2w-meditation-mote:nth-child(3) { left: 48%; top: 95%; animation-duration: 16s; animation-delay: 4s; }
.m2w-meditation-mote:nth-child(4) { left: 66%; top: 88%; animation-duration: 13s; animation-delay: 1s; }
.m2w-meditation-mote:nth-child(5) { left: 82%; top: 92%; animation-duration: 15s; animation-delay: 3s; }
.m2w-meditation-mote:nth-child(6) { left: 20%; top: 80%; animation-duration: 17s; animation-delay: 6s; }
.m2w-meditation-mote:nth-child(7) { left: 58%; top: 82%; animation-duration: 12s; animation-delay: 5s; }
.m2w-meditation-mote:nth-child(8) { left: 75%; top: 84%; animation-duration: 18s; animation-delay: 7s; }
@keyframes m2w-med-drift {
  0%   { transform: translate(0, 0)     scale(0.6); opacity: 0; }
  10%  { opacity: 0.9; }
  50%  { transform: translate(-20px, -45vh) scale(1.2); opacity: 0.65; }
  90%  { opacity: 0.4; }
  100% { transform: translate( 10px, -90vh) scale(0.5); opacity: 0; }
}
.m2w-meditation-hint-sit {
  position: absolute;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%) translateY(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 3;
}
.m2w-meditation-hint-sit--on {
  opacity: 1; transform: translate(-50%, -50%) translateY(0);
}
.m2w-meditation-hint-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(36,12,72,0.92), rgba(16,4,36,0.95));
  border: 1px solid rgba(160,90,230,0.55);
  border-radius: 24px;
  font-family: var(--m2w-serif);
  font-size: 12px; letter-spacing: 2px;
  color: rgba(220,170,255,0.95);
  box-shadow: 0 0 28px rgba(140,70,220,0.45), inset 0 0 16px rgba(180,100,255,0.14);
}
.m2w-meditation-hint-glyph { color: rgba(220,160,255,0.7); font-size: 10px; }
.m2w-meditation-prog {
  position: relative;
  width: 120px; height: 5px;
  background: rgba(40,16,80,0.7);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(140,70,220,0.45);
}
.m2w-meditation-prog-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(160,80,220,0.9), rgba(255,140,255,1));
  box-shadow: 0 0 10px rgba(200,120,255,0.8);
  transition: width 0.25s linear;
}
.m2w-meditation-prog-label {
  font-size: 10px; letter-spacing: 1px;
  color: rgba(220,180,255,0.8);
  min-width: 56px; text-align: left;
}
.m2w-meditation-toast {
  position: absolute;
  left: 50%; top: 28%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0; pointer-events: none;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(60,20,120,0.96), rgba(30,8,72,0.98));
  border: 1.5px solid rgba(220,140,255,0.7);
  border-radius: 24px;
  font-family: var(--m2w-serif);
  font-size: 13px; letter-spacing: 2px;
  color: #fff;
  box-shadow: 0 0 38px rgba(180,90,255,0.6);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 4;
  display: flex; gap: 10px; align-items: center;
}
.m2w-meditation-toast-icon { font-size: 18px; }
.m2w-meditation-toast--on {
  opacity: 1; transform: translate(-50%, -50%) scale(1);
}
.m2w-meditation-bottom {
  position: absolute; bottom: 60px; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(0deg, rgba(12,4,30,0.94) 0%, rgba(12,4,30,0.55) 100%);
  border-top: 1px solid rgba(160,90,230,0.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 2px;
  color: rgba(210,160,255,0.75); gap: 8px;
  pointer-events: none;
}
.m2w-meditation-bottom-glyph { color: rgba(220,140,255,0.6); }
.m2w-meditation-bottom kbd {
  background: rgba(100,50,180,0.18); border: 1px solid rgba(150,80,220,0.35);
  border-radius: 2px; padding: 1px 5px;
  font-family: var(--m2w-sans); font-size: 9px; color: rgba(220,170,255,0.9);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Library Book Reader  –  Gospel of Philip pop-up
   ═══════════════════════════════════════════════════════════════════════════ */
.m2w-library-reader {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
}
.m2w-library-reader--open {
  opacity: 1; pointer-events: all;
}
/* All children inherit pointer-events from the reader so they are non-interactive
   when the reader is closed (pointer-events:none) and interactive when open (all).
   Without this, children with default pointer-events:auto remain hit-testable even
   through a pointer-events:none parent — the backdrop would intercept every tap. */
.m2w-library-reader * {
  pointer-events: inherit;
}
.m2w-library-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(4,2,0,0.88) 0%, rgba(0,0,0,0.96) 100%);
  cursor: pointer;
}
.m2w-library-book {
  position: relative;
  width: min(88vw, 540px); max-height: min(90vh, 780px);
  aspect-ratio: 3 / 4;
  perspective: 1200px;
  z-index: 1;
}
/* Page container – each page is a card */
.m2w-library-page {
  position: absolute; inset: 0;
  border-radius: 4px;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s ease;
  transform: translateX(100%) scale(0.92);
  opacity: 0;
  pointer-events: none;
}
.m2w-library-page--active {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.m2w-library-page--prev {
  transform: translateX(-100%) scale(0.92);
  opacity: 0;
}
/* Cover page */
.m2w-library-page--cover {
  background: #1a1610;
  display: flex; align-items: center; justify-content: center;
}
.m2w-library-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.m2w-library-cover-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  padding: 15%;
  text-align: center;
}
.m2w-library-cover-title {
  font-family: var(--m2w-serif);
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 700;
  color: #e8d8b0;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 0 40px rgba(120,80,20,0.3);
  letter-spacing: 3px;
}
.m2w-library-cover-sub {
  font-family: var(--m2w-serif);
  font-size: clamp(10px, 2vw, 13px);
  color: rgba(200,170,120,0.7);
  margin-top: 1.5em;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.m2w-library-cover-flourish {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,160,80,0.5), transparent);
  margin: 1.2em 0;
}
/* Inner pages — parchment aesthetic matching the Magic Syllables design */
.m2w-library-page--inner {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(190,175,140,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(160,140,100,0.08) 0%, transparent 50%),
    linear-gradient(135deg, #b8a882 0%, #c4b48e 20%, #baa87a 45%, #c2b08a 65%, #b09870 100%);
  border: 6px solid #1a2248;
  box-shadow:
    inset 0 0 30px rgba(80,60,30,0.25),
    inset 0 0 80px rgba(60,40,10,0.15),
    0 4px 30px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
  padding: clamp(18px, 4.5vw, 36px) clamp(22px, 5vw, 42px);
  overflow: hidden;
}
.m2w-library-page--inner::before {
  content: '';
  position: absolute; inset: 6px;
  border: 2px solid rgba(26,34,72,0.4);
  border-radius: 2px;
  pointer-events: none;
}
.m2w-library-page-num {
  position: absolute; bottom: clamp(10px, 3vw, 24px);
  left: 50%; transform: translateX(-50%);
  font-family: var(--m2w-serif);
  font-size: 11px; color: rgba(60,45,20,0.5);
  letter-spacing: 3px;
}
.m2w-library-verse {
  font-family: var(--m2w-serif);
  font-size: clamp(9px, 2vw, 12px);
  line-height: 1.6;
  color: #1a1208;
  margin-bottom: 1em;
  text-align: justify;
  hyphens: auto;
  text-indent: 1.5em;
}
.m2w-library-verse:first-child {
  text-indent: 0;
}
.m2w-library-verse--heading {
  text-align: center;
  text-indent: 0;
  font-weight: 600;
  font-size: clamp(11px, 2.2vw, 14px);
  color: #1a2248;
  margin-bottom: 0.4em;
  letter-spacing: 2px;
}
.m2w-library-verse--ref {
  text-align: center;
  text-indent: 0;
  font-size: clamp(7px, 1.4vw, 9px);
  color: rgba(60,45,20,0.45);
  letter-spacing: 3px;
  margin-top: -0.3em;
  margin-bottom: 1.2em;
  font-style: italic;
}
.m2w-library-divider {
  width: 40%; height: 1px; margin: 0.5em auto 0.8em;
  background: linear-gradient(90deg, transparent, rgba(60,45,20,0.3), transparent);
}
/* Navigation */
.m2w-library-nav {
  position: absolute;
  bottom: -50px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px;
  z-index: 2;
}
.m2w-library-nav-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(200,160,80,0.35);
  background: rgba(30,20,10,0.7);
  color: rgba(220,180,100,0.8);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.m2w-library-nav-btn:hover {
  background: rgba(120,80,20,0.4);
  border-color: rgba(220,180,100,0.6);
  color: #fff;
  transform: scale(1.1);
}
.m2w-library-nav-btn:disabled {
  opacity: 0.25; cursor: default;
  transform: none;
}
.m2w-library-nav-btn--highlight {
  background: rgba(120,80,20,0.35);
  border-color: rgba(220,180,100,0.75) !important;
  animation: m2w-btn-pulse 1.8s ease-in-out infinite;
}
@keyframes m2w-btn-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(200,160,80,0.25); }
  50% { box-shadow: 0 0 18px rgba(220,180,100,0.7), 0 0 32px rgba(200,160,80,0.3); }
}
/* Cover page — begin reading hint */
.m2w-library-cover-cta {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: all;
  cursor: pointer;
  animation: m2w-cta-float 2s ease-in-out infinite;
}
.m2w-library-cover-cta-arrow {
  font-size: 30px; line-height: 1;
  color: rgba(220,180,100,0.9);
}
.m2w-library-cover-cta-label {
  font-family: var(--m2w-serif);
  font-size: 10px;
  color: rgba(200,160,80,0.65);
  letter-spacing: 3px;
  text-transform: uppercase;
}
@keyframes m2w-cta-float {
  0%, 100% { opacity: 0.65; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-5px); }
}
.m2w-library-nav-dots {
  display: flex; gap: 6px;
}
.m2w-library-nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(200,160,80,0.25);
  transition: all 0.3s ease;
}
.m2w-library-nav-dot--active {
  background: rgba(220,180,100,0.8);
  box-shadow: 0 0 6px rgba(200,160,80,0.4);
}
/* Close button */
.m2w-library-close {
  position: absolute;
  top: 12px; right: 16px;
  z-index: 3;
  background: rgba(30,20,10,0.6);
  border: 1px solid rgba(200,160,80,0.3);
  border-radius: 50%;
  width: 36px; height: 36px;
  color: rgba(220,180,100,0.7);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.m2w-library-close:hover {
  background: rgba(120,40,10,0.5);
  color: #fff;
  border-color: rgba(220,100,40,0.5);
}
/* Swipe hint */
.m2w-library-swipe-hint {
  position: absolute;
  bottom: -84px; left: 50%; transform: translateX(-50%);
  font-family: var(--m2w-serif);
  font-size: 10px; letter-spacing: 2px;
  color: rgba(200,160,100,0.35);
  white-space: nowrap;
}
.m2w-library-page-arrow {
  position: absolute;
  right: 5vw; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.m2w-library-page-arrow--hidden {
  opacity: 0;
}
.m2w-library-page-arrow-icon {
  font-size: 56px;
  line-height: 1;
  color: rgba(200,160,100,0.92);
  text-shadow: 0 0 24px rgba(200,160,100,0.55), 0 0 6px rgba(200,160,100,0.8);
  animation: m2w-arrow-nudge 1.3s ease-in-out infinite;
}
.m2w-library-page-arrow-label {
  font-family: var(--m2w-serif);
  font-size: 11px; letter-spacing: 3px;
  color: rgba(200,160,100,0.65);
  white-space: nowrap;
}
@keyframes m2w-arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(10px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CD Player easter-egg overlay — Marc's Den windowsill relic
   ═══════════════════════════════════════════════════════════════════════════ */
.m2w-cd-player {
  position: fixed; inset: 0;
  z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s ease;
}
.m2w-cd-player--open {
  opacity: 1; pointer-events: all;
}
.m2w-cd-player * { pointer-events: inherit; }
.m2w-cd-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(4,2,8,0.90) 0%, rgba(0,0,0,0.97) 100%);
  cursor: pointer;
}
.m2w-cd-frame {
  position: relative; z-index: 1;
  width: min(88vw, 380px);
  transform: scale(0.88) translateY(18px);
  transition: transform 0.52s cubic-bezier(0.22, 0.61, 0.36, 1);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60,40,100,0.18) 0%, transparent 55%),
    linear-gradient(160deg, #1a1228 0%, #12101e 40%, #0e0c1a 100%);
  border: 1px solid rgba(160,120,220,0.25);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(200,160,255,0.08),
    0 0 40px rgba(120,80,200,0.20),
    0 8px 60px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(200,160,255,0.12);
  padding: 28px 28px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.m2w-cd-player--open .m2w-cd-frame {
  transform: scale(1) translateY(0);
}
.m2w-cd-frame::before,
.m2w-cd-frame::after {
  content: '';
  position: absolute;
  width: 28px; height: 28px;
  border-color: rgba(180,140,240,0.35);
  border-style: solid;
}
.m2w-cd-frame::before {
  top: 8px; left: 8px;
  border-width: 1px 0 0 1px;
}
.m2w-cd-frame::after {
  bottom: 8px; right: 8px;
  border-width: 0 1px 1px 0;
}
.m2w-cd-close {
  position: absolute; top: 10px; right: 12px;
  background: rgba(40,20,60,0.5);
  border: 1px solid rgba(160,120,220,0.25);
  border-radius: 50%;
  width: 30px; height: 30px;
  color: rgba(180,140,220,0.6);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.m2w-cd-close:hover { background: rgba(100,40,40,0.5); color: #fff; border-color: rgba(220,80,80,0.4); }
.m2w-cd-header {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.m2w-cd-ornament {
  font-family: var(--m2w-serif);
  font-size: 11px; letter-spacing: 5px;
  color: rgba(180,140,220,0.5);
}
.m2w-cd-title-text {
  font-family: var(--m2w-serif);
  font-size: clamp(13px, 3vw, 16px);
  letter-spacing: 4px;
  color: rgba(210,190,240,0.75);
  text-transform: uppercase;
}
.m2w-cd-disc-wrap {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.m2w-cd-disc {
  width: 148px; height: 148px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1a1a2a 10%, transparent 10%),
    conic-gradient(
      from 0deg,
      #c84848, #c89030, #48c878, #3090c8, #8848c8, #c848a8, #c84848
    );
  box-shadow:
    0 0 24px rgba(140,100,220,0.35),
    0 0 48px rgba(100,70,180,0.18),
    0 4px 20px rgba(0,0,0,0.5);
  animation: m2w-cd-spin 4s linear infinite;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.m2w-cd-disc::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.28) 0%, transparent 55%);
  pointer-events: none;
}
.m2w-cd-disc-hub {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1830 60%, #0c0a18 100%);
  border: 2px solid rgba(140,120,200,0.3);
  position: relative; z-index: 1;
}
.m2w-cd-disc-shadow {
  width: 120px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(80,50,160,0.25) 0%, transparent 70%);
  margin-top: 8px;
}
@keyframes m2w-cd-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.m2w-cd-song-info {
  text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.m2w-cd-song-title {
  font-family: var(--m2w-serif);
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 700;
  color: #d8c8f0;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(160,120,220,0.5);
}
.m2w-cd-song-sub {
  font-family: var(--m2w-serif);
  font-size: 10px; letter-spacing: 3px;
  color: rgba(160,130,200,0.45);
  text-transform: uppercase;
}
.m2w-cd-controls {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
}
.m2w-cd-progress-bar {
  width: 100%; height: 4px;
  background: rgba(140,100,200,0.18);
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid rgba(140,100,200,0.15);
}
.m2w-cd-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7040c0, #c080ff);
  border-radius: 2px;
  transition: width 0.25s linear;
  box-shadow: 0 0 6px rgba(160,100,255,0.5);
}
.m2w-cd-controls-row {
  display: flex; align-items: center; justify-content: space-between;
}
.m2w-cd-time {
  font-family: var(--m2w-serif);
  font-size: 11px; letter-spacing: 2px;
  color: rgba(160,130,200,0.5);
  min-width: 36px;
}
.m2w-cd-time--right { text-align: right; }
.m2w-cd-play {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140,80,220,0.35) 0%, rgba(80,40,140,0.25) 100%);
  border: 1px solid rgba(160,100,240,0.4);
  color: rgba(210,180,255,0.9);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(120,60,200,0.25), inset 0 1px 0 rgba(200,160,255,0.1);
}
.m2w-cd-play:hover {
  background: radial-gradient(circle, rgba(160,100,240,0.5) 0%, rgba(100,50,180,0.4) 100%);
  border-color: rgba(200,140,255,0.6);
  box-shadow: 0 0 20px rgba(140,80,220,0.45);
  transform: scale(1.06);
}
.m2w-cd-footer { width: 100%; display: flex; justify-content: center; gap: 10px; }
.m2w-cd-yt-link,
.m2w-cd-sp-link {
  font-family: var(--m2w-serif);
  font-size: 10px; letter-spacing: 2px;
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 20px;
  transition: all 0.2s ease;
  text-transform: uppercase;
}
.m2w-cd-yt-link {
  color: rgba(160,130,200,0.55);
  border: 1px solid rgba(140,100,200,0.18);
}
.m2w-cd-yt-link:hover {
  color: rgba(210,180,255,0.9);
  border-color: rgba(160,120,220,0.45);
  background: rgba(80,40,140,0.2);
}
.m2w-cd-sp-link {
  color: rgba(120,180,120,0.55);
  border: 1px solid rgba(80,160,80,0.18);
}
.m2w-cd-sp-link:hover {
  color: rgba(160,230,160,0.9);
  border-color: rgba(80,180,80,0.45);
  background: rgba(20,80,20,0.25);
}
.m2w-cd-hint {
  font-family: var(--m2w-serif);
  font-size: 9px; letter-spacing: 2px;
  color: rgba(120,100,160,0.35);
  text-transform: uppercase;
}
.m2w-cd-hint kbd {
  font-family: inherit;
  font-size: 9px;
  background: rgba(80,60,120,0.25);
  border: 1px solid rgba(120,90,180,0.2);
  border-radius: 2px;
  padding: 0 3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Bartender greeting + menu
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Speech bubble ─────────────────────────────────────────────────────── */
.m2w-bart-greet {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.34,1.4,.64,1);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.85));
}
.m2w-bart-greet--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 18px));
}
.m2w-bart-greet__bubble {
  background: linear-gradient(150deg, #1a0e02 0%, #2e1a06 100%);
  border: 1.5px solid #d4a030;
  border-radius: 9px;
  padding: 9px 16px 10px;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.6),
    0 6px 24px rgba(0,0,0,0.8),
    0 0 18px rgba(200,148,26,.2),
    inset 0 1px 0 rgba(220,170,60,0.1);
  position: relative;
  white-space: nowrap;
}
/* tail */
.m2w-bart-greet__bubble::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #d4a030;
  border-bottom: none;
}
.m2w-bart-greet__bubble::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #2e1a06;
  border-bottom: none;
  z-index: 1;
}
.m2w-bart-greet__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #f5e090;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 14px rgba(240,200,80,.3);
}
.m2w-bart-greet__prompt {
  text-align: center;
  margin-top: 7px;
  font-family: monospace;
  font-size: 11px;
  color: #d4a030;
  letter-spacing: .12em;
}
.m2w-bart-greet__prompt kbd {
  display: inline-block;
  background: rgba(220,160,40,0.15);
  border: 1px solid rgba(220,160,40,0.5);
  border-radius: 3px;
  padding: 0 5px;
  font-family: monospace;
  font-size: 11px;
  color: #ffe8a0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
  text-shadow: none;
}

/* ── Guard NPC speech bubble ───────────────────────────────────────────── */
.m2w-guard-greet {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 18px));
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.34,1.4,.64,1);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.85));
}
.m2w-guard-greet--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 18px));
}
.m2w-guard-greet__bubble {
  background: linear-gradient(150deg, #111720 0%, #1c2840 100%);
  border: 1.5px solid #a0b4d0;
  border-radius: 9px;
  padding: 9px 16px 10px;
  position: relative;
  text-align: center;
  max-width: 220px;
  white-space: normal;
  line-height: 1.45;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.6),
    0 6px 20px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(160,180,220,0.1);
}
.m2w-guard-greet__bubble::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #a0b4d0;
  border-bottom: none;
}
.m2w-guard-greet__bubble::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1c2840;
  border-bottom: none;
  z-index: 1;
}
.m2w-guard-greet__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #ddeaff;
  letter-spacing: .03em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 12px rgba(100,150,220,.25);
}
.m2w-guard-greet__prompt {
  text-align: center;
  margin-top: 7px;
  font-family: monospace;
  font-size: 11px;
  color: #b8cce8;
  letter-spacing: .12em;
}
.m2w-guard-greet__prompt kbd {
  display: inline-block;
  background: rgba(160,180,220,0.15);
  border: 1px solid rgba(160,180,220,0.45);
  border-radius: 3px;
  padding: 0 5px;
  font-family: monospace;
  font-size: 11px;
  color: #e8f0ff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
  text-shadow: none;
}
.m2w-guard-bribe-prompt--hidden {
  display: none;
}
/* Bribe follow-up prompt is italic to feel like a player dialogue choice */
#m2w-guard-bribe-prompt {
  font-style: italic;
  color: #d0e4ff;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(160,180,220,0.2);
  letter-spacing: .04em;
}
#m2w-guard-bribe-prompt kbd {
  font-style: normal;
  margin-right: 3px;
}

/* ── Full menu overlay ─────────────────────────────────────────────────── */
.m2w-bart-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2200;
  background: rgba(3,1,0,.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.m2w-bart-menu--open {
  opacity: 1;
  pointer-events: all;
}
.m2w-bart-menu__inner {
  display: grid;
  grid-template-columns: 1fr 172px;
  grid-template-rows: auto 1fr auto;
  width: min(620px, 94vw);
  max-height: 86vh;
  background: linear-gradient(155deg, #150b03 0%, #0d0703 55%, #120900 100%);
  border: 2px solid #7a5010;
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(200,148,26,.3),
    0 0 60px rgba(200,100,10,.18),
    0 24px 60px rgba(0,0,0,.8),
    inset 0 0 60px rgba(200,100,10,.04);
  overflow: hidden;
  position: relative;
}
/* Corner ornaments */
.m2w-bart-menu__inner::before {
  content: '\2766';
  position: absolute; top: 9px; left: 13px;
  font-size: 16px; color: #5a3808; line-height: 1; pointer-events: none;
}
.m2w-bart-menu__inner::after {
  content: '\2767';
  position: absolute; top: 9px; right: 13px;
  font-size: 16px; color: #5a3808; line-height: 1; pointer-events: none;
}
.m2w-bart-menu__header {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px 44px 12px;
  border-bottom: 1px solid #2e1a08;
  background: linear-gradient(180deg, rgba(200,100,10,.06) 0%, transparent 100%);
}
.m2w-bart-menu__title {
  display: block;
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 21px;
  color: #f0c840;
  letter-spacing: .14em;
  text-shadow: 0 0 24px rgba(240,192,64,.5), 0 2px 4px rgba(0,0,0,.6);
}
.m2w-bart-menu__sub {
  display: block;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 11px;
  color: #9a7040;
  letter-spacing: .2em;
  margin-top: 3px;
}
.m2w-bart-menu__list {
  grid-column: 1;
  grid-row: 2;
  list-style: none;
  margin: 0; padding: 6px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a2008 transparent;
}
.m2w-bart-menu__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px 9px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .14s, border-color .14s;
}
.m2w-bart-menu__item:hover,
.m2w-bart-menu__item--sel {
  background: rgba(200,148,26,.09);
  border-left-color: #c8941a;
}
.m2w-bart-menu__item--sel .m2w-bart-mi__name {
  color: #f0d060;
  text-shadow: 0 0 10px rgba(240,200,64,.3);
}
.m2w-bart-mi__num   { font-family: monospace; font-size: 10px; color: #4a2c10; min-width: 13px; }
.m2w-bart-mi__name  { font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 14px; color: #c8a060; flex: 0 0 auto; transition: color .14s; }
.m2w-bart-mi__desc  { font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 11px; color: #5a3c1c; font-style: italic; flex: 1; padding-left: 6px; }
.m2w-bart-mi__price { font-family: monospace; font-size: 12px; color: #c8941a; white-space: nowrap; margin-left: auto; }

.m2w-bart-menu__preview {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-left: 1px solid #221408;
  padding: 10px;
  background: radial-gradient(ellipse at center, rgba(200,100,10,.07) 0%, transparent 70%);
}
.m2w-bart-menu__preview canvas {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: 3px;
  filter: drop-shadow(0 0 10px rgba(200,148,26,.2));
}
.m2w-bart-menu__plabel {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 11px;
  color: #8a6030;
  font-style: italic;
  text-align: center;
  letter-spacing: .04em;
  max-width: 148px;
  line-height: 1.3;
}
.m2w-bart-menu__foot {
  grid-column: 1 / -1;
  text-align: center;
  padding: 9px;
  border-top: 1px solid #1e1006;
  font-family: monospace;
  font-size: 9px;
  color: #4a3018;
  letter-spacing: .1em;
}

/* ── Eat toast ─────────────────────────────────────────────────────────── */
.m2w-bart-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: linear-gradient(135deg, #1c1004, #2a1808);
  border: 1px solid #c8941a;
  border-radius: 4px;
  padding: 9px 22px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 14px;
  color: #f0d070;
  font-style: italic;
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 3000;
  opacity: 0;
  box-shadow: 0 0 28px rgba(200,148,26,.28), 0 8px 20px rgba(0,0,0,.6);
  transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.m2w-bart-toast em { font-style: normal; color: #f8e090; }
.m2w-bart-toast--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRADER NPC (SILAS)  –  speech bubble + shop overlay
═══════════════════════════════════════════════════════════════════════════ */

/* ── Proximity speech bubble ─────────────────────────────────────────────── */
.m2w-trader-greet {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.34,1.4,.64,1);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.85));
}
.m2w-trader-greet--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 18px));
}
.m2w-trader-greet__bubble {
  background: linear-gradient(150deg, #0c140a 0%, #182210 100%);
  border: 1.5px solid #7ab030;
  border-radius: 9px;
  padding: 9px 16px 10px;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.6),
    0 6px 24px rgba(0,0,0,0.8),
    0 0 18px rgba(100,180,40,.18),
    inset 0 1px 0 rgba(140,200,60,0.08);
  position: relative;
  white-space: nowrap;
}
.m2w-trader-greet__bubble::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #7ab030;
  border-bottom: none;
}
.m2w-trader-greet__bubble::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #182210;
  border-bottom: none;
  z-index: 1;
}
.m2w-trader-greet__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #d8f090;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 14px rgba(160,230,80,.25);
}
.m2w-trader-greet__prompt {
  text-align: center;
  margin-top: 7px;
  font-family: monospace;
  font-size: 11px;
  color: #90c840;
  letter-spacing: .12em;
}
.m2w-trader-greet__prompt kbd {
  display: inline-block;
  background: rgba(120,200,40,0.12);
  border: 1px solid rgba(120,200,40,0.45);
  border-radius: 3px;
  padding: 0 5px;
  font-family: monospace;
  font-size: 11px;
  color: #d8f090;
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
  text-shadow: none;
}

/* ── Shop overlay ────────────────────────────────────────────────────────── */
.m2w-trader-menu {
  display: none;
  position: fixed; inset: 0;
  z-index: 3100;
  background: rgba(4,10,2,0.82);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}
.m2w-trader-menu--open { display: flex; }
.m2w-trader-menu__inner {
  background: linear-gradient(165deg, #0e1a0a 0%, #1a2c10 60%, #0c1608 100%);
  border: 1.5px solid #5a8c28;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px rgba(0,0,0,0.7),
    0 12px 48px rgba(0,0,0,0.9),
    0 0 32px rgba(80,150,30,.12),
    inset 0 1px 0 rgba(140,210,60,0.07);
  width: min(480px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.m2w-trader-menu__inner::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 12px;
  background: radial-gradient(ellipse at 30% 0%, rgba(120,200,40,0.04) 0%, transparent 65%);
  pointer-events: none;
}
.m2w-trader-menu__header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid rgba(90,140,40,0.3);
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.m2w-trader-menu__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.m2w-trader-menu__bal {
  font-family: monospace;
  font-size: 13px;
  color: #c8941a;
  letter-spacing: .04em;
}
.m2w-trader-menu__title {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 20px;
  color: #c8e870;
  letter-spacing: .06em;
  text-shadow: 0 0 18px rgba(160,220,60,.35);
}
.m2w-trader-menu__sub {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 12px;
  color: #5a8030;
  font-style: italic;
  letter-spacing: .04em;
}
.m2w-trader-menu__list {
  list-style: none; margin: 0; padding: 8px 0;
  overflow-y: auto; flex: 1; min-width: 0;
}
.m2w-trader-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  cursor: pointer;
  transition: background .1s;
  border-left: 2px solid transparent;
}
.m2w-trader-menu__item:hover,
.m2w-trader-menu__item--sel {
  background: rgba(90,150,30,0.12);
  border-left-color: #7ab030;
}
.m2w-trader-menu__item--sel .m2w-trader-mi__name { color: #d8f070; }
.m2w-trader-mi__num   { font-family: monospace; font-size: 10px; color: #3a5c18; min-width: 13px; }
.m2w-trader-mi__name  { font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 14px; color: #a8d050; flex: 0 0 auto; transition: color .14s; }
.m2w-trader-mi__desc  { font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 11px; color: #3c5c20; font-style: italic; flex: 1; padding-left: 6px; }
.m2w-trader-mi__price { font-family: monospace; font-size: 12px; color: #c8941a; white-space: nowrap; margin-left: auto; }
.m2w-trader-mi__tag--rare { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: #c8a0f0; background: rgba(100,50,160,0.35); border: 1px solid rgba(160,100,220,0.4); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.m2w-trader-menu__item--rare .m2w-trader-mi__name { color: #c8a0f0; }
.m2w-trader-menu__item--rare .m2w-trader-mi__price { color: #b080e0; }
.m2w-trader-menu__body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.m2w-trader-menu__preview {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 12px 6px;
  border-left: 1px solid rgba(90,140,40,0.15);
}
.m2w-trader-menu__preview canvas {
  border-radius: 6px;
  border: 1px solid rgba(90,140,40,0.25);
  background: rgba(8,14,4,0.6);
  box-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 16px rgba(80,150,30,.08);
  display: block;
}
.m2w-trader-menu__plabel {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 10px;
  font-style: italic;
  color: rgba(160,210,80,0.55);
  text-align: center;
  max-width: 148px;
  line-height: 1.3;
}
.m2w-trader-menu__foot {
  padding: 10px 20px 14px;
  border-top: 1px solid rgba(90,140,40,0.2);
  font-family: monospace;
  font-size: 10px;
  color: #3a5818;
  letter-spacing: .10em;
  text-align: center;
  flex-shrink: 0;
}

/* ── Purchase toast ──────────────────────────────────────────────────────── */
.m2w-trader-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(12,22,6,0.92);
  border: 1px solid rgba(90,150,30,0.5);
  border-radius: 6px;
  padding: 8px 18px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: #b8d878;
  text-shadow: 0 0 10px rgba(120,200,40,.3);
  pointer-events: none;
  z-index: 3200;
  opacity: 0;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.m2w-trader-toast em { font-style: normal; color: #d8f070; }
.m2w-trader-toast--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KARAOKE MACHINE  –  proximity prompt + full-screen overlay
═══════════════════════════════════════════════════════════════════════════ */

/* ── Proximity prompt ─────────────────────────────────────────────────────── */
.m2w-karaoke-prompt {
  position: fixed;
  z-index: 260;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  filter: drop-shadow(0 0 10px rgba(80,100,255,.65));
  transition: opacity .22s ease;
}
.m2w-karaoke-prompt--hidden { opacity: 0; }

.m2w-karaoke-prompt-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(60,80,255,.22) 0%, transparent 72%);
  animation: m2w-kar-glow 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes m2w-kar-glow {
  0%, 100% { opacity: .55; }
  50%       { opacity: 1;   }
}

.m2w-karaoke-prompt-notes {
  display: flex;
  gap: 5px;
  margin-bottom: 2px;
}
.m2w-karaoke-note {
  font-size: 14px;
  color: #7090ff;
  animation: m2w-kar-note 1.8s ease-in-out infinite;
}
.m2w-karaoke-note:nth-child(2) { animation-delay: .55s; color: #c060ff; }
.m2w-karaoke-note:nth-child(3) { animation-delay: 1.1s; color: #ff60c0; }
@keyframes m2w-kar-note {
  0%, 100% { transform: translateY(0);   opacity: .55; }
  50%       { transform: translateY(-5px); opacity: 1;   }
}

.m2w-karaoke-prompt-text {
  background: linear-gradient(135deg, #080620, #140830);
  border: 1px solid rgba(80,100,255,.65);
  border-radius: 6px;
  padding: 7px 16px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 13px;
  color: #a0b0ff;
  letter-spacing: .05em;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(60,80,255,.35), inset 0 1px 0 rgba(120,140,255,.12);
}
.m2w-karaoke-prompt-text kbd {
  display: inline-block;
  background: rgba(80,100,255,.22);
  border: 1px solid rgba(100,120,255,.55);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #c8d8ff;
  box-shadow: 0 2px 0 rgba(0,0,0,.5);
}

/* ── Full-screen overlay ──────────────────────────────────────────────────── */
.m2w-karaoke-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .38s ease;
}
.m2w-karaoke-overlay--hidden { display: none; }
.m2w-karaoke-overlay--open   { opacity: 1; }

.m2w-karaoke-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 14, .88);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* Animated border glow on frame */
@keyframes m2w-kar-border {
  0%   { border-color: rgba(80,100,255,.7);  box-shadow: 0 0 32px rgba(60,80,255,.35), 0 0 0 1px rgba(180,100,255,.22), inset 0 0 40px rgba(20,10,50,.8); }
  40%  { border-color: rgba(180,80,255,.8);  box-shadow: 0 0 48px rgba(140,60,255,.45), 0 0 0 1px rgba(80,180,255,.18), inset 0 0 40px rgba(20,10,50,.8); }
  70%  { border-color: rgba(255,60,180,.7);  box-shadow: 0 0 38px rgba(200,40,160,.38), 0 0 0 1px rgba(255,80,200,.2), inset 0 0 40px rgba(20,10,50,.8); }
  100% { border-color: rgba(80,100,255,.7);  box-shadow: 0 0 32px rgba(60,80,255,.35), 0 0 0 1px rgba(180,100,255,.22), inset 0 0 40px rgba(20,10,50,.8); }
}

.m2w-karaoke-frame {
  position: relative;
  z-index: 1;
  width: min(96vw, 1320px);
  height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #08041a 0%, #0c0630 50%, #08041a 100%);
  border: 2px solid rgba(80,100,255,.7);
  border-radius: 10px;
  overflow: hidden;
  animation: m2w-kar-border 5s ease-in-out infinite;
}

/* Corner ornament lines */
.m2w-karaoke-frame::before,
.m2w-karaoke-frame::after {
  content: '';
  position: absolute;
  width: 48px; height: 48px;
  pointer-events: none;
  z-index: 2;
}
.m2w-karaoke-frame::before {
  top: 6px; left: 6px;
  border-top: 2px solid rgba(200,148,26,.7);
  border-left: 2px solid rgba(200,148,26,.7);
}
.m2w-karaoke-frame::after {
  bottom: 6px; right: 6px;
  border-bottom: 2px solid rgba(200,148,26,.7);
  border-right: 2px solid rgba(200,148,26,.7);
}

/* Header bar */
.m2w-karaoke-frame-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 20px;
  background: linear-gradient(90deg, transparent, rgba(80,100,255,.08) 30%, rgba(180,80,255,.08) 70%, transparent);
  border-bottom: 1px solid rgba(80,100,255,.28);
  position: relative;
}
.m2w-karaoke-frame-ornament {
  font-size: 11px;
  color: rgba(200,148,26,.65);
  letter-spacing: .12em;
}
.m2w-karaoke-frame-title {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  color: #c0ccff;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(100,130,255,.7), 0 0 38px rgba(60,80,255,.35);
}

.m2w-karaoke-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(80,100,255,.14);
  border: 1px solid rgba(80,100,255,.45);
  border-radius: 50%;
  width: 28px; height: 28px;
  color: #a0b0ff;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  line-height: 1;
}
.m2w-karaoke-close:hover {
  background: rgba(255,60,180,.25);
  border-color: rgba(255,80,200,.7);
  color: #ffc0e8;
}

/* iframe stage */
.m2w-karaoke-stage {
  flex: 1;
  min-height: 0;
  position: relative;
}
.m2w-karaoke-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* Footer hint */
.m2w-karaoke-frame-foot {
  flex-shrink: 0;
  text-align: center;
  padding: 7px 16px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 12px;
  color: rgba(140,150,220,.7);
  letter-spacing: .08em;
  border-top: 1px solid rgba(80,100,255,.18);
  background: linear-gradient(90deg, transparent, rgba(60,80,255,.05) 50%, transparent);
}
.m2w-karaoke-frame-foot kbd {
  background: rgba(80,100,255,.2);
  border: 1px solid rgba(100,120,255,.4);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: #b0bfff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRACTICE HALL  — interior overlay (purple / violet theme)
═══════════════════════════════════════════════════════════════════════════ */

.m2w-practicehall {
  position: absolute; inset: 0; z-index: 48;
  pointer-events: none;
}
.m2w-practicehall--hidden { display: none; }

.m2w-practicehall-veil {
  position: absolute; inset: 0; z-index: 2;
  background: #04000e; opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.m2w-ph-veil--dark { opacity: 1; }

.m2w-practicehall-ui {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
}
/* Breathing vignette — deeper, more cinematic */
.m2w-practicehall-ui::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(4,0,14,0.45) 65%, rgba(4,0,14,0.82) 100%);
  animation: m2w-ph-vignette-breathe 6s ease-in-out infinite;
}
@keyframes m2w-ph-vignette-breathe {
  0%,100% { opacity: 0.82; }
  50%      { opacity: 1.0;  }
}
/* Subtle purple light leak from top */
.m2w-practicehall-ui::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 180px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(160,80,220,0.06) 0%, transparent 100%);
}

/* ── Header — cathedral arch with filigree ────────────────────────────── */
.m2w-ph-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 72px;
  pointer-events: auto;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(180deg,
      rgba(10,5,32,0.98) 0%,
      rgba(14,6,28,0.92) 40%,
      rgba(14,6,28,0.65) 70%,
      transparent 100%);
}
/* Double-line glow bottom edge */
.m2w-ph-header::before {
  content: '';
  position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(160,80,208,0.15) 10%, rgba(160,80,208,0.5) 30%,
    rgba(200,120,255,0.7) 50%, rgba(160,80,208,0.5) 70%, rgba(160,80,208,0.15) 90%, transparent);
}
.m2w-ph-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(200,148,26,0.1) 20%, rgba(200,148,26,0.35) 50%, rgba(200,148,26,0.1) 80%, transparent);
}
/* Travelling shimmer */
.m2w-ph-header-shimmer {
  position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
  overflow: hidden; pointer-events: none;
}
.m2w-ph-header-shimmer::before {
  content: '';
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(200,120,255,0.8), transparent);
  animation: m2w-ph-shimmer-travel 6s ease-in-out infinite;
}
@keyframes m2w-ph-shimmer-travel {
  0%   { left: -40%; }
  100% { left: 140%; }
}

/* ── Exit button ──────────────────────────────────────────────────────── */
.m2w-practicehall-exit {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  background: rgba(160,80,208,0.08);
  border: 1px solid rgba(160,80,208,0.25);
  border-radius: 6px;
  color: rgba(200,140,240,0.75);
  font-family: var(--m2w-serif);
  font-size: 11px; font-weight: 600;
  padding: 7px 16px 7px 12px;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  display: flex; align-items: center; gap: 6px;
}
.m2w-practicehall-exit:hover {
  background: rgba(160,80,208,0.2);
  border-color: rgba(200,120,255,0.55);
  color: #fff;
  box-shadow: 0 0 16px rgba(160,80,220,0.2);
}
.m2w-ph-exit-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}
.m2w-practicehall-exit:hover .m2w-ph-exit-arrow {
  transform: translateX(-3px);
}

/* ── Title cluster ────────────────────────────────────────────────────── */
.m2w-ph-title-group {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.m2w-ph-title-row {
  display: flex; align-items: center; gap: 16px;
}
.m2w-ph-filigree {
  display: flex; align-items: center; gap: 4px;
  color: rgba(200,148,26,0.65);
  font-size: 7px;
  letter-spacing: 3px;
  opacity: 0.7;
}
.m2w-ph-filigree-diamond {
  font-size: 6px;
  animation: m2w-ph-filigree-pulse 3s ease-in-out infinite;
}
.m2w-ph-filigree-line {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,148,26,0.65), transparent);
}
@keyframes m2w-ph-filigree-pulse {
  0%,100% { opacity: 0.5; }
  50%      { opacity: 1; }
}
.m2w-ph-name {
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 15px; font-weight: 700;
  color: #c080e0; letter-spacing: 6px; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(160,80,220,0.5), 0 0 50px rgba(140,60,200,0.2);
  animation: m2w-ph-title-glow 4s ease-in-out infinite;
}
@keyframes m2w-ph-title-glow {
  0%,100% { text-shadow: 0 0 18px rgba(160,80,220,0.48), 0 0 38px rgba(140,60,200,0.18); color: #c080e0; }
  50%      { text-shadow: 0 0 28px rgba(210,110,255,0.80), 0 0 58px rgba(190,80,255,0.36), 0 0 90px rgba(150,60,210,0.16); color: #d4a0f4; }
}
.m2w-ph-subtitle {
  font-family: var(--m2w-serif);
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(160,120,200,0.35);
  margin-top: 1px;
}

/* ── Star counter ─────────────────────────────────────────────────────── */
.m2w-ph-stars {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
  background: rgba(200,148,26,0.06);
  border: 1px solid rgba(200,148,26,0.2);
  border-radius: 20px;
  padding: 5px 14px 5px 10px;
  font-family: var(--m2w-serif); font-size: 12px;
  color: rgba(200,148,26,0.85); letter-spacing: 1px;
}
.m2w-ph-stars-icon {
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(200,148,26,0.4));
}
.m2w-ph-stars-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Ambient CSS particles ────────────────────────────────────────────── */
.m2w-ph-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 4; overflow: hidden;
}
.m2w-ph-particle {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #c080e0; opacity: 0;
  animation: m2w-ph-particle-drift linear infinite;
}
@keyframes m2w-ph-particle-drift {
  0%   { opacity: 0; transform: translateY(0) translateX(0); }
  15%  { opacity: 0.5; }
  85%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-120vh) translateX(40px); }
}
.m2w-ph-particle:nth-child(1)  { left:  8%; bottom: -5%; animation-duration: 14s; animation-delay: 0s; }
.m2w-ph-particle:nth-child(2)  { left: 22%; bottom: -8%; animation-duration: 18s; animation-delay: 2s;  width: 3px; height: 3px; }
.m2w-ph-particle:nth-child(3)  { left: 37%; bottom: -3%; animation-duration: 16s; animation-delay: 5s;  width: 1.5px; height: 1.5px; }
.m2w-ph-particle:nth-child(4)  { left: 55%; bottom: -6%; animation-duration: 20s; animation-delay: 1s;  background: #d4a0f4; }
.m2w-ph-particle:nth-child(5)  { left: 68%; bottom: -4%; animation-duration: 15s; animation-delay: 7s;  width: 2.5px; height: 2.5px; }
.m2w-ph-particle:nth-child(6)  { left: 82%; bottom: -7%; animation-duration: 22s; animation-delay: 3s;  width: 1.5px; height: 1.5px; }
.m2w-ph-particle:nth-child(7)  { left: 15%; bottom: -2%; animation-duration: 17s; animation-delay: 9s;  background: #ff70c0; }
.m2w-ph-particle:nth-child(8)  { left: 45%; bottom: -9%; animation-duration: 19s; animation-delay: 4s;  width: 3px; height: 3px; }
.m2w-ph-particle:nth-child(9)  { left: 73%; bottom: -1%; animation-duration: 13s; animation-delay: 6s;  width: 1.5px; height: 1.5px; background: #50d8ff; }
.m2w-ph-particle:nth-child(10) { left: 91%; bottom: -5%; animation-duration: 21s; animation-delay: 8s; }
.m2w-ph-particle:nth-child(11) { left: 30%; bottom: -4%; animation-duration: 16s; animation-delay: 11s; }
.m2w-ph-particle:nth-child(12) { left: 60%; bottom: -7%; animation-duration: 24s; animation-delay: 1.5s; width: 2.5px; height: 2.5px; background: rgba(200,148,26,0.65); }

/* ── Hint ribbon (bottom) ─────────────────────────────────────────────── */
.m2w-ph-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 52px;
  pointer-events: none; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(0deg,
      rgba(4,0,14,0.95) 0%, rgba(10,4,16,0.75) 50%, transparent 100%);
}
.m2w-ph-hint::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(160,80,208,0.3) 30%, rgba(160,80,208,0.5) 50%, rgba(160,80,208,0.3) 70%, transparent);
}
.m2w-ph-hint-inner {
  display: flex; align-items: center; gap: 8px; padding: 0 24px;
}
.m2w-ph-hint-glyph {
  font-size: 8px; color: #a050d0; opacity: 0.4;
  animation: m2w-ph-hint-glyph-breathe 4s ease-in-out infinite;
}
.m2w-ph-hint-glyph:nth-child(even) { animation-delay: 2s; }
@keyframes m2w-ph-hint-glyph-breathe {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; color: #d4a0f4; }
}
.m2w-ph-hint-text {
  font-family: var(--m2w-serif); font-size: 10px; letter-spacing: 1.2px;
  color: rgba(180,120,220,0.55);
}
.m2w-ph-hint-text kbd {
  display: inline-block;
  background: rgba(160,80,208,0.12); border: 1px solid rgba(160,80,208,0.25);
  border-radius: 3px; padding: 2px 6px;
  font-family: var(--m2w-sans); font-size: 9px;
  color: rgba(200,140,240,0.65); margin: 0 2px; vertical-align: 1px;
}
.m2w-ph-hint-sep {
  width: 1px; height: 14px;
  background: rgba(160,80,208,0.2); margin: 0 4px;
}

/* ── Station proximity prompt — arcane card ───────────────────────────── */
.m2w-ph-prompt {
  position: fixed; z-index: 260; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.m2w-ph-prompt--hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }

.m2w-ph-prompt-aura {
  position: absolute; inset: -20px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(160,80,220,0.18) 0%, transparent 70%);
  animation: m2w-ph-prompt-aura 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes m2w-ph-prompt-aura {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.15); }
}

.m2w-ph-prompt-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 12px rgba(160,80,220,0.7));
  animation: m2w-ph-prompt-bob 2s ease-in-out infinite;
  margin-bottom: 6px;
}
@keyframes m2w-ph-prompt-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.m2w-ph-prompt-card {
  position: relative;
  background: linear-gradient(160deg, rgba(12,4,32,0.95), rgba(26,8,56,0.95));
  border: 1px solid rgba(160,80,220,0.55);
  border-radius: 8px;
  padding: 10px 20px;
  box-shadow: 0 0 24px rgba(140,60,200,0.3), 0 0 60px rgba(140,60,200,0.1),
    inset 0 1px 0 rgba(200,140,255,0.1);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  backdrop-filter: blur(8px);
}
.m2w-ph-prompt-card::before,
.m2w-ph-prompt-card::after {
  content: '';
  position: absolute; width: 12px; height: 12px; pointer-events: none;
}
.m2w-ph-prompt-card::before {
  top: 3px; left: 3px;
  border-top: 1px solid rgba(200,148,26,0.65);
  border-left: 1px solid rgba(200,148,26,0.65);
}
.m2w-ph-prompt-card::after {
  bottom: 3px; right: 3px;
  border-bottom: 1px solid rgba(200,148,26,0.65);
  border-right: 1px solid rgba(200,148,26,0.65);
}

.m2w-ph-prompt-name {
  font-family: var(--m2w-serif); font-size: 11px; font-weight: 600;
  color: #c080e0; letter-spacing: 1.5px; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(160,80,220,0.4);
}
.m2w-ph-prompt-key {
  font-family: var(--m2w-serif); font-size: 12px;
  color: rgba(180,140,220,0.8); letter-spacing: 0.5px;
}
.m2w-ph-prompt-key kbd {
  display: inline-block;
  background: rgba(160,80,220,0.2); border: 1px solid rgba(180,100,240,0.5);
  border-radius: 4px; padding: 2px 8px;
  font-size: 12px; font-family: 'Courier New', monospace; font-weight: 700;
  color: #d4a0f4;
  box-shadow: 0 2px 0 rgba(0,0,0,0.6), 0 0 8px rgba(160,80,220,0.2);
  margin: 0 3px;
}

/* ── App overlay (shared full-screen iframe) ─────────────────────────── */
.m2w-ph-app-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .4s ease;
}
.m2w-ph-app-overlay--hidden { display: none; }
.m2w-ph-app-overlay--open   { opacity: 1; }

.m2w-ph-app-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 0, 14, 0.92);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

@keyframes m2w-ph-frame-border {
  0%   { border-color: rgba(160,80,220,.6); box-shadow: 0 0 40px rgba(140,60,200,.25), 0 0 80px rgba(140,60,200,.1), inset 0 0 60px rgba(10,4,20,.9); }
  33%  { border-color: rgba(200,80,255,.7); box-shadow: 0 0 50px rgba(180,60,255,.35), 0 0 100px rgba(100,200,255,.08), inset 0 0 60px rgba(10,4,20,.9); }
  66%  { border-color: rgba(255,80,200,.6); box-shadow: 0 0 45px rgba(220,60,180,.3), 0 0 90px rgba(255,100,220,.08), inset 0 0 60px rgba(10,4,20,.9); }
  100% { border-color: rgba(160,80,220,.6); box-shadow: 0 0 40px rgba(140,60,200,.25), 0 0 80px rgba(140,60,200,.1), inset 0 0 60px rgba(10,4,20,.9); }
}

.m2w-ph-app-frame {
  position: relative; z-index: 1;
  width: min(96vw, 1320px); height: min(92vh, 860px);
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #080318 0%, #10062e 50%, #080318 100%);
  border: 2px solid rgba(160,80,220,.6);
  border-radius: 12px; overflow: hidden;
  animation: m2w-ph-frame-border 6s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(140,60,200,.25), 0 0 80px rgba(140,60,200,.1), inset 0 0 60px rgba(10,4,20,.9);
}

/* Corner filigree — top-left & bottom-right via ::before/::after */
.m2w-ph-app-frame::before,
.m2w-ph-app-frame::after {
  content: '';
  position: absolute; width: 56px; height: 56px;
  pointer-events: none; z-index: 2;
}
.m2w-ph-app-frame::before {
  top: 8px; left: 8px;
  border-top: 2px solid rgba(200,148,26,.6);
  border-left: 2px solid rgba(200,148,26,.6);
  border-top-left-radius: 3px;
}
.m2w-ph-app-frame::after {
  bottom: 8px; right: 8px;
  border-bottom: 2px solid rgba(200,148,26,.6);
  border-right: 2px solid rgba(200,148,26,.6);
  border-bottom-right-radius: 3px;
}
/* Extra corners via child elements */
.m2w-ph-app-corner {
  position: absolute; width: 56px; height: 56px;
  pointer-events: none; z-index: 2;
}
.m2w-ph-app-corner--tr {
  top: 8px; right: 8px;
  border-top: 2px solid rgba(200,148,26,.6);
  border-right: 2px solid rgba(200,148,26,.6);
  border-top-right-radius: 3px;
}
.m2w-ph-app-corner--bl {
  bottom: 8px; left: 8px;
  border-bottom: 2px solid rgba(200,148,26,.6);
  border-left: 2px solid rgba(200,148,26,.6);
  border-bottom-left-radius: 3px;
}
/* Travelling rune line */
.m2w-ph-app-runeline {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  z-index: 3; pointer-events: none; overflow: hidden;
}
.m2w-ph-app-runeline::before {
  content: '';
  position: absolute; top: 0; left: -30%; width: 20%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(200,148,26,0.6), transparent);
  animation: m2w-ph-runeline 4s linear infinite;
}
@keyframes m2w-ph-runeline {
  0%   { left: -20%; }
  100% { left: 120%; }
}

.m2w-ph-app-frame-top {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(20,8,40,0.9) 0%, rgba(16,6,30,0.6) 100%);
  border-bottom: 1px solid rgba(160,80,220,.22);
  position: relative;
}
.m2w-ph-app-ornament {
  display: flex; align-items: center; gap: 6px;
  font-size: 9px; color: rgba(200,148,26,.55); letter-spacing: .15em;
}
.m2w-ph-app-ornament-line {
  width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,148,26,0.35), transparent);
}
.m2w-ph-app-title {
  font-family: 'Cinzel Decorative', var(--m2w-serif);
  font-size: 16px; font-weight: 400;
  color: #d0b0f0; letter-spacing: .2em; text-transform: uppercase;
  text-shadow: 0 0 18px rgba(160,100,240,.7), 0 0 40px rgba(140,60,200,.3);
}

.m2w-ph-app-close {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: rgba(160,80,220,.1);
  border: 1px solid rgba(160,80,220,.35);
  border-radius: 50%; width: 32px; height: 32px;
  color: rgba(200,160,230,0.8); font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; line-height: 1;
}
.m2w-ph-app-close:hover {
  background: rgba(255,80,200,.2);
  border-color: rgba(255,100,220,.6);
  color: #ffc0e8;
  box-shadow: 0 0 14px rgba(255,80,200,0.2);
}

.m2w-ph-app-stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}
.m2w-ph-app-iframe {
  width: 100%; height: 100%; border: none; display: block; background: #000;
  transition: opacity .2s ease;
}
.m2w-ph-app-iframe--loading { opacity: 0; }
.m2w-ph-app-stage:has(.m2w-ph-app-iframe--loading)::after {
  content: '';
  position: absolute;
  width: 32px; height: 32px;
  inset: calc(50% - 16px) auto auto calc(50% - 16px);
  border: 3px solid rgba(160,80,220,.25);
  border-top-color: #c080f0;
  border-radius: 50%;
  animation: m2w-ph-spin .7s linear infinite;
}
@keyframes m2w-ph-spin {
  to { transform: rotate(360deg); }
}

.m2w-ph-app-foot {
  flex-shrink: 0; text-align: center;
  padding: 8px 16px;
  font-family: var(--m2w-serif); font-size: 11px;
  color: rgba(180,140,220,.6); letter-spacing: .08em;
  border-top: 1px solid rgba(160,80,220,.15);
  background: linear-gradient(90deg, transparent, rgba(140,60,200,.04) 50%, transparent);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.m2w-ph-app-foot kbd {
  background: rgba(160,80,220,.15); border: 1px solid rgba(180,100,240,.35);
  border-radius: 3px; padding: 2px 6px;
  font-size: 10px; font-family: 'Courier New', monospace; color: #c8b0e0;
}
.m2w-ph-app-foot-diamond {
  font-size: 6px; color: rgba(200,148,26,0.45);
}

/* ── Practice Hall responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .m2w-ph-header { height: 56px; }
  .m2w-ph-name { font-size: 12px; letter-spacing: 3px; }
  .m2w-ph-subtitle { display: none; }
  .m2w-ph-filigree-line { width: 16px; }
  .m2w-ph-stars { padding: 4px 10px; font-size: 11px; }
  .m2w-ph-hint { height: 44px; }
  .m2w-ph-hint-text { font-size: 9px; }
  .m2w-practicehall-exit { padding: 5px 10px; font-size: 10px; }
  .m2w-ph-prompt-name { font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COZINESS SYSTEM
═══════════════════════════════════════════════════════════════════════════ */

/* ── Fireplace proximity prompt ────────────────────────────────────────── */
.m2w-cozy-prompt {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity .28s ease, transform .3s cubic-bezier(.34,1.4,.64,1);
}
.m2w-cozy-prompt--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 16px));
}
.m2w-cozy-prompt__bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: linear-gradient(140deg, #140800 0%, #221004 100%);
  border: 1.5px solid #e07020;
  border-radius: 8px;
  padding: 9px 16px 10px;
  box-shadow:
    0 0 0 1px rgba(220,100,20,.2),
    0 6px 28px rgba(0,0,0,.7),
    0 0 22px rgba(220,100,10,.25),
    inset 0 0 18px rgba(240,100,0,.06);
  white-space: nowrap;
}
/* tail */
.m2w-cozy-prompt__bubble::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #e07020;
  border-bottom: none;
}
.m2w-cozy-prompt__bubble::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #221004;
  border-bottom: none;
  z-index: 1;
}
.m2w-cozy-prompt__row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.m2w-cozy-prompt__icon {
  font-size: 16px;
  line-height: 1;
}
.m2w-cozy-prompt__text {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 13px;
  font-style: italic;
  color: #f8d880;
  letter-spacing: .04em;
  text-shadow: 0 0 10px rgba(250,160,40,.4);
}
.m2w-cozy-prompt__live {
  font-family: monospace;
  font-size: 12px;
  color: #e0a040;
  min-width: 30px;
  text-align: right;
  transition: color .15s;
}
/* Live bar inside the fire prompt */
.m2w-cozy-prompt__track {
  width: 100%;
  height: 6px;
  background: rgba(10,5,2,.8);
  border: 1px solid rgba(160,70,10,.3);
  border-radius: 3px;
  overflow: hidden;
}
.m2w-cozy-prompt__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a3008, #e07020, #ffa040);
  transition: width .12s linear;
  box-shadow: 0 0 6px rgba(220,90,10,.5);
}
.m2w-cozy-prompt__btn {
  font-family: monospace;
  font-size: 10px;
  color: #e08030;
  text-align: center;
  letter-spacing: .1em;
  transition: color .15s;
}
.m2w-cozy-prompt__btn kbd {
  background: rgba(200,80,10,.2);
  border: 1px solid rgba(200,100,20,.5);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-family: 'Courier New', monospace;
  color: #f0c060;
  margin-right: 3px;
}
/* Warming glow — active state while holding F */
.m2w-cozy-prompt--warming .m2w-cozy-prompt__bubble {
  border-color: #ffa040;
  box-shadow:
    0 0 0 1px rgba(255,160,40,.25),
    0 6px 28px rgba(0,0,0,.7),
    0 0 30px rgba(255,140,20,.35),
    inset 0 0 24px rgba(255,120,20,.1);
}
.m2w-cozy-prompt--warming .m2w-cozy-prompt__live {
  color: #ffd060;
  text-shadow: 0 0 6px rgba(255,180,40,.6);
}
.m2w-cozy-prompt--warming .m2w-cozy-prompt__fill {
  background: linear-gradient(90deg, #e07020, #ff9030, #ffd060);
  box-shadow: 0 0 10px rgba(255,160,30,.7);
}
.m2w-cozy-prompt--warming .m2w-cozy-prompt__btn {
  color: #ffd060;
}

/* ── Coziness food toast ────────────────────────────────────────────────── */
.m2w-cozy-food-toast {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #180900, #2a1206);
  border: 1px solid #e07020;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 13px;
  color: #f8d060;
  font-style: italic;
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 3100;
  opacity: 0;
  box-shadow: 0 0 24px rgba(230,100,10,.35), 0 8px 20px rgba(0,0,0,.6);
  transition: opacity .28s ease, transform .3s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.m2w-cozy-food-toast--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.m2w-cozy-food-toast__icon { font-size: 15px; line-height: 1; }
.m2w-cozy-food-toast__text { color: #ffd060; }

/* ── Character menu coziness widget ─────────────────────────────────────── */
.m2w-cozy-widget {
  margin: 6px 0 0;
  padding: 7px 8px 8px;
  background: linear-gradient(135deg, rgba(20,10,2,.6) 0%, rgba(32,16,4,.5) 100%);
  border: 1px solid rgba(200,100,20,.28);
  border-radius: 5px;
  box-shadow: inset 0 0 14px rgba(200,80,0,.05);
  width: 100%;
}
.m2w-cozy-widget__header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.m2w-cozy-widget__icon {
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(240,120,20,.5));
}
.m2w-cozy-widget__label {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 10px;
  color: #c8a060;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex: 1;
}
.m2w-cozy-widget__pct {
  font-family: monospace;
  font-size: 10px;
  color: #e0a040;
  min-width: 28px;
  text-align: right;
}
.m2w-cozy-widget__track {
  height: 7px;
  background: rgba(10,5,2,.7);
  border: 1px solid rgba(140,70,10,.35);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
}
.m2w-cozy-widget__fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease, background .6s ease;
  background: linear-gradient(90deg, #8a3008, #c85010, #e07020);
  box-shadow: 0 0 6px rgba(220,90,10,.4);
}
/* Cozy widget inside bottom panels */
.m2w-char-panels .m2w-cozy-widget {
  margin: 0;
}

/* ── Coziness sub-stats (Warm + Food) ───────────────────────────────────── */
.m2w-cozy-substats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.m2w-cozy-substat {
  display: grid;
  grid-template-columns: 13px 22px 1fr 24px;
  align-items: center;
  gap: 4px;
}
.m2w-cozy-substat__icon {
  font-size: 10px;
  line-height: 1;
  text-align: center;
}
.m2w-cozy-substat__label {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 8px;
  color: #a07848;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.m2w-cozy-substat__track {
  height: 5px;
  background: rgba(10,5,2,.7);
  border: 1px solid rgba(120,60,10,.3);
  border-radius: 3px;
  overflow: hidden;
}
.m2w-cozy-substat__fill {
  height: 100%;
  border-radius: 3px;
  transition: width .35s ease;
}
.m2w-cozy-substat__fill--warm {
  background: linear-gradient(90deg, #8a2808, #d04010, #ff7020);
  box-shadow: 0 0 4px rgba(220,80,10,.5);
}
.m2w-cozy-substat__fill--food {
  background: linear-gradient(90deg, #2a4a10, #4a8020, #80c040);
  box-shadow: 0 0 4px rgba(80,180,40,.4);
}
.m2w-cozy-substat__fill--sang {
  background: linear-gradient(90deg, #2a1050, #6030a0, #b060ff);
  box-shadow: 0 0 4px rgba(160,80,255,.5);
}
.m2w-cozy-substat__fill--rest {
  background: linear-gradient(90deg, #102850, #2050a0, #4080e0);
  box-shadow: 0 0 4px rgba(60,120,220,.5);
}
.m2w-cozy-substat__pct {
  font-family: monospace;
  font-size: 8px;
  color: #906040;
  text-align: right;
}

/* ── High Vibe Day info text ──────────────────────────────────────────────── */
.m2w-cozy-info {
  margin-top: 8px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 11px;
  line-height: 1.5;
  color: #806040;
  font-style: italic;
}
.m2w-cozy-info__earned {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  color: #e0a040;
  letter-spacing: .03em;
}

/* ── Star reward toast ───────────────────────────────────────────────────── */
.m2w-cozy-star-toast {
  position: fixed;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #180c00, #2c1808);
  border: 1px solid #d4a020;
  border-radius: 6px;
  padding: 10px 24px;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 14px;
  color: #ffd060;
  font-style: italic;
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 3200;
  opacity: 0;
  box-shadow: 0 0 28px rgba(220,160,20,.4), 0 8px 20px rgba(0,0,0,.65);
  transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.4,.64,1);
  white-space: nowrap;
}
.m2w-cozy-star-toast--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.m2w-cozy-star-toast__icon {
  font-size: 16px;
  line-height: 1;
  color: #ffd060;
  filter: drop-shadow(0 0 4px rgba(255,200,40,.6));
}
.m2w-cozy-star-toast__text { color: #ffd060; }
/* Ghost variant — dimmer, cool-toned, guest mode */
.m2w-cozy-star-toast--ghost {
  background: linear-gradient(135deg, #0e0e18, #1a1828);
  border-color: rgba(140,120,200,0.45);
  box-shadow: 0 0 24px rgba(120,100,200,0.25), 0 8px 20px rgba(0,0,0,.65);
}
.m2w-cozy-star-toast--ghost .m2w-cozy-star-toast__icon { color: rgba(200,180,255,0.7); filter: none; }
.m2w-cozy-star-toast--ghost .m2w-cozy-star-toast__text { color: rgba(180,160,240,0.75); }

/* ── Guest ghost-star nudge banner ──────────────────────────────────────── */
.m2w-guest-nudge {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 3100;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
  width: min(92vw, 440px);
}
.m2w-guest-nudge--on {
  opacity: 1; transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.m2w-guest-nudge__inner {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(60,40,100,0.22) 0%, transparent 55%),
    linear-gradient(160deg, #16102a 0%, #0f0d1e 100%);
  border: 1px solid rgba(160,120,220,0.30);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(200,160,255,0.06),
    0 0 32px rgba(100,60,200,0.18),
    0 8px 40px rgba(0,0,0,0.7);
  padding: 18px 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  position: relative;
}
.m2w-guest-nudge__close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none;
  color: rgba(160,130,200,0.4);
  font-size: 13px; cursor: pointer;
  line-height: 1; padding: 2px 4px;
  transition: color 0.15s;
}
.m2w-guest-nudge__close:hover { color: rgba(210,180,255,0.9); }
.m2w-guest-nudge__orn {
  font-family: var(--m2w-serif);
  font-size: 10px; letter-spacing: 5px;
  color: rgba(160,120,220,0.4);
}
.m2w-guest-nudge__title {
  font-family: var(--m2w-serif);
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 700; letter-spacing: 2px;
  color: rgba(210,190,255,0.85);
  text-transform: uppercase;
}
.m2w-guest-nudge__body {
  font-family: var(--m2w-serif);
  font-size: clamp(11px, 2.5vw, 13px);
  color: rgba(170,150,220,0.65);
  line-height: 1.55;
}
.m2w-guest-nudge__body strong { color: rgba(200,180,255,0.85); }
.m2w-guest-nudge__body em { color: rgba(140,120,180,0.55); font-style: italic; }
.m2w-guest-nudge__cta {
  font-family: var(--m2w-serif);
  font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(100,60,180,0.5), rgba(70,40,140,0.4));
  border: 1px solid rgba(160,120,240,0.45);
  border-radius: 20px;
  color: rgba(220,200,255,0.9);
  padding: 8px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px rgba(120,80,220,0.25);
}
.m2w-guest-nudge__cta:hover {
  background: linear-gradient(135deg, rgba(130,80,220,0.65), rgba(90,55,180,0.55));
  border-color: rgba(200,160,255,0.65);
  box-shadow: 0 0 22px rgba(140,90,240,0.4);
  transform: scale(1.03);
}
.m2w-guest-nudge__sub {
  font-family: var(--m2w-serif);
  font-size: 9px; letter-spacing: 2px;
  color: rgba(120,100,160,0.4);
  text-transform: uppercase;
}

/* ── Marc NPC — speech bubble & dialogue panel ───────────────────────────── */
.m2w-marc-greet {
  position: fixed;
  z-index: 1100;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.34,1.4,.64,1);
  filter: drop-shadow(0 4px 14px rgba(80,20,140,0.8));
}
.m2w-marc-greet--on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 18px));
}
.m2w-marc-greet__bubble {
  background: linear-gradient(145deg, #0e0818 0%, #1a0e30 100%);
  border: 1.5px solid #7040c0;
  border-radius: 9px;
  padding: 9px 16px 10px;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.6),
    0 6px 24px rgba(0,0,0,0.85),
    0 0 20px rgba(100,40,200,0.2),
    inset 0 1px 0 rgba(160,100,240,0.1);
  position: relative;
  white-space: nowrap;
}
.m2w-marc-greet__bubble::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #7040c0;
  border-bottom: none;
}
.m2w-marc-greet__bubble::before {
  content: '';
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #1a0e30;
  border-bottom: none;
  z-index: 1;
}
.m2w-marc-greet__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  color: #c090ff;
  letter-spacing: .06em;
  text-shadow: 0 0 12px rgba(160,80,255,0.5), 0 1px 4px rgba(0,0,0,0.9);
}
.m2w-marc-greet__prompt {
  text-align: center;
  margin-top: 7px;
  font-family: monospace;
  font-size: 11px;
  color: #8050c0;
  letter-spacing: .12em;
}
.m2w-marc-greet__prompt kbd {
  display: inline-block;
  background: rgba(120,60,200,0.15);
  border: 1px solid rgba(120,60,200,0.5);
  border-radius: 3px;
  padding: 0 5px;
  font-family: monospace;
  font-size: 11px;
  color: #c090ff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
  text-shadow: none;
}
/* Marc dialogue panel */
.m2w-marc-dialogue {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2200;
  background: rgba(5,2,12,0.80);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}
.m2w-marc-dialogue--open {
  opacity: 1;
  pointer-events: all;
}
.m2w-marc-dlg__inner {
  width: min(540px, 92vw);
  background: linear-gradient(158deg, #0a0618 0%, #08041a 60%, #0c0820 100%);
  border: 1.5px solid #4a2880;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(100,40,200,0.2),
    0 0 60px rgba(80,20,180,0.18),
    0 24px 60px rgba(0,0,0,0.85),
    inset 0 0 60px rgba(60,20,120,0.05);
  overflow: hidden;
}
.m2w-marc-dlg__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #2a1050;
  background: linear-gradient(180deg, rgba(80,20,180,.07) 0%, transparent 100%);
}
.m2w-marc-dlg__rune {
  font-size: 22px;
  color: #7040c0;
  line-height: 1;
  text-shadow: 0 0 18px rgba(120,60,220,.6);
  flex-shrink: 0;
}
.m2w-marc-dlg__name {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 18px;
  color: #b080f0;
  letter-spacing: .18em;
  text-shadow: 0 0 20px rgba(160,90,240,.4), 0 2px 4px rgba(0,0,0,.6);
}
.m2w-marc-dlg__body {
  padding: 20px 24px 16px;
}
.m2w-marc-dlg__text {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  color: #d0b0f0;
  line-height: 1.65;
  letter-spacing: .03em;
  min-height: 56px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  margin-bottom: 18px;
}
.m2w-marc-dlg__choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m2w-marc-dlg__choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid rgba(100,50,180,0.25);
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 13.5px;
  color: #9070c0;
  text-align: left;
  transition: background .14s, border-color .14s, color .14s;
}
.m2w-marc-dlg__choice:hover {
  background: rgba(100,50,180,0.10);
  border-color: rgba(140,80,220,0.5);
  color: #c090f0;
}
.m2w-marc-dlg__choice-num {
  font-family: monospace;
  font-size: 11px;
  color: #4a2880;
  min-width: 14px;
  flex-shrink: 0;
}
.m2w-marc-dlg__foot {
  padding: 10px 24px 14px;
  border-top: 1px solid #1a0a30;
  font-family: monospace;
  font-size: 10px;
  color: #3a2060;
  letter-spacing: .12em;
}
.m2w-marc-dlg__foot kbd {
  display: inline-block;
  background: rgba(80,40,160,0.12);
  border: 1px solid rgba(80,40,160,0.35);
  border-radius: 3px;
  padding: 0 5px;
  color: #7050a0;
  font-family: monospace;
  font-size: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════════════════════════
   INN SLEEP CUTSCENE OVERLAY
═══════════════════════════════════════════════════════════════════ */
.m2w-inn-sleep {
  position: fixed; inset: 0; z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.m2w-inn-sleep--on {
  opacity: 1;
  pointer-events: all;
}
.m2w-inn-sleep__bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, #0a0810 0%, #020104 100%);
}
.m2w-inn-sleep__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
}
.m2w-inn-sleep__zzz {
  font-size: 48px; color: #c8c0e8;
  text-shadow: 0 0 18px rgba(180,160,255,.5);
  display: flex; gap: 12px;
  font-family: serif; font-style: italic;
}
.m2w-zzz {
  display: inline-block;
  animation: m2w-zzz-float 2.4s ease-in-out infinite;
  opacity: 0;
}
.m2w-zzz--1 { font-size: 32px; animation-delay: 0s; }
.m2w-zzz--2 { font-size: 54px; animation-delay: 0.6s; }
.m2w-zzz--3 { font-size: 40px; animation-delay: 1.2s; }
@keyframes m2w-zzz-float {
  0%   { opacity: 0; transform: translateY(10px) scale(0.7); }
  20%  { opacity: 1; }
  60%  { opacity: 1; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.1); }
}
.m2w-inn-sleep__text {
  font-size: 18px; color: #a098b8;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  font-style: italic;
  text-align: center;
  text-shadow: 0 0 12px rgba(120,100,180,.4);
  min-height: 28px;
  transition: opacity 0.8s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CAPACITY VEIL — shown when shared-host concurrent-player cap is reached
═══════════════════════════════════════════════════════════════════════════ */
.m2w-capacity-veil {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(40,24,10,0.92) 0%, rgba(10,6,2,0.97) 85%);
  z-index: 9500;
  display: grid; place-items: center;
  font-family: 'Courier New', Courier, monospace;
  color: rgba(255,220,160,0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 360ms ease;
}
.m2w-capacity-veil--hidden { opacity: 0; pointer-events: none; }
.m2w-capacity-card {
  max-width: 440px; padding: 42px 34px;
  border: 2px solid rgba(210,170,90,0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30,18,8,0.96), rgba(16,10,4,0.96));
  box-shadow: 0 0 40px rgba(255,180,80,0.22), 0 10px 28px rgba(0,0,0,0.6);
  text-align: center;
  position: relative;
}
.m2w-capacity-orn { color: rgba(255,200,120,0.45); letter-spacing: 8px; font-size: 12px; margin: 0 0 8px; }
.m2w-capacity-card .m2w-capacity-orn + .m2w-capacity-orn { margin: 12px 0 0; }
.m2w-capacity-title {
  font-size: 22px; letter-spacing: 4px; text-transform: uppercase;
  color: #ffdfa0; margin: 6px 0 10px;
  text-shadow: 0 0 18px rgba(255,200,90,0.35);
}
.m2w-capacity-sub { font-size: 12px; opacity: 0.7; margin-bottom: 18px; letter-spacing: 1px; }
.m2w-capacity-spinner {
  display: inline-block; font-size: 28px; color: rgba(255,210,130,0.85);
  animation: m2wCapSpin 2.6s linear infinite; margin: 8px 0;
  text-shadow: 0 0 18px rgba(255,180,70,0.5);
}
@keyframes m2wCapSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.m2w-capacity-count {
  font-size: 13px; letter-spacing: 2px; opacity: 0.85; margin: 12px 0 18px;
  color: #ffd7a0;
}
.m2w-capacity-hint { font-size: 11px; opacity: 0.55; font-style: italic; letter-spacing: 0.5px; line-height: 1.5; }

/* Mobile tuning */
@media (max-width: 500px) {
  .m2w-capacity-card { max-width: calc(100vw - 40px); padding: 32px 22px; }
  .m2w-capacity-title { font-size: 18px; letter-spacing: 3px; }
}
