/* ════════════════════════════════════════════════════════════════════════
   MARSHALFIELD · main menu
   Text menu down the left over the live battle, event cards on the right,
   profile banner top-right, utility icons bottom-left.
   ════════════════════════════════════════════════════════════════════════ */
#title.active { display: block; background: none; overflow: hidden; animation: none; }
.tt-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 4, 2, 0.94) 0%, rgba(7, 4, 2, 0.82) 22%, rgba(7, 4, 2, 0.4) 42%, rgba(7, 4, 2, 0) 58%),
    linear-gradient(270deg, rgba(7, 4, 2, 0.6) 0%, rgba(7, 4, 2, 0) 30%),
    linear-gradient(0deg, rgba(7, 4, 2, 0.75) 0%, rgba(7, 4, 2, 0) 26%),
    linear-gradient(180deg, rgba(7, 4, 2, 0.55) 0%, rgba(7, 4, 2, 0) 18%);
  animation: tt-shade-in 1.2s ease both; }
@keyframes tt-shade-in { from { opacity: 0; } }
/* drifting embers */
.tt-shade::before, .tt-shade::after { content: ''; position: absolute; inset: -20% 0 0 0; opacity: 0.55;
  background-image:
    radial-gradient(circle, rgba(255, 190, 90, 0.9) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(255, 140, 60, 0.8) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 220, 140, 0.7) 0 1.5px, transparent 2.4px);
  background-size: 310px 290px, 220px 330px, 470px 410px; background-position: 20px 40px, 140px 160px, 260px 90px;
  animation: tt-embers 26s linear infinite; -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.6) 50%, transparent 90%); mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.6) 50%, transparent 90%); }
.tt-shade::after { opacity: 0.35; background-size: 380px 350px, 260px 300px, 520px 460px; animation-duration: 38s; animation-direction: normal; filter: blur(1px); }
@keyframes tt-embers { to { transform: translateY(-20%); background-position: 60px -250px, 100px -170px, 300px -320px; } }

/* ── left column ─────────────────────────────────────────────────────── */
.tt-left { position: absolute; z-index: 2; top: 0; bottom: 0; left: clamp(26px, 5.2vw, 104px); width: min(500px, 42vw);
  display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 5vh, 60px) 0 clamp(80px, 12vh, 120px); }
#title .title-logo { text-align: left; animation: none; margin: 0 0 0 -12px; }
#title .title-logo img { margin: 0; max-width: min(430px, 40vw); max-height: 25vh; animation: tt-logo-in 1s var(--u-ease) both, u-float 8s ease-in-out 1s infinite;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 46px rgba(240, 170, 60, 0.16)); }
@keyframes tt-logo-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); filter: blur(6px); } }
#title .tagline { text-align: left; display: flex; align-items: center; gap: 14px; margin: 8px 0 0; font: 700 12.5px var(--caps); letter-spacing: 0.42em !important; color: var(--u-gold-mid) !important; animation: tt-fade-r 0.8s var(--u-ease) 0.25s both; }
#title .tagline::before { content: ''; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--u-gold)); }
@keyframes tt-fade-r { from { opacity: 0; transform: translateX(-18px); } }

.menu.tm { width: auto; margin: clamp(18px, 4vh, 40px) 0 0; gap: 0; display: flex; flex-direction: column; align-items: flex-start; }
.tm-item { --d: 0s; position: relative; display: block; text-align: left; cursor: pointer; background: none; border: 0; color: rgba(246, 233, 204, 0.78);
  padding: 7px 26px 7px 34px; margin-left: -34px; border-radius: 0 999px 999px 0;
  font: 700 clamp(19px, 1.75vw, 25px)/1.12 var(--caps); letter-spacing: 0.07em; text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  transition: color 0.25s, transform 0.35s var(--u-ease), letter-spacing 0.35s var(--u-ease);
  animation: tt-item-in 0.7s var(--u-ease) var(--d) both; }
.tm-item::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(90deg, rgba(232, 184, 74, 0.2), rgba(232, 184, 74, 0.06) 60%, transparent);
  clip-path: inset(0 100% 0 0); transition: clip-path 0.45s var(--u-ease); }
.tm-label { position: relative; display: inline-block; }
.tm-label::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: linear-gradient(90deg, var(--u-gold-mid), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--u-ease); }
.tm-mark { position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; transform: rotate(45deg) scale(0);
  background: var(--u-gold-hi); box-shadow: 0 0 0 2px rgba(232, 184, 74, 0.3), 0 0 14px var(--u-gold); transition: transform 0.35s var(--u-spring); }
.tm-item small { display: block; margin-top: 3px; font: italic 400 15px var(--serif); letter-spacing: 0.01em; text-transform: none; color: var(--u-mut); transition: color 0.25s; }
.tm-item:hover, .tm-item:focus-visible { color: #fff; transform: translateX(10px); outline: none; }
.tm-item:hover::before, .tm-item:focus-visible::before { clip-path: inset(0 0 0 0); }
.tm-item:hover .tm-label::after, .tm-item:focus-visible .tm-label::after { transform: scaleX(1); }
.tm-item:hover .tm-mark, .tm-item:focus-visible .tm-mark { transform: rotate(45deg) scale(1); }
.tm-item:hover small { color: var(--u-text2); }
.tm-item:active { transform: translateX(10px) scale(0.98); }
@keyframes tt-item-in { from { opacity: 0; transform: translateX(-26px); } }

.tm-primary { margin-bottom: 10px; padding-top: 4px; padding-bottom: 10px; }
.tm-primary .tm-label { font: 900 clamp(34px, 3.4vw, 50px)/1 var(--deco); letter-spacing: 0.01em; text-transform: none;
  background: linear-gradient(180deg, #fff8dc 5%, #f6cf6a 45%, #c88f2a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(60, 30, 5, 0.9)) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.7)); text-shadow: none; }
.tm-primary .tm-label::after { bottom: -6px; height: 2px; }
.tm-primary .tm-mark { width: 13px; height: 13px; margin-top: -14px; left: 10px; }
.tm-primary small { font-size: 16.5px; margin-top: 7px; color: var(--u-text2); }
.tm-primary:hover .tm-label { filter: drop-shadow(0 3px 0 rgba(60, 30, 5, 0.9)) drop-shadow(0 0 22px rgba(255, 200, 90, 0.45)); }
.tm-primary::after { content: 'Play'; position: absolute; top: 12px; left: calc(100% - 8px); padding: 4px 9px 3px; border-radius: 6px; font: 900 10.5px var(--caps); letter-spacing: 0.2em; text-transform: uppercase;
  color: #2a1708; background: var(--u-gold-grad); box-shadow: 0 4px 12px rgba(240, 170, 60, 0.35); opacity: 0; transform: translateX(-8px); transition: opacity 0.25s, transform 0.35s var(--u-ease); text-shadow: none; }
.tm-primary:hover::after { opacity: 1; transform: none; }

.tm-minor { font-size: clamp(14px, 1.15vw, 16.5px); letter-spacing: 0.14em; color: var(--u-mut); padding-top: 5px; padding-bottom: 5px; }
.tm-minor .tm-mark { width: 7px; height: 7px; margin-top: -3.5px; left: 13px; }
.tm-sep { width: 220px; height: 1px; margin: 12px 0 10px; background: linear-gradient(90deg, var(--u-line2), transparent); animation: tt-item-in 0.7s var(--u-ease) 0.62s both; }
.tm > :nth-child(1) { --d: 0.3s; } .tm > :nth-child(2) { --d: 0.38s; } .tm > :nth-child(3) { --d: 0.44s; } .tm > :nth-child(4) { --d: 0.5s; }
.tm > :nth-child(5) { --d: 0.56s; } .tm > :nth-child(6) { --d: 0.62s; } .tm > :nth-child(8) { --d: 0.7s; } .tm > :nth-child(9) { --d: 0.75s; } .tm > :nth-child(10) { --d: 0.8s; }

/* bottom-left utility icons */
.tt-foot { position: absolute; left: 0; bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px)); display: flex; align-items: center; gap: 10px; animation: tt-fade-r 0.8s var(--u-ease) 0.9s both; }
.tt-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: var(--u-gold-hi);
  background: rgba(14, 9, 5, 0.6); border: 1px solid var(--u-line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.25s var(--u-spring), border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.25s; }
.tt-icon svg { width: 21px; height: 21px; fill: currentColor; transition: transform 0.4s var(--u-ease); }
.tt-icon:hover { transform: translateY(-3px); border-color: var(--u-gold); color: #fff; background: rgba(30, 20, 10, 0.85); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 16px rgba(232, 184, 74, 0.22); }
.tt-icon[data-act="settings"]:hover svg { transform: rotate(60deg); }
#title .ig-link { position: static; transform: none; width: auto; padding: 0 16px 0 12px !important; gap: 9px; border-radius: 12px; font: 700 13px var(--caps); letter-spacing: 0.08em; color: var(--u-gold-hi); text-decoration: none; display: flex; }
#title .ig-link:hover { transform: translateY(-3px); }
#title .ig-link span:empty { display: none; }
#title .ig-link:has(span:empty) { padding: 0 !important; width: 44px; justify-content: center; }

/* ── right column: event cards ───────────────────────────────────────── */
.tt-right { position: absolute; z-index: 2; right: clamp(22px, 3.6vw, 72px); bottom: clamp(26px, 6vh, 64px); width: min(370px, 30vw); display: grid; gap: 12px; }
.tt-card { --cc: var(--u-gold); --d: 0.5s; position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 4px; text-align: left; cursor: pointer; color: var(--u-text);
  padding: 15px 18px 14px; border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cc) 14%, rgba(22, 14, 7, 0.9)), rgba(12, 8, 4, 0.9) 60%);
  border: 1px solid color-mix(in srgb, var(--cc) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.1), 0 14px 34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1);
  transition: transform 0.35s var(--u-ease), border-color 0.25s, box-shadow 0.35s;
  animation: tt-card-in 0.8s var(--u-ease) var(--d) both; }
.tt-card::before { content: ''; position: absolute; z-index: -1; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cc); box-shadow: 0 0 12px var(--cc); opacity: 0.85; }
.tt-card:hover { transform: translateY(-4px) translateX(-4px); border-color: color-mix(in srgb, var(--cc) 75%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.14), 0 22px 44px rgba(0, 0, 0, 0.6), 0 0 30px color-mix(in srgb, var(--cc) 28%, transparent); }
.tt-card:active { transform: translateY(-1px) scale(0.99); }
@keyframes tt-card-in { from { opacity: 0; transform: translateX(40px); } }
.tt-card-art { position: absolute; z-index: -1; right: -14px; top: -16px; width: 120px; height: 120px; opacity: 0.13; transform: rotate(-12deg); transition: transform 0.6s var(--u-ease), opacity 0.3s; }
.tt-card-art svg { width: 100%; height: 100%; fill: var(--cc); }
.tt-card:hover .tt-card-art { opacity: 0.24; transform: rotate(-4deg) scale(1.08); }
.tt-kicker { display: flex; align-items: center; gap: 8px; font: 900 10.5px var(--caps); letter-spacing: 0.24em; text-transform: uppercase; color: color-mix(in srgb, var(--cc) 75%, #fff); }
.tt-card-title { font: 900 20px/1.15 var(--deco); color: var(--u-text); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.tt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; font: 700 12.5px var(--caps); letter-spacing: 0.04em; color: var(--u-mut); }
.tt-timer { display: inline-flex; align-items: center; gap: 6px; }
.tt-timer::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc) 25%, transparent); }
.tt-prize, .tt-coins { display: inline-flex; align-items: center; gap: 5px; color: #ffd96a; font-weight: 900; }
.tt-prize .coin, .tt-coins .coin { width: 16px; height: 16px; }
.tt-coins { font-size: 16px; }
.tt-owned { color: var(--u-mut); }

.tt-weekly { --cc: #b98aff; --d: 0.45s; padding: 18px 20px 16px; }
.tt-weekly .tt-kicker::after { content: 'Live'; padding: 2px 7px 1px; border-radius: 5px; font-size: 9.5px; letter-spacing: 0.16em; color: #fff; background: #c8402c; box-shadow: 0 0 12px rgba(220, 70, 40, 0.6); animation: tt-live 1.8s ease-in-out infinite; }
@keyframes tt-live { 50% { opacity: 0.55; } }
.tt-weekly .tt-card-title { font-size: 24px; }
.tt-weekly .tt-card-art { width: 150px; height: 150px; }
.tt-weekly .tt-timer::before { animation: tt-live 1.8s ease-in-out infinite; }
.tt-rules { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.tt-rules:empty { display: none; }
.tt-rule { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; font: 700 11.5px var(--caps); letter-spacing: 0.03em; color: var(--u-text);
  background: rgba(185, 138, 255, 0.14); border: 1px solid rgba(185, 138, 255, 0.35); }
.tt-rule i { font-style: normal; font-size: 13px; line-height: 1; }
.tt-daily { --cc: #ff8f4a; --d: 0.55s; }
.tt-armoury { --cc: #f2c25a; --d: 0.65s; }

/* ── profile banner, top right ──────────────────────────────────────── */
#title .me-chip { left: auto; right: max(22px, env(safe-area-inset-right)); top: max(20px, env(safe-area-inset-top)); padding: 6px 20px 6px 8px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 24, 12, 0.88), rgba(14, 9, 5, 0.88)); border: 1px solid var(--u-line2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 170, 0.1); animation: tt-fade-l 0.8s var(--u-ease) 0.4s both; }
#title .me-chip:hover { transform: translateY(-2px); border-color: var(--u-gold); }
#title .me-chip .me-txt b { font-size: 16px; color: var(--u-text); }
#title .me-chip .me-txt small { color: var(--u-gold-mid); font-style: normal; font: 700 11px var(--caps); letter-spacing: 0.12em; text-transform: uppercase; }
@keyframes tt-fade-l { from { opacity: 0; transform: translateX(18px); } }

/* ── shorter desktop windows ─────────────────────────────────────────── */
@media (max-height: 800px) and (min-width: 761px) {
  #title .title-logo img { max-height: 21vh; }
  .menu.tm { margin-top: 16px; }
  .tm-item { padding-top: 5px; padding-bottom: 5px; font-size: clamp(17px, 1.55vw, 21px); }
  .tm-primary .tm-label { font-size: clamp(30px, 3vw, 40px); }
  .tm-primary small { font-size: 15px; margin-top: 4px; }
  .tm-sep { margin: 8px 0 6px; }
  .tt-card { padding: 12px 16px 11px; }
  .tt-weekly { padding: 14px 18px 13px; }
  .tt-card-title { font-size: 18px; } .tt-weekly .tt-card-title { font-size: 21px; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .tm-minor { display: none; } .tm-sep { display: none; }
  .tt-daily { display: none; }
}
/* medium widths: keep the cards from colliding with the menu */
@media (max-width: 1100px) and (min-width: 761px) {
  .tt-left { width: min(440px, 50vw); }
  .tt-right { width: min(320px, 36vw); }
  .tt-armoury { display: none; }
}

/* ── phones: logo, a swipeable row of event cards, then the menu ─────── */
@media (max-width: 760px) {
  #title.active { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: max(64px, calc(env(safe-area-inset-top) + 58px)) 0 max(24px, env(safe-area-inset-bottom)); }
  .tt-shade { position: fixed; background: linear-gradient(0deg, rgba(7, 4, 2, 0.92) 0%, rgba(7, 4, 2, 0.75) 45%, rgba(7, 4, 2, 0.45) 100%); }
  .tt-left { display: contents; }
  #title .title-logo { order: 1; margin: 0 auto; text-align: center; position: relative; z-index: 2; }
  #title .title-logo img { max-width: min(330px, 78vw); max-height: 20vh; margin: 0 auto; }
  #title .tagline { order: 2; justify-content: center; position: relative; z-index: 2; font-size: 10.5px; letter-spacing: 0.34em !important; }
  #title .tagline::before { width: 24px; }
  #title .tagline::after { content: ''; width: 24px; height: 1px; background: linear-gradient(270deg, transparent, var(--u-gold)); }
  .tt-right { order: 3; position: relative; right: auto; bottom: auto; width: 100%; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 20px 6px; scrollbar-width: none; }
  .tt-right::-webkit-scrollbar { display: none; }
  .tt-card, .tt-armoury, .tt-daily { display: grid; flex: 0 0 80%; scroll-snap-align: center; }
  .menu.tm { order: 4; position: relative; z-index: 2; margin: 14px 22px 0; align-items: stretch; }
  .tm-item { margin-left: 0; padding: 10px 14px 10px 30px; border-radius: 12px; font-size: 17px; }
  .tm-item:hover, .tm-item:focus-visible { transform: none; }
  .tm-item::before { clip-path: none; opacity: 0; transition: opacity 0.25s; } .tm-item:hover::before, .tm-item:active::before { opacity: 1; }
  .tm-mark { left: 11px; transform: rotate(45deg) scale(0.6); opacity: 0.6; }
  .tm-primary { padding: 14px 16px 14px 30px; margin-bottom: 6px; background: linear-gradient(90deg, rgba(232, 184, 74, 0.14), rgba(232, 184, 74, 0.03)); border: 1px solid var(--u-line2); }
  .tm-primary .tm-label { font-size: 30px; }
  .tm-primary .tm-mark { transform: rotate(45deg) scale(1); opacity: 1; margin-top: -12px; }
  .tm-primary::after { display: none; }
  .tm-minor { font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
  .tm-sep { width: auto; margin: 8px 14px; }
  .tt-foot { order: 5; position: relative; left: auto; bottom: auto; z-index: 2; justify-content: center; margin: 18px auto 0; }
  #title .me-chip { right: 12px; top: max(10px, env(safe-area-inset-top)); padding: 4px 14px 4px 6px; }
}
@media (max-width: 760px) and (max-height: 640px) { #title .title-logo img { max-height: 15vh; } }

/* ── large displays ─────────────────────────────────────────────────── */
@media (min-width: 1800px) and (min-height: 980px) { .tt-left, .tt-right, #title .me-chip { zoom: 1.2; } }
@media (min-width: 2300px) and (min-height: 1200px) { .tt-left, .tt-right, #title .me-chip { zoom: 1.38; } }

@media (prefers-reduced-motion: reduce) {
  .tt-shade, .tt-shade::before, .tt-shade::after, #title .title-logo img, #title .tagline, .tm-item, .tm-sep, .tt-foot, .tt-card, #title .me-chip, .tt-weekly .tt-kicker::after, .tt-timer::before { animation: none !important; }
}
/* while the sandbox drawer previews a battlefield, the menu steps aside */
#title :is(.tt-left, .tt-right, .me-chip, .tt-shade) { transition: opacity 0.35s ease, transform 0.45s var(--u-ease); }
body:has(#modal.preview.show) #title :is(.tt-left, .tt-right, .me-chip, .tt-shade) { opacity: 0; transform: translateX(-30px); pointer-events: none; }
@media (max-width: 760px) {
  #title .title-logo, #title .tagline, .tt-right, .menu.tm, .tt-foot { flex-shrink: 0; }
}
