/* WoW Hub Оголошення. Below the mobile menu overlay (z-index 100000). */
.wha, .wha * { box-sizing: border-box; }
.wha {
  --wha-bg: #141a26;
  --wha-bg2: #1b2231;
  --wha-line: rgba(200, 155, 60, .35);
  --wha-text: #e3e7ee;
  --wha-muted: #a7b0bf;
  --wha-accent: #c89b3c;
  --wha-accent-2: #f5c542;
  --wha-glow: rgba(200, 155, 60, .28);
  font-family: inherit; font-size: 15px; line-height: 1.5;
  color: var(--wha-text);
}
.wha.wha-lvl-important { --wha-line: rgba(245, 197, 66, .65); --wha-accent: #f5c542; --wha-glow: rgba(245, 197, 66, .35); }
.wha.wha-lvl-urgent, .wha-letter.wha-lvl-urgent { --wha-line: rgba(217, 72, 59, .75); --wha-accent: #e2574a; --wha-accent-2: #ff8a7a; --wha-glow: rgba(217, 72, 59, .38); }
.wha-letter.wha-lvl-important { --wha-line: rgba(245, 197, 66, .65); --wha-accent: #f5c542; }

/* BeTheme styles every <button> (padding 15px 25px, overflow hidden): reset ours. */
.wha button, button.wha { margin: 0; overflow: visible; text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; }
.wha button:hover, .wha button:focus, button.wha:hover, button.wha:focus { background-image: none; }
.wha-title { display: block; font-weight: 700; color: #fff; margin: 0 0 2px; }
.wha-text p { margin: 0 0 6px; }
.wha-text p:last-child { margin-bottom: 0; }
.wha-text a { color: var(--wha-accent-2); text-decoration: underline; text-underline-offset: 2px; }
.wha-more {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 7px; white-space: nowrap; font-size: 13px;
  background: var(--wha-accent); color: #1a1300 !important; font-weight: 700; text-decoration: none !important;
  transition: transform .15s ease, filter .15s ease;
}
.wha-more:hover { transform: translateY(-1px); filter: brightness(1.08); }
.wha-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 8px; }
.wha .wha-btn, .wha-letter .wha-btn {
  min-height: 32px; min-width: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; flex: none;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; color: var(--wha-text); background: var(--wha-bg2);
  border: 1px solid rgba(255, 255, 255, .12); transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.wha .wha-btn:hover, .wha .wha-btn:focus { border-color: var(--wha-line); background: #232b3a; color: #fff; transform: translateY(-1px); }
.wha-btn:focus-visible, .wha-mail-btn:focus-visible, .wha-mail-x:focus-visible, .wha-more:focus-visible { outline: 2px solid var(--wha-accent-2); outline-offset: 2px; }
.wha .wha-btn-dismissed { background: var(--wha-accent); border-color: var(--wha-accent); color: #1a1300; }
.wha .wha-btn-dismissed:hover, .wha .wha-btn-dismissed:focus { background: #ffd76a; border-color: #ffd76a; color: #1a1300; }
.wha a.wha-more:hover, .wha a.wha-more:focus { color: #1a1300 !important; }

/* Strip above the header, two variants: gold (B, solid, most visible) and dark (A, site colours + gold rule). */
.wha-strip { position: relative; z-index: 99990; }
.wha-strip-inner { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 5px 8px 5px 16px; font-size: 14px; line-height: 1.45; }
.wha-strip-content { flex: 1; min-width: 0; }
.wha-strip-content .wha-title { display: inline; margin: 0 6px 0 0; }
.wha-strip-content .wha-title::after { content: "."; }
.wha-strip-content .wha-text, .wha-strip-content .wha-text p { display: inline; }
.wha-strip-content .wha-text p + p::before { content: " "; }
.wha-strip-link, .wha-strip-content .wha-text a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.wha .wha-strip-x, .wha .wha-strip-snooze {
  flex: none; height: 30px; min-height: 0; border: 0; border-radius: 6px; cursor: pointer;
  font-family: inherit; transition: background .15s ease, transform .15s ease;
}
.wha .wha-strip-x { width: 30px; padding: 0; font-size: 20px; line-height: 30px; text-align: center; }
.wha .wha-strip-snooze { padding: 0 10px; font-size: 13px; font-weight: 600; line-height: 30px; white-space: nowrap; }
.wha-strip-x:hover, .wha-strip-snooze:hover { transform: translateY(-1px); }

/* B — gold. Custom colours (admin form) arrive as --wha-s-bg / --wha-s-text / --wha-s-link on the element. */
.wha-strip-gold { background: var(--wha-s-bg, #f5c542); color: var(--wha-s-text, #1d1400); }
.wha-strip-gold .wha-title, .wha-strip-gold .wha-text { color: var(--wha-s-text, #1d1400); }
.wha-strip-gold .wha-strip-link, .wha-strip-gold .wha-text a { color: var(--wha-s-link, var(--wha-s-text, #1d1400)); }
.wha-strip-gold.wha-lvl-urgent { background: var(--wha-s-bg, #d9483b); color: var(--wha-s-text, #fff); }
.wha-strip-gold.wha-lvl-urgent .wha-title, .wha-strip-gold.wha-lvl-urgent .wha-text { color: var(--wha-s-text, #fff); }
.wha-strip-gold.wha-lvl-urgent .wha-strip-link, .wha-strip-gold.wha-lvl-urgent .wha-text a { color: var(--wha-s-link, var(--wha-s-text, #fff)); }

/* A — dark */
.wha-strip-dark { background: var(--wha-s-bg, #141a26); color: var(--wha-s-text, #d8dde6); border-bottom: 1px solid #2a3243; box-shadow: inset 3px 0 0 var(--wha-s-link, #f5c542); }
.wha-strip-dark .wha-text { color: var(--wha-s-text, #d8dde6); }
.wha-strip-dark .wha-title { color: var(--wha-s-text, #f5c542); }
.wha-strip-dark .wha-strip-link, .wha-strip-dark .wha-text a { color: var(--wha-s-link, #f5c542); }
.wha-strip-dark.wha-lvl-urgent { box-shadow: inset 3px 0 0 var(--wha-s-link, #e2574a); }
.wha-strip-dark.wha-lvl-urgent .wha-title { color: var(--wha-s-text, #ff8a7a); }
.wha-strip-dark.wha-lvl-urgent .wha-strip-link, .wha-strip-dark.wha-lvl-urgent .wha-text a { color: var(--wha-s-link, #ff8a7a); }

/* × and «Відкласти»: a tint of the strip's own text colour, readable on any background. */
.wha.wha-strip .wha-strip-x, .wha.wha-strip .wha-strip-snooze { background: rgba(0, 0, 0, .14); color: inherit; }
.wha.wha-strip .wha-strip-x:hover, .wha.wha-strip .wha-strip-snooze:hover,
.wha.wha-strip .wha-strip-x:focus, .wha.wha-strip .wha-strip-snooze:focus { background: rgba(0, 0, 0, .26); color: inherit; }
.wha.wha-strip-dark:not(.wha-strip-custom) .wha-strip-x, .wha.wha-strip-dark:not(.wha-strip-custom) .wha-strip-snooze { background: #1b2231; color: #8b95a7; }
.wha.wha-strip-dark:not(.wha-strip-custom) .wha-strip-x:hover, .wha.wha-strip-dark:not(.wha-strip-custom) .wha-strip-snooze:hover { background: #232b3a; color: #fff; }

/* Only transform / opacity on entry: no height cap stays behind, so long text and buttons never get clipped. */
.wha-strip.is-in { animation: wha-strip-in .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.wha-strip.is-out { animation: wha-strip-out .35s ease-in both; overflow: hidden; }
@keyframes wha-strip-in { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }
@keyframes wha-strip-out { from { max-height: 400px; opacity: 1; } to { max-height: 0; opacity: 0; transform: translateY(-40%); } }

.wha-root { position: relative; z-index: 99990; }

/* C. Quest card bottom-right: slides in, the «!» pulses. */
.wha-quest {
  position: fixed; right: 20px; bottom: 96px; z-index: 99991; width: min(360px, calc(100vw - 32px));
  display: flex; gap: 10px; padding: 12px 14px 12px 12px; border-radius: 12px; font-size: 14px;
  background: linear-gradient(160deg, var(--wha-bg2), var(--wha-bg)); border: 1px solid var(--wha-line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3), 0 0 30px var(--wha-glow);
  opacity: 0; transform: translateX(120%);
}
.wha-quest-mark {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe28a, var(--wha-accent) 70%); color: #1a1300; font: 900 22px/1 Georgia, serif;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 18px var(--wha-glow);
}
.wha-quest.is-in { animation: wha-quest-in .55s cubic-bezier(.18, .9, .25, 1.15) both; }
.wha-quest.is-in .wha-quest-mark { animation: wha-pulse 1.8s .6s ease-in-out 3; }
.wha-quest.is-out { animation: wha-quest-out .35s ease-in both; }
@keyframes wha-quest-in { from { opacity: 0; transform: translateX(120%) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes wha-quest-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(110%); } }
@keyframes wha-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); box-shadow: 0 0 0 3px rgba(0, 0, 0, .35), 0 0 28px var(--wha-glow); } }
.wha-quest-content { flex: 1; min-width: 0; }

/* D. Raid warning: flashes in the middle, never blocks the page. */
.wha-warning {
  position: fixed; left: 50%; top: 22vh; z-index: 99992; width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0;
}
.wha-warning-content {
  pointer-events: none; display: inline-block; max-width: 100%; padding: 18px 28px; border-radius: 14px;
  background: rgba(10, 12, 18, .92); border: 1px solid var(--wha-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 40px var(--wha-glow);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.wha-warning .wha-actions { justify-content: center; pointer-events: auto; }
.wha-warning .wha-more { pointer-events: auto; }
.wha-warning .wha-text a { pointer-events: auto; }
.wha-warning .wha-title { font-family: inherit; font-size: clamp(22px, 4vw, 34px); font-weight: 800; line-height: 1.15; color: var(--wha-accent-2); text-shadow: 0 2px 0 #000, 0 0 24px var(--wha-glow), 0 0 2px #000; letter-spacing: .3px; }
.wha-warning .wha-text { font-size: clamp(15px, 2vw, 18px); color: #fff; text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .9); margin-top: 6px; }
.wha-warning.wha-lvl-normal .wha-title { color: #fff; }
.wha-warning.is-in { animation: wha-warn-in .6s cubic-bezier(.2, .9, .2, 1) both; }
.wha-warning.is-out { animation: wha-warn-out .8s ease-in both; }
@keyframes wha-warn-in { 0% { opacity: 0; transform: translateX(-50%) scale(1.25); filter: blur(4px); } 60% { opacity: 1; transform: translateX(-50%) scale(.98); filter: none; } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes wha-warn-out { to { opacity: 0; transform: translateX(-50%) translateY(-14px); } }

/* B. Mail: envelope bottom-left bounces in; the thread opens like a chat. */
.wha-mail-btn {
  position: fixed; left: 20px; bottom: 24px; z-index: 99991; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; padding: 0; overflow: visible;
  background: radial-gradient(circle at 35% 30%, #273046, #141a26); border: 2px solid var(--wha-accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 0 6px rgba(200, 155, 60, .12);
  opacity: 0; transform: scale(.3);
}
/* The theme repaints hovered buttons (yellow background, white text): keep the envelope's own look. */
button.wha.wha-mail-btn:hover, button.wha.wha-mail-btn:focus, button.wha.wha-mail-btn:active {
  background: radial-gradient(circle at 35% 30%, #313c57, #19202e); border-color: #f5c542; color: #fff3cf;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 0 6px rgba(245, 197, 66, .2);
}
button.wha.wha-mail-btn:hover .wha-mail-icon, button.wha.wha-mail-btn:focus .wha-mail-icon { color: #fff3cf; }
.wha-mail-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #f3dca0; }
.wha-mail-icon svg { display: block; width: 30px; height: 30px; }
.wha-mail-count {
  position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: #d9483b; color: #fff; font-family: inherit; font-size: 13px; font-weight: 800; line-height: 24px; text-align: center; box-shadow: 0 0 0 3px #0b0e14;
  transform: scale(0); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.wha-mail-btn.has-unread .wha-mail-count { transform: scale(1); }
.wha-mail-btn.is-in { animation: wha-mail-in .6s cubic-bezier(.3, 1.5, .5, 1) both; }
.wha-mail-btn.is-in.has-unread { animation: wha-mail-in .6s cubic-bezier(.3, 1.5, .5, 1) both, wha-mail-wiggle 1.2s 1s ease-in-out 2; }
.wha-mail-btn.is-out { animation: wha-pop-out .3s ease-in both; }
@keyframes wha-mail-in { 0% { opacity: 0; transform: translateY(40px) scale(.3); } 70% { opacity: 1; transform: translateY(-6px) scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes wha-mail-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@keyframes wha-pop-out { to { opacity: 0; transform: scale(.4); } }

.wha-mail-panel {
  position: fixed; left: 20px; bottom: 100px; z-index: 99991; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #1b2231, #11161f); border: 1px solid var(--wha-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); transform-origin: 28px calc(100% + 40px); opacity: 0;
}
.wha-mail-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #f3dca0; }
.wha .wha-mail-x { padding: 0; width: 44px; height: 44px; margin: -10px -10px -10px 0; border: 0; background: none; color: var(--wha-muted); font-size: 26px; cursor: pointer; border-radius: 8px; }
.wha-mail-x:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.wha-mail-thread { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.wha-letter {
  position: relative; align-self: flex-start; max-width: 92%; padding: 9px 12px; border-radius: 4px 12px 12px 12px; font-size: 14px;
  background: linear-gradient(170deg, #f1e3bf, #e3cf9e); color: #3b2c12; border-left: 3px solid var(--wha-accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35); animation: wha-bubble-in .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.wha-letter .wha-title { color: #2a1d06; font-family: Georgia, serif; }
.wha-letter .wha-text a { color: #7a4a0c; }
.wha-letter .wha-btn { background: rgba(59, 44, 18, .08); color: #3b2c12; border-color: rgba(59, 44, 18, .25); }
.wha-letter .wha-btn-dismissed { background: #3b2c12; color: #f1e3bf; border-color: #3b2c12; }
.wha .wha-letter .wha-btn:hover, .wha .wha-letter .wha-btn:focus { background: rgba(59, 44, 18, .18); border-color: rgba(59, 44, 18, .45); color: #2a1d06; }
.wha .wha-letter .wha-btn-dismissed:hover, .wha .wha-letter .wha-btn-dismissed:focus { background: #241804; border-color: #241804; color: #fff3d6; }
.wha-letter.is-out { animation: wha-bubble-out .3s ease-in both !important; animation-delay: 0s !important; }
.wha-mail-panel.is-in { animation: wha-panel-in .4s cubic-bezier(.2, .9, .3, 1.1) both; }
.wha-mail-panel.is-out { animation: wha-panel-out .25s ease-in both; }
@keyframes wha-bubble-in { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes wha-bubble-out { to { opacity: 0; transform: translateX(-30px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes wha-panel-in { from { opacity: 0; transform: scale(.6) translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes wha-panel-out { to { opacity: 0; transform: scale(.7) translateY(30px); } }

@media (max-width: 768px) {
  .wha-strip-inner { gap: 6px; padding: 5px 6px 5px 12px; font-size: 13.5px; }
  .wha .wha-btn, .wha .wha-more { min-height: 36px; }
  .wha .wha-strip-x { width: 36px; height: 36px; line-height: 36px; }
  .wha .wha-strip-snooze { height: 36px; line-height: 36px; }
  .wha-btn, .wha-more { padding: 0 12px; }
  .wha-quest { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: auto; border-radius: 14px; max-height: 60vh; overflow-y: auto; }
  .wha-mail-btn { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; }
  .wha-mail-panel { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .wha-warning { top: 16vh; }
}

@media (prefers-reduced-motion: reduce) {
  .wha.is-in, .wha.is-out, .wha-letter, .wha-mail-btn.is-in, .wha-quest.is-in .wha-quest-mark { animation: none !important; transition: opacity .2s ease !important; }
  .wha.is-in, .wha-letter { opacity: 1 !important; transform: none !important; }
  .wha-warning.is-in { transform: translateX(-50%) !important; }
  .wha.is-out { opacity: 0 !important; }
}
