/* Tales of the Elfin Oak · Make Your Own Elfin */
body.em-page { background: radial-gradient(ellipse at 50% -10%, rgba(245,200,66,0.12), transparent 46%), radial-gradient(ellipse at 90% 60%, rgba(39,64,126,0.35), transparent 50%), var(--ink); min-height: 100vh; }
#emFx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.em-wrap { max-width: 1180px; margin: 0 auto; padding: 2.4rem 1.4rem 4.5rem; }
.em-head { text-align: center; margin-bottom: 1.8rem; }
.em-head .kicker { font-family: var(--caps); letter-spacing: 0.38em; font-size: 0.74rem; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 0.7rem; }
.em-head h1 { font-family: var(--serif-display); font-weight: 600; font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.05; margin: 0;
  background: linear-gradient(100deg, #b8862b 0%, #f8d565 28%, #fff6cf 50%, #f5c842 72%, #b8862b 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 26px rgba(0,0,0,0.8)) drop-shadow(0 0 34px rgba(245,200,66,0.25)); animation: giltSlide 9s linear infinite; }
.em-head p { font-family: var(--serif-display); font-style: italic; font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--moon, #cfd8ee); margin: 0.7rem auto 0; max-width: 660px; }
.em-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 2rem; align-items: start; }
/* the stage */
.em-stage { position: sticky; top: 1rem; text-align: center; }
.em-card { position: relative; border-radius: 22px; overflow: hidden; border: 2px solid transparent;
  background: linear-gradient(#0b1424, #0b1424) padding-box, linear-gradient(100deg, #8a5d12 0%, #f5c842 18%, #fffbe0 30%, #f5c842 42%, #8a5d12 60%, #f5c842 78%, #fffbe0 90%, #8a5d12 100%) border-box;
  background-size: 100% 100%, 300% 100%; animation: emEdge 7s linear infinite; box-shadow: 0 0 60px rgba(245,200,66,0.25), 0 26px 70px rgba(0,0,0,0.6); }
@keyframes emEdge { to { background-position: 0 0, -300% 0; } }
.em-art { display: block; aspect-ratio: 400 / 520; max-height: min(64vh, 620px); margin: 0 auto; width: 100%; }
.em-art svg { width: 100%; height: 100%; display: block; }
.em-art .e-char { animation: emBob 4.4s ease-in-out infinite; }
@keyframes emBob { 50% { transform: translateY(-6px); } }
.em-art.pop { animation: emPop 0.45s cubic-bezier(.2,1.5,.4,1); }
@keyframes emPop { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.em-plate { padding: 0.9rem 1rem 1.1rem; background: linear-gradient(180deg, #16244a, #0a1226); border-top: 3px solid #f5c842; }
.em-name { margin: 0; font-family: var(--serif-display); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.1;
  background: linear-gradient(100deg, #b8862b 0%, #f8d565 28%, #fff6cf 50%, #f5c842 72%, #b8862b 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.em-folk { margin: 0.25rem 0 0; font-family: var(--serif-display); font-style: italic; font-size: 1.08rem; color: #fff6dc; }
.em-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.1rem; }
.em-actions .btn { padding: 0.8rem 1.4rem; }
.em-nameform { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.em-nameform input, .em-nameform select { font: inherit; font-size: 1rem; padding: 0.65rem 0.9rem; border-radius: 999px; border: 1px solid rgba(245,200,66,0.5); background: rgba(7,12,24,0.7); color: #fff6dc; min-width: 0; }
.em-nameform input { width: 11rem; } .em-nameform select { width: 10.5rem; }
.em-nameform input::placeholder { color: rgba(255,246,220,0.5); }
.em-note { margin: 0.7rem 0 0; font-size: 0.9rem; font-style: italic; color: var(--cream-dim); }
/* the choices */
.em-panel { border: 1px solid rgba(245,200,66,0.4); border-radius: 22px; background: linear-gradient(160deg, rgba(20,31,62,0.92), rgba(8,13,28,0.96)); box-shadow: 0 24px 60px rgba(0,0,0,0.55); overflow: hidden; }
.em-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.9rem 0.9rem 0.8rem; border-bottom: 1px solid rgba(245,200,66,0.28); background: rgba(7,12,24,0.5); }
.em-tab { font-family: var(--caps); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.6rem 0.95rem; border-radius: 999px; border: 1px solid rgba(245,200,66,0.4); background: transparent; color: #ffe9a8; cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; }
.em-tab:hover { background: rgba(245,200,66,0.12); }
.em-tab.on { background: linear-gradient(100deg, #b8862b, #f8d565 30%, #fff6cf 50%, #f5c842 72%, #b8862b); color: #241703; border-color: #fff0b8; box-shadow: 0 0 18px rgba(245,200,66,0.45); }
.em-choices { padding: 1.1rem 1.2rem 1.5rem; min-height: 22rem; }
.em-choices h3 { font-family: var(--caps); font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: #f5c842; margin: 0.9rem 0 0.7rem; font-weight: 400; }
.em-choices h3:first-child { margin-top: 0; }
.em-row { display: grid; gap: 0.7rem; }
.em-colour { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
.em-thumb { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.em-opt { border: 2px solid rgba(245,200,66,0.28); border-radius: 16px; background: rgba(255,252,234,0.04); color: #fff6dc; cursor: pointer; padding: 0.4rem; font: inherit; transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; }
.em-opt:hover { transform: translateY(-3px); border-color: #f5c842; }
.em-opt.on { border-color: #f5c842; background: rgba(245,200,66,0.18); box-shadow: 0 0 22px rgba(245,200,66,0.4); }
.em-colour .em-opt { aspect-ratio: 1; border-radius: 50%; padding: 4px; }
.em-colour .em-opt i { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), inset 0 -6px 10px rgba(0,0,0,0.18); }
.em-thumb .em-opt { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.45rem 0.4rem 0.5rem; }
.em-thumb .em-thumb { display: block; width: 100%; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2a3f78, #101a34); }
.em-thumb .em-thumb svg { width: 100%; height: 100%; display: block; }
.em-thumb .em-opt > span:last-child { font-family: var(--serif-display); font-weight: 600; font-size: 1rem; line-height: 1.1; }
.em-toast { position: fixed; left: 50%; bottom: 1.4rem; translate: -50% 0; z-index: 90; padding: 0.8rem 1.4rem; border-radius: 999px; background: rgba(7,12,24,0.95); border: 1px solid #f5c842; color: #ffe9a8; font-family: var(--serif-display); font-size: 1.1rem; opacity: 0; pointer-events: none; transition: opacity 0.4s; max-width: 92vw; text-align: center; }
.em-toast.show { opacity: 1; }
.em-printcard { display: none; }
@media (max-width: 900px) {
  .em-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .em-stage { position: static; max-width: 420px; margin: 0 auto; width: 100%; }
  .em-art { max-height: 46vh; }
  .em-choices { min-height: 0; }
}
@media (max-width: 640px) {
  .em-wrap { padding: 1.8rem 0.7rem 3.5rem; }
  .em-tabs { flex-wrap: nowrap; overflow-x: auto; padding: 0.7rem; scrollbar-width: none; } .em-tabs::-webkit-scrollbar { display: none; }
  .em-tab { flex: none; padding: 0.6rem 0.85rem; }
  .em-choices { padding: 0.9rem 0.8rem 1.2rem; }
  .em-thumb { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .em-colour { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .em-nameform input, .em-nameform select { width: 100%; }
  .em-actions .btn { flex: 1 1 40%; padding: 0.8rem 0.6rem; }
}
@media (prefers-reduced-motion: reduce) { .em-head h1, .em-card, .em-art .e-char, .em-art.pop { animation: none; } }
@media print {
  body.em-page { background: #fff !important; }
  body.em-page > *:not(.em-printcard) { display: none !important; }
  .em-printcard { display: block !important; text-align: center; }
  .em-printcard img { max-width: 100%; max-height: 96vh; }
}
@media all { .em-stage, .em-panel { padding: 0; } }
