/* ============ MAIN MENU — live island diorama behind calm parchment panels ============ */
#screen-menu { --ink: #24222b; --ink2: #5d5866; --ink3: #8f8896; --paper: rgba(248, 244, 236, .93); --paper2: #efe8da;
  --line: rgba(60, 50, 40, .14); --gold: #c4923a; --gold2: #e8c46a; --red: #b8432f;
  font-family: 'Nunito Sans', 'Segoe UI', sans-serif; color: var(--ink); background: #3a4a6a; }
#screen-menu.active { display: block; overflow-y: auto; overflow-x: hidden; }
#menu-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.menu-shade { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 40%, rgba(20, 18, 30, .35) 100%),
              linear-gradient(180deg, rgba(20, 18, 30, .25), transparent 30%, transparent 70%, rgba(20, 18, 30, .3)); }
.menu-box { position: relative; width: min(1180px, 94vw); margin: 0 auto; padding: 4vh 0 3vh; text-align: center; }
.menu-box svg.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }

/* title */
.menu-head { margin-bottom: 18px; color: #fbf6ea; text-shadow: 0 2px 14px rgba(20, 16, 30, .45); }
.menu-runes { font-size: 13px; letter-spacing: 10px; color: var(--gold2); opacity: .9; margin-bottom: 2px; }
.game-title { font-family: 'Cinzel', serif; font-weight: 900; font-size: clamp(48px, 7vw, 92px); letter-spacing: .14em; line-height: 1;
  text-transform: uppercase; margin: 0; color: #fbf6ea;
  text-shadow: 0 3px 0 rgba(90, 60, 40, .55), 0 10px 30px rgba(20, 16, 30, .5); }
.tagline { font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; margin-top: 10px; opacity: .92; }

/* mode switch */
.menu-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 999px;
  background: rgba(30, 26, 38, .45); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .22); }
.menu-tab { display: flex; align-items: center; gap: 9px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 15px; letter-spacing: .12em;
  text-transform: uppercase; padding: 10px 26px; border-radius: 999px; border: none; cursor: pointer; background: transparent; color: #efe6d4; transition: all .18s; }
.menu-tab:hover { background: rgba(255, 255, 255, .1); }
.menu-tab.sel { background: var(--paper); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.menu-tab .tab-ic { display: flex; }
.menu-tab svg.ic { width: 18px; height: 18px; }

/* panels */
.menu-panel { background: var(--paper); backdrop-filter: blur(14px); border-radius: 14px; padding: 22px 26px 24px; text-align: left;
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 24px 60px rgba(16, 14, 26, .35), inset 0 1px 0 #fff; animation: panelIn .35s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } }
#menu-campaign { width: min(820px, 100%); margin: 0 auto; }
.panel-h { display: flex; align-items: center; gap: 14px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 13px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--ink2); margin: 0 0 14px; }
.panel-h::before, .panel-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.panel-h:not(:first-child) { margin-top: 20px; }

/* clan cards */
.tribe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.tribe-card { position: relative; text-align: center; padding: 16px 12px 14px; border-radius: 12px; cursor: pointer; background: #fffdf8;
  border: 1px solid var(--line); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tribe-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(40, 30, 20, .14); }
.tribe-card.sel { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), 0 12px 28px rgba(40, 30, 20, .18); }
.tribe-card .emblem { display: block; margin: 0 auto 8px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); transition: transform .2s; }
.tribe-card:hover .emblem, .tribe-card.sel .emblem { transform: scale(1.06) rotate(-2deg); }
.tribe-card h3 { font-family: 'Cinzel', serif; font-weight: 700; font-size: 17px; letter-spacing: .06em; margin-bottom: 5px; }
.tribe-card p { font-size: 12px; line-height: 1.4; color: var(--ink2); }

/* call to action */
.cta { position: relative; display: block; margin: 0 auto; padding: 14px 58px; border: none; border-radius: 10px; cursor: pointer;
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 18px; letter-spacing: .2em; text-transform: uppercase; color: #fff8ea;
  background: linear-gradient(180deg, #c95a3e, #9c3624); box-shadow: 0 5px 0 #6e2416, 0 12px 24px rgba(110, 36, 22, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .1s, box-shadow .1s, filter .15s; }
.cta::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(255, 230, 190, .35); border-radius: 7px; pointer-events: none; }
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(4px); box-shadow: 0 1px 0 #6e2416, 0 4px 10px rgba(110, 36, 22, .3); }
.hint { margin-top: 12px; font-size: 12px; color: var(--ink3); text-align: center; letter-spacing: .03em; }
#sound-hint { color: #fbf6ea; opacity: .75; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }

/* quick battle: preset cards */
#qb-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.qb-preset { border-radius: 12px; overflow: hidden; cursor: pointer; background: #fffdf8; border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.qb-preset:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(40, 30, 20, .16); }
.qb-preset.sel { box-shadow: 0 0 0 2px var(--gold), 0 14px 30px rgba(120, 80, 20, .22); }
.qp-art { position: relative; aspect-ratio: 240 / 130; overflow: hidden; background: var(--paper2); }
.qp-art .vig { width: 100%; height: 100%; display: block; transition: transform .5s ease; }
.qb-preset:hover .qp-art .vig { transform: scale(1.06); }
.qp-badge { position: absolute; left: 10px; bottom: -14px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--gold2);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); border: 2px solid #fffdf8; }
.qp-badge svg.ic { width: 18px; height: 18px; }
.qb-preset.sel .qp-badge { background: var(--gold); color: #fff; }
.qp-body { padding: 18px 12px 13px; }
.qp-tag { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.qb-preset h3 { font-family: 'Cinzel', serif; font-weight: 700; font-size: 14.5px; line-height: 1.2; margin: 3px 0 5px; }
.qb-preset p { font-size: 11.5px; line-height: 1.38; color: var(--ink2); }
.qb-preset.custom .qp-body { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(60, 50, 40, .03) 8px 16px); }

/* quick battle: dials */
#qb-dims { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 30px; }
.qb-dim { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.qb-dim label { display: flex; align-items: center; gap: 7px; width: 118px; flex-shrink: 0; padding-top: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.qb-dim label svg.ic { width: 15px; height: 15px; color: var(--gold); }
.qb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.qb-chip { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px;
  border-radius: 999px; cursor: pointer; color: var(--ink2); background: #fffdf8; border: 1px solid var(--line); transition: all .14s; }
.qb-chip svg.ic { width: 14px; height: 14px; opacity: .75; }
.qb-chip .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.qb-chip:hover:not(:disabled) { border-color: rgba(60, 50, 40, .35); color: var(--ink); }
.qb-chip.on { background: var(--ink); color: #fbf3e2; border-color: var(--ink); box-shadow: 0 3px 8px rgba(30, 26, 40, .25); }
.qb-chip.on svg.ic { opacity: 1; color: var(--gold2); }
.qb-chip:disabled { opacity: .3; cursor: default; }

/* quick battle: matchup + go */
.qb-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding-top: 16px; }
.qb-foot .cta { margin: 0; }
#qb-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.sm-side { display: flex; align-items: center; gap: 9px; }
.sm-side b { display: block; font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700; line-height: 1.1; }
.sm-side span { font-size: 12px; color: var(--ink2); font-weight: 600; }
.sm-vs { font-family: 'Cinzel', serif; font-weight: 900; font-size: 14px; color: var(--gold); letter-spacing: .1em; }
#qb-summary em { flex-basis: 100%; font-style: normal; font-size: 12px; color: var(--ink3); letter-spacing: .04em; margin-top: 2px; }

@media (max-width: 1100px) { #qb-presets { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { #qb-dims { grid-template-columns: 1fr; } .tribe-grid { grid-template-columns: repeat(2, 1fr); } .qb-foot { flex-direction: column; } }
.qb-dim.wide { grid-column: span 2; }
@media (max-width: 860px) { .qb-dim.wide { grid-column: auto; } }

/* continue a saved campaign */
.continue-card { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; cursor: pointer;
  background: #fffdf8; border: 1px solid var(--gold); box-shadow: 0 0 0 2px rgba(196,146,58,.25), 0 10px 24px rgba(40,30,20,.12);
  font-family: inherit; color: var(--ink); text-align: left; transition: transform .18s, box-shadow .18s; }
.continue-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold), 0 14px 28px rgba(40,30,20,.16); }
.continue-card .emblem { flex-shrink: 0; filter: drop-shadow(0 3px 5px rgba(0,0,0,.2)); }
.ct-txt { flex: 1; }
.ct-txt b { display: block; font-family: 'Cinzel', serif; font-size: 18px; letter-spacing: .04em; }
.ct-txt small { font-size: 13px; color: var(--ink2); font-weight: 600; }
.ct-go { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--gold2); }
.ct-go svg.ic { width: 18px; height: 18px; }
