/* css/core-title.css — tela inicial / menu do título (#menu, #title, #start, #boot) e suas animações.
 * v0.74: dividido de core.css SEM mudar a ordem das regras (a cascata depende dela). Ordem de carga: ver index.html. */
/* Tela inicial MMORPG — arte + UI por cima */
  #menu {
    position: fixed; inset: 0; z-index: 40; display: flex;
    align-items: center; justify-content: flex-end; flex-direction: column;
    background:
      radial-gradient(circle at 50% 30%, rgba(80,64,103,0.35) 0, transparent 55%),
      radial-gradient(circle at 20% 80%, rgba(35,80,73,0.22) 0, transparent 40%),
      linear-gradient(154deg, #15131f 0%, #090d15 50%, #05070b 100%);
    color: #d4deea; text-align: center; gap: 0; padding: 0;
    overflow: hidden;
  }
  #menu.hidden { display: none !important; visibility: hidden !important; pointer-events: none !important; }
  #title-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none; display: block;
    background: transparent;
  }
  /* ===== CENA 2D CSS (mobile — substitui o título 3D sem gastar WebGL) ===== */
  #title-scene-2d { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: none; overflow: hidden; }
  #title-scene-2d.on { display: block; }
  #title-scene-2d .stars i {
    position: absolute; width: 2px; height: 2px; border-radius: 50%;
    background: #dfe8ff; opacity: .8; animation: twinkle 3s infinite ease-in-out;
  }
  #title-scene-2d .stars i:nth-child(1) { left: 8%; top: 12%; animation-delay: 0s; }
  #title-scene-2d .stars i:nth-child(2) { left: 20%; top: 6%; animation-delay: .7s; }
  #title-scene-2d .stars i:nth-child(3) { left: 33%; top: 15%; animation-delay: 1.4s; }
  #title-scene-2d .stars i:nth-child(4) { left: 47%; top: 8%; animation-delay: .3s; }
  #title-scene-2d .stars i:nth-child(5) { left: 61%; top: 14%; animation-delay: 1.9s; }
  #title-scene-2d .stars i:nth-child(6) { left: 74%; top: 5%; animation-delay: 1.1s; }
  #title-scene-2d .stars i:nth-child(7) { left: 86%; top: 16%; animation-delay: 2.4s; }
  #title-scene-2d .stars i:nth-child(8) { left: 15%; top: 24%; animation-delay: 2.8s; }
  #title-scene-2d .stars i:nth-child(9) { left: 55%; top: 22%; animation-delay: .9s; }
  #title-scene-2d .stars i:nth-child(10) { left: 92%; top: 26%; animation-delay: 1.6s; }
  #title-scene-2d .stars i:nth-child(11) { left: 4%; top: 32%; animation-delay: 2.1s; }
  #title-scene-2d .stars i:nth-child(12) { left: 68%; top: 28%; animation-delay: .5s; }
  @keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }
  #title-scene-2d .moon {
    position: absolute; right: 14%; top: 10%; width: 64px; height: 64px; border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, #fff8e0 0%, #e8d9a0 45%, #b8a878 100%);
    box-shadow: 0 0 42px 10px rgba(255,240,200,0.22), 0 0 120px 40px rgba(120,140,200,0.12);
    animation: moonfloat 9s ease-in-out infinite;
  }
  @keyframes moonfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
  #title-scene-2d .hills {
    position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  }
  #title-scene-2d .hills span {
    position: absolute; bottom: 0; border-radius: 50% 50% 0 0;
    background: linear-gradient(180deg, #1c2a1a 0%, #121c10 100%);
  }
  #title-scene-2d .hills span:nth-child(1) { left: -12%; width: 62%; height: 100%; opacity: .95; }
  #title-scene-2d .hills span:nth-child(2) { right: -8%; width: 55%; height: 88%; opacity: .9; }
  #title-scene-2d .hills span:nth-child(3) { left: 34%; width: 44%; height: 72%; opacity: .85; }
  #title-scene-2d .fire-pit {
    position: absolute; left: 50%; bottom: 20%; width: 54px; height: 14px; margin-left: -27px;
    background: linear-gradient(180deg, #4a3020 0%, #2a1a10 100%);
    border-radius: 50% / 40%; box-shadow: inset 0 3px 6px rgba(0,0,0,.6);
  }
  #title-scene-2d .fire-core {
    position: absolute; left: 50%; bottom: calc(20% + 8px); width: 26px; height: 34px; margin-left: -13px;
    background: radial-gradient(ellipse at 50% 85%, #ffd25a 0%, #ff9a2a 45%, #e05a10 75%, transparent 100%);
    border-radius: 50% 50% 45% 45%; filter: blur(1px);
    animation: fireflicker 1.15s ease-in-out infinite;
  }
  @keyframes fireflicker {
    0%, 100% { transform: scale(1) translateY(0); opacity: .95; }
    25% { transform: scale(1.08, 1.15) translateY(-2px); opacity: 1; }
    50% { transform: scale(.94, .92) translateY(1px); opacity: .85; }
    75% { transform: scale(1.04, 1.2) translateY(-3px); opacity: 1; }
  }
  #title-scene-2d .fire-glow {
    position: absolute; left: 50%; bottom: calc(20% - 26px); width: 190px; height: 120px; margin-left: -95px;
    background: radial-gradient(ellipse at center, rgba(255,150,50,.30) 0%, rgba(255,110,30,.12) 45%, transparent 72%);
    border-radius: 50%; animation: glowpulse 2.2s ease-in-out infinite;
  }
  @keyframes glowpulse { 0%, 100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.15); opacity: 1; } }
  #title-scene-2d .spark i {
    position: absolute; left: 50%; bottom: calc(20% + 14px); width: 3px; height: 3px; border-radius: 50%;
    background: #ffca6a; animation: sparkrise 1.8s linear infinite; opacity: 0;
  }
  #title-scene-2d .spark i:nth-child(1) { margin-left: -4px; animation-delay: 0s; }
  #title-scene-2d .spark i:nth-child(2) { margin-left: 3px; animation-delay: .35s; }
  #title-scene-2d .spark i:nth-child(3) { margin-left: -9px; animation-delay: .8s; }
  #title-scene-2d .spark i:nth-child(4) { margin-left: 7px; animation-delay: 1.15s; }
  #title-scene-2d .spark i:nth-child(5) { margin-left: -1px; animation-delay: 1.5s; }
  #title-scene-2d .spark i:nth-child(6) { margin-left: 11px; animation-delay: .55s; }
  @keyframes sparkrise {
    0% { transform: translateY(0) translateX(0); opacity: 1; }
    70% { opacity: .7; }
    100% { transform: translateY(-58px) translateX(var(--drift, 6px)); opacity: 0; }
  }
  #title-scene-2d .tent {
    position: absolute; left: 22%; bottom: 21%; width: 0; height: 0;
    border-left: 34px solid transparent; border-right: 34px solid transparent;
    border-bottom: 46px solid #3a2c1e; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
  }
  #title-scene-2d .tent::after {
    content: ''; position: absolute; left: -12px; top: 14px; width: 24px; height: 32px;
    background: #14100c; border-radius: 40% 40% 0 0;
  }
  #title-scene-2d .hero-2d {
    position: absolute; left: 50%; bottom: calc(20% + 10px); margin-left: 38px; width: 18px; height: 34px;
    background: linear-gradient(180deg, #6a8a5a 0%, #4a6a3a 55%, #2a2a2a 100%);
    border-radius: 9px 9px 4px 4px;
    box-shadow: inset 0 -6px 0 rgba(0,0,0,.25);
    animation: herobreathe 3.4s ease-in-out infinite;
  }
  #title-scene-2d .hero-2d::before { /* cabeça */
    content: ''; position: absolute; left: 4px; top: -12px; width: 10px; height: 10px;
    background: #d8a878; border-radius: 50%;
  }
  #title-scene-2d .hero-2d::after { /* espada nas costas */
    content: ''; position: absolute; right: -7px; top: 4px; width: 4px; height: 26px;
    background: linear-gradient(180deg, #cfd4dc 0%, #8a929e 100%); border-radius: 2px;
    transform: rotate(18deg);
  }
  @keyframes herobreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
  @media (min-width: 761px) { #title-scene-2d { display: none !important; } }
  #menu-ui {
    position: relative; z-index: 2;
    width: 100%; max-width: 440px;
    margin: 0 auto;
    padding: 64px 24px max(26px, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    background: linear-gradient(to top, rgba(5,7,12,0.92) 0%, rgba(5,7,12,0.55) 45%, transparent 100%);
    animation: menuRise .9s cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes menuRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  .menu-vignette {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(3,4,8,0.72) 100%);
  }
  .menu-bars i { position: absolute; left: 0; right: 0; height: 4.5vh; background: #05070b; z-index: 1; pointer-events: none; }
  .menu-bars i:first-child { top: 0; box-shadow: 0 6px 24px rgba(0,0,0,.7); }
  .menu-bars i:last-child { display: none; }
  .menu-logo { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 2px 0; }
  .menu-ornament { display: flex; align-items: center; gap: 10px; width: min(260px, 70vw); color: #c6a15b; font-size: 13px; opacity: .9; }
  .menu-ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(198,161,91,.8)); }
  .menu-ornament span:last-child { background: linear-gradient(270deg, transparent, rgba(198,161,91,.8)); }
  .menu-tag { font-family: var(--font-display); font-size: 12px; letter-spacing: .62em; padding-left: .62em; color: rgba(240,217,160,.75); }
  #menu h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 11vw, 64px); margin: 0; line-height: 1;
    letter-spacing: 0.14em; padding-left: 0.14em;
    background: linear-gradient(180deg, #fff3c8 0%, #f0d080 42%, #b98a3a 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 14px rgba(255,150,40,0.45)) drop-shadow(0 0 2px rgba(0,0,0,.8));
    animation: logoGlow 4.2s ease-in-out infinite;
  }
  @keyframes logoGlow { 0%,100% { filter: drop-shadow(0 2px 12px rgba(255,150,40,0.35)) drop-shadow(0 0 2px rgba(0,0,0,.8)); } 50% { filter: drop-shadow(0 2px 22px rgba(255,170,60,0.65)) drop-shadow(0 0 2px rgba(0,0,0,.8)); } }
  #menu .sub {
    color: rgba(200,210,220,0.8); font-size: 12px; letter-spacing: .08em; max-width: 320px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
  }
  .menu-field { display: flex; flex-direction: column; gap: 5px; width: min(300px, 86vw); margin-top: 6px; text-align: left; }
  .menu-field span { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: rgba(198,161,91,.85); padding-left: 4px; }
  .menu-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 11px; color: rgba(190,200,212,.8); margin-top: 6px; }
  .menu-keys kbd {
    font-family: inherit; font-size: 10px; font-weight: 700; color: #f0d9a0;
    border: 1px solid rgba(198,161,91,.45); border-bottom-width: 2px; border-radius: 5px;
    padding: 1px 6px; background: rgba(0,0,0,.45); margin-right: 3px;
  }
  #menu .hint { color: rgba(130,140,152,0.85); font-size: 10.5px; margin-top: 0; }
  #menu-name-input {
    width: 100%; padding: 13px 16px;
    border-radius: 12px; border: 1px solid rgba(198,161,91,0.5);
    background: rgba(0,0,0,0.55); color: #fff; font-size: 17px; text-align: center;
    backdrop-filter: blur(6px); outline: none; transition: border-color .2s, box-shadow .2s;
  }
  #menu-name-input::placeholder { color: rgba(200,210,220,.4); }
  #menu-name-input:focus { border-color: #f0d080; box-shadow: 0 0 0 3px rgba(240,208,128,.18), 0 0 22px rgba(240,170,60,.25); }
  #start-btn {
    margin-top: 6px; padding: 16px 0; width: min(300px, 86vw); font-size: 17px; font-weight: 700;
    animation: startPulse 2.6s ease-in-out infinite; transition: filter .2s, transform .15s;
    font-family: var(--font-display);
    color: #1a1208; background: linear-gradient(180deg, #f0d080, #c6a15b 45%, #a07830);
    border: none; border-radius: 14px; cursor: pointer; letter-spacing: 0.08em;
    box-shadow: 0 6px 28px rgba(198,161,91,0.45), 0 0 0 1px rgba(255,220,150,0.25) inset;
    pointer-events: auto; position: relative; z-index: 3;
    text-transform: uppercase;
  }
  @keyframes startPulse { 0%,100% { box-shadow: 0 6px 24px rgba(198,161,91,0.35), 0 0 0 1px rgba(255,220,150,0.25) inset; } 50% { box-shadow: 0 6px 38px rgba(240,170,60,0.7), 0 0 0 1px rgba(255,220,150,0.4) inset; } }
  #start-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
  #start-btn:active { transform: scale(0.96); }
  #start-btn:disabled { opacity: 0.7; cursor: wait; filter: saturate(0.85); }
  .menu-badge {
    font-size: 10px; letter-spacing: 0.2em; font-weight: 700;
    color: #c6a15b; border: 1px solid rgba(198,161,91,0.45);
    padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.35);
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  }
  #boot-loader {
    width: min(300px, 86vw); margin-top: 4px;
    opacity: 0.95; transition: opacity 0.25s ease;
  }
  #boot-loader:not(.on) .boot-status { opacity: 0.75; }
  .boot-track {
    height: 8px; border-radius: 999px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(198,161,91,0.35);
    overflow: hidden; box-shadow: 0 0 12px rgba(198,161,91,0.12) inset;
  }
  .boot-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #a07830, #f0d080, #c6a15b);
    box-shadow: 0 0 12px rgba(240,208,128,0.55);
    transition: width 0.28s ease;
  }
  .boot-status {
    margin-top: 6px; font-size: 11px; color: rgba(200,210,220,0.9);
    text-align: center; min-height: 1.2em;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  }

  #menu-mute-btn {
    position: absolute; z-index: 5;
    top: max(14px, env(safe-area-inset-top)); right: 14px;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(198,161,91,0.4);
    background: rgba(5,7,12,0.55); color: #f0d9a0; font-size: 17px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; pointer-events: auto; backdrop-filter: blur(4px);
  }
  #menu-mute-btn:active { transform: scale(0.92); }
  /* dica enquanto o som ainda não foi liberado pelo navegador */
  #menu-mute-btn.waiting { animation: muteHintPulse 1.8s ease-in-out infinite; }
  #menu-mute-btn.waiting::after {
    content: 'toque para ligar o som';
    position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
    white-space: nowrap; font-size: 12px; font-family: inherit; color: #f0d9a0;
    background: rgba(5,7,12,0.65); border: 1px solid rgba(198,161,91,0.3);
    border-radius: 99px; padding: 5px 10px; pointer-events: none;
  }
  @keyframes muteHintPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240,217,160,0.0); }
    50% { box-shadow: 0 0 0 6px rgba(240,217,160,0.22); }
  }

  