/* Premium chrome for /world: frosted dark-glass toolbar with a gold hairline,
   line icons (world-icons.js), weapon bar / HP / quest tracker frames, touch
   buttons, and the "skip the game" links. Loaded after world-responsive.css. */

:root {
  --chrome-ink: #f4efe0;
  --chrome-gold: #f3dc9b;
  --chrome-gold-soft: #f3dc9b3d;
  --chrome-gold-faint: #f3dc9b1f;
  --chrome-glass: linear-gradient(180deg, #16352acc, #0d1f18d9);
  --chrome-dark: #10261e;
}

/* ---------- icons ---------- */
.wi {
  --wi-accent: var(--chrome-gold);
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  max-width: none;
  overflow: visible;
}
.wi .a {
  stroke: var(--wi-accent);
}
.wi .af {
  fill: var(--wi-accent);
  stroke: none;
}
.wi .f {
  fill: currentColor;
  stroke: none;
}
[data-icon] {
  display: inline-grid;
  place-items: center;
}

/* ---------- toolbar ---------- */
.world-toolbar {
  height: 56px;
  gap: 16px;
  padding: 0 10px 0 9px;
  border: 1px solid #f3dc9b33;
  border-radius: 16px;
  background: var(--chrome-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 12px 32px #07120d55,
    inset 0 1px 0 #ffffff14;
  color: var(--chrome-ink);
}
/* Inner gold hairline + a bottom ornament line with a centre diamond. */
.world-toolbar::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--chrome-gold-faint);
  border-radius: 13px;
  pointer-events: none;
}
.world-toolbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: var(--chrome-dark);
  border: 1px solid #f3dc9b99;
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}

.world-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  height: 40px;
  padding: 0 12px 0 2px;
  border-radius: 12px;
  background: none;
  color: var(--chrome-ink);
  text-decoration: none;
  font: inherit;
  letter-spacing: normal;
  transition: background 0.18s;
}
.world-brand:hover {
  background: #f3dc9b14;
}
.world-brand:focus-visible {
  outline: 2px solid var(--chrome-gold);
  outline-offset: 2px;
}
.world-brand .brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffaf0, #eadcb6 70%, #d9c48f);
  color: #1d3a2b;
  font: 800 19px/1 Georgia, "Yu Mincho", serif;
  letter-spacing: -0.08em;
  box-shadow:
    0 0 0 1.5px var(--chrome-dark),
    0 0 0 2.5px #f3dc9bb3,
    0 3px 10px #0006;
}
.world-brand .brand-mark span {
  color: #a8874d;
}
.world-brand .brand-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #e9e2cd;
}
.world-brand:hover .brand-label {
  color: #fff6dc;
}

.world-area {
  position: relative;
  padding-inline-start: 16px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.22em;
  color: #e9e2cdcc;
  opacity: 1;
}
.world-area::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--chrome-gold);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.8;
}

.world-actions {
  align-items: center;
  gap: 4px;
}
.toolbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: linear-gradient(180deg, #f3dc9b00, #f3dc9b66, #f3dc9b00);
}
.world-toolbar wa-button::part(base) {
  --wa-color-neutral-0: transparent;
  min-height: 38px;
  height: 38px;
  padding-inline: 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--chrome-ink);
  box-shadow: none;
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s;
}
.world-toolbar wa-button::part(label) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.world-toolbar wa-button:hover::part(base) {
  background: #f3dc9b14;
  border-color: #f3dc9b40;
  color: #fff6dc;
}
.world-toolbar wa-button:active::part(base),
.world-toolbar wa-button[aria-pressed="true"]::part(base) {
  background: #f3dc9b24;
  border-color: #f3dc9b66;
}
.world-toolbar wa-button:focus-visible::part(base) {
  outline: 2px solid var(--chrome-gold);
  outline-offset: 1px;
}
.world-toolbar wa-button .wi {
  width: 19px;
  height: 19px;
  color: #f4efe0;
}
.world-toolbar wa-button:hover .wi {
  color: #fff;
}
#sound-toggle[aria-pressed="true"] .wi {
  opacity: 0.75;
}
#sound-toggle::part(base),
#fullscreen-toggle::part(base) {
  padding-inline: 9px;
}

.language-label select {
  height: 34px;
  padding: 0 26px 0 10px;
  border: 1px solid #f3dc9b40;
  border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23f3dc9b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      right 8px center / 12px no-repeat,
    #0d1f1899;
  color: var(--chrome-ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.language-label select:hover {
  border-color: #f3dc9b80;
}
.language-label select option {
  background: #10261e;
  color: #fff;
}

/* ---------- quest tracker ---------- */
.quest-tracker {
  padding: 2px 0 4px 14px;
}
.quest-tracker::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, #f3dc9bcc, #f3dc9b00);
}
.quest-name {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.06em;
}
.quest-diamond {
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-start: -18px;
  border: 1px solid #fff6dc;
  background: linear-gradient(135deg, #ffe9a8, #d8a842);
  transform: rotate(45deg);
  box-shadow: 0 0 6px #f3dc9b99;
}
.quest-compass {
  gap: 7px;
  padding: 3px 11px 3px 3px;
  border: 1px solid #f3dc9b47;
  background: #10261ed9;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
#quest-arrow {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 40% 35%, #fff3cf, #e6c578);
  box-shadow: 0 0 0 1px #10261e, 0 0 8px #f3dc9b66;
  color: #10261e;
  font-size: 0;
}
#quest-arrow .wi {
  width: 13px;
  height: 13px;
}
.objective-arrow .wi {
  width: 14px;
  height: 14px;
  color: var(--chrome-gold);
  filter: drop-shadow(0 0 3px #000c);
}

/* ---------- HP / EXP ---------- */
.hp-track {
  height: 8px;
  background: #0a1a14cc;
  box-shadow:
    0 0 0 1px #10261e,
    0 0 0 2px #f3dc9b59;
}
.hp-row {
  position: relative;
}
.hp-row::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-inline-start: -2px;
  background: var(--chrome-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px #10261e;
}
.hp-level {
  padding: 2px 9px;
  border-radius: 6px;
  background: linear-gradient(180deg, #16352a, #0d1f18);
  box-shadow:
    0 0 0 1px #10261e,
    0 0 0 2px #f3dc9b80;
}
.xp-track {
  height: 3px;
  box-shadow: 0 0 0 1px #f3dc9b2e;
}
#hp-text {
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ---------- weapon bar ---------- */
.weapon-bar {
  gap: 10px;
}
.weapon-bar button {
  padding: 0;
  border: 1px solid #f3dc9b4d;
  background: radial-gradient(circle at 50% 35%, #1d4434e6, #0b1b15f0);
  box-shadow:
    inset 0 0 0 3px #0b1b15,
    inset 0 0 0 4px #f3dc9b1f,
    0 4px 12px #0006;
  color: #e9e2cd;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    color 0.18s;
}
.weapon-bar button .wi {
  width: 22px;
  height: 22px;
}
.weapon-bar button:hover:not(:disabled) {
  border-color: #f3dc9b99;
  color: #fff;
}
.weapon-bar button[aria-pressed="true"] {
  border-color: var(--chrome-gold);
  color: #fff6dc;
  box-shadow:
    inset 0 0 0 3px #0b1b15,
    inset 0 0 0 4px #f3dc9b55,
    0 0 0 2px #f3dc9b40,
    0 0 16px #f3dc9b55;
}
.weapon-bar button[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--chrome-gold);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 0 0 1px #10261e;
}
.weapon-bar kbd {
  right: -3px;
  bottom: -3px;
  min-width: 15px;
  padding: 1px 3px;
  border-radius: 4px;
  background: #10261e;
  color: var(--chrome-gold);
  box-shadow: 0 0 0 1px #f3dc9b80;
  font-size: 9.5px;
  text-align: center;
}
.weapon-bar button:disabled {
  filter: none;
  opacity: 0.38;
}
.weapon-toast-icon {
  color: #fff;
}
.weapon-toast-icon .wi {
  width: 30px;
  height: 30px;
  --wi-accent: #fff6dc;
}
.weapon-toast.duplicate .weapon-toast-icon .wi {
  width: 20px;
  height: 20px;
}
.bag-icon.weapon-icon {
  color: #20352a;
}
.bag-icon.weapon-icon .wi {
  width: 26px;
  height: 26px;
  --wi-accent: #b8913f;
}

/* ---------- touch controls ---------- */
.touch-controls wa-button::part(base) {
  background: radial-gradient(circle at 50% 35%, #1d4434e0, #0b1b15e8);
  border: 1px solid #f3dc9b66;
  box-shadow:
    inset 0 0 0 3px #0b1b1599,
    inset 0 0 0 4px #f3dc9b1f,
    0 6px 18px #0007;
  color: #f4efe0;
}
.touch-controls wa-button::part(label) {
  display: grid;
  place-items: center;
}
.touch-controls wa-button .wi {
  width: 24px;
  height: 24px;
}
.touch-controls .touch-interact::part(base) {
  background: radial-gradient(circle at 45% 35%, #fff0c4, #d9b866 75%);
  border-color: #fff6dc;
  color: #10261e;
  box-shadow:
    0 0 0 3px #10261e99,
    0 0 0 4px #f3dc9b88,
    0 8px 20px #0007;
}
.touch-controls .touch-interact .wi {
  --wi-accent: #10261e;
  width: 30px;
  height: 30px;
}
.touch-controls .touch-heal::part(base) {
  background: radial-gradient(circle at 50% 35%, #1d4434e0, #0b1b15e8);
}
.touch-controls .touch-heal .wi {
  width: 22px;
  height: 22px;
  color: #ffd1dc;
}
.touch-controls wa-button:active::part(base) {
  border-color: var(--chrome-gold);
}
.touch-stick {
  border-color: #f3dc9b55;
  background: radial-gradient(circle, #10261e33, #10261e55);
  box-shadow:
    inset 0 0 0 10px #ffffff0a,
    inset 0 0 0 11px #f3dc9b1f,
    0 8px 25px #15291f26;
}

/* ---------- "skip the game" links ---------- */
.start-classic {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e7e8de;
  font-size: 13.5px;
  color: #8a9686;
}
.start-classic a {
  color: #586b57;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #586b5755;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.start-classic a:hover {
  color: #315c40;
  text-decoration-color: currentColor;
}
.start-classic a:focus-visible,
.loading-classic:focus-visible {
  outline: 2px solid #315c40;
  outline-offset: 3px;
  border-radius: 4px;
}
.loading-classic {
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  color: #31533d;
  font: 600 12.5px/1.3 Inter, "Segoe UI", "Hiragino Sans", sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  background: #ffffff59;
  box-shadow: inset 0 0 0 1px #31533d2e;
  transition: background 0.18s;
}
.loading-classic:hover {
  background: #ffffff99;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) and (pointer: fine) {
  .brand-label {
    display: none;
  }
}
/* Narrow desktop windows: icon-only buttons (titles still give the names). */
@media (max-width: 980px) {
  .world-toolbar .desktop-label,
  .world-area {
    display: none;
  }
  .world-toolbar {
    justify-content: space-between;
  }
  .world-toolbar wa-button::part(label) {
    gap: 0;
  }
}
@media (max-width: 760px), (pointer: coarse) {
  .world-toolbar {
    height: 50px;
    gap: 8px;
    padding: 0 6px;
    border-radius: 14px;
  }
  .world-toolbar::before {
    border-radius: 11px;
  }
  .world-brand {
    height: 36px;
    padding: 0;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }
  .world-actions {
    gap: 2px;
  }
  .toolbar-divider {
    margin: 0 2px;
  }
  .world-toolbar wa-button::part(base) {
    min-height: 36px;
    height: 36px;
    padding-inline: 8px;
  }
  .world-toolbar wa-button::part(label) {
    gap: 0;
  }
  .language-label select {
    height: 32px;
  }
  .weapon-bar button .wi {
    width: 19px;
    height: 19px;
  }
}
@media (max-width: 520px) {
  .start-classic {
    flex-direction: column;
    align-items: flex-start;
  }
  .start-classic span {
    display: none;
  }
  .world-toolbar wa-button::part(base) {
    min-width: 34px;
    padding-inline: 7px;
  }
  .toolbar-divider {
    display: none;
  }
  .language-label select {
    max-width: 62px;
    padding: 0 18px 0 6px;
    background-position:
      right 4px center,
      0 0;
  }
}
@media (max-width: 400px) {
  .world-toolbar wa-button::part(base) {
    min-width: 32px;
    padding-inline: 6px;
  }
}
@media (max-height: 430px) {
  .loading-classic {
    bottom: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .world-toolbar wa-button::part(base),
  .weapon-bar button,
  .world-brand {
    transition: none;
  }
}
