:root {
  --gold: #f2c46d;
  --gold2: #ffdf9e;
  --ink: #e9eef4;
  --dim: #8d99ab;
  --panel: #0e1218;
  --panel2: #161c25;
  --line: #29313f;
  --accent: #9fd3ff;
  --paper: #f3ead6;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #040608;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  user-select: none; -webkit-user-select: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 720px;
  transform-origin: center center;
  background: #000; overflow: hidden;
  box-shadow: 0 0 120px rgba(0,0,0,.9);
}

/* ─────────── Escena ─────────── */
#scene-wrap { position: absolute; left: 0; top: 0; width: 1280px; height: 560px; overflow: hidden; }
#scene svg { display: block; width: 1280px; height: 560px; }
/* Grano de película y viñeta sobre todas las escenas */
#scene-wrap::after, #title-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background:
    radial-gradient(ellipse 75% 70% at 50% 48%, transparent 55%, rgba(0,0,0,.42) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.55 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay; opacity: .55;
}
#scene-wrap::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse 80% 75% at 50% 45%, transparent 60%, rgba(0,0,0,.35) 100%);
}
.np, .np * { pointer-events: none; }
[data-hs] { cursor: pointer; }
[data-hs].hover { filter: url(#f-hover); }
.show-hs [data-hs]:not(.hs-off) { filter: url(#f-show); }
.hs-off { pointer-events: none !important; }
.busy #scene [data-hs] { cursor: default; }
.busy [data-hs].hover { filter: none; }
.holding #scene-wrap, .holding [data-hs] { cursor: crosshair; }

#scene-title {
  position: absolute; left: 32px; top: 22px;
  font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 30px;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(-6px); transition: opacity .6s, transform .6s;
  pointer-events: none;
}
#scene-title.show { opacity: .95; transform: none; }

#hover-label {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(8,10,14,.82); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-weight: 700; font-size: 19px;
  border: 1px solid rgba(255,255,255,.15); white-space: nowrap;
}
.busy #hover-label { display: none; }

/* Subtítulos */
#subs {
  position: absolute; left: 70px; right: 70px; bottom: 16px; z-index: 10;
  background: rgba(7,9,13,.86); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 14px 120px 16px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: subIn .18s ease-out;
}
@keyframes subIn { from { opacity: 0; transform: translateY(6px); } }
#subs-name { font-weight: 800; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
#subs-text { font-size: 27px; line-height: 1.38; font-weight: 600; }
#subs-text.narr { font-style: italic; color: #e3e9f1; }
#subs .ctl { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
#subs .ctl button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.07); font-size: 20px;
}
#subs .ctl button:hover { background: rgba(255,255,255,.18); }
#subs .show-only { display: none; }
#subs.nosubs #subs-text { display: none; }
#subs.nosubs .show-only { display: inline-block; }
#subs.nosubs { padding-bottom: 30px; min-height: 76px; }

.gw { border-bottom: 2px dotted rgba(159,211,255,.7); cursor: help; pointer-events: auto; }
.gw:hover { background: rgba(159,211,255,.18); border-bottom-style: solid; border-radius: 3px; }

/* Opciones de diálogo */
#choices {
  position: absolute; left: 70px; right: 70px; bottom: 16px; z-index: 10;
  background: rgba(7,9,13,.9); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: transparent; border: 0; border-radius: 10px;
  padding: 6px 14px; font-size: 22px; font-weight: 600; color: #cfe8cf;
}
.choice:hover { background: rgba(155,224,155,.12); color: #fff; }
.choice .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(155,224,155,.18); font-size: 16px; font-weight: 800;
}

/* Glosario */
#gloss {
  position: absolute; z-index: 30; width: 380px;
  background: #fbf6ea; color: #1c2230; border-radius: 16px;
  padding: 18px 20px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.55);
  text-align: center; animation: pop .15s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
#gloss-emo { font-size: 58px; line-height: 1.1; }
#gloss .gw-row { font-size: 28px; font-weight: 800; margin: 4px 0 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
#gloss .gd-row { font-size: 19px; line-height: 1.4; color: #394256; display: flex; align-items: flex-start; gap: 8px; text-align: left; }
#gloss .gd-row span { flex: 1; }
#gloss button:not(.x) { border: 0; background: #e9e1cd; border-radius: 50%; width: 38px; height: 38px; font-size: 17px; flex: none; }
#gloss button:not(.x):hover { background: #ddd2b6; }
.x { position: absolute; right: 10px; top: 10px; border: 0; background: transparent; font-size: 20px; opacity: .6; width: 34px; height: 34px; }
.x:hover { opacity: 1; }

/* ─────────── Panel inferior ─────────── */
#panel {
  position: absolute; left: 0; top: 560px; width: 1280px; height: 160px;
  background: linear-gradient(#141a23, #0b0f14);
  border-top: 1px solid #2b3444;
  display: grid; grid-template-columns: 450px 1fr 176px; grid-template-rows: 38px 1fr;
  column-gap: 14px; padding: 0 14px 12px;
}
.no-ui #panel > * { visibility: hidden; }
#sentence {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #dfe6ef; letter-spacing: .01em;
}
#sentence b { color: var(--gold); font-weight: 800; }
#verbs { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 7px; }
#verbs button {
  background: #1b222d; border: 1px solid #2b3444; border-radius: 10px;
  font-size: 21px; font-weight: 700; color: #c5cfdc;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#verbs button .vi { font-size: 18px; filter: saturate(.7); }
#verbs button:hover { background: #242d3b; color: #fff; }
#verbs button.sel { background: #3b3220; border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 12px rgba(242,196,109,.25) inset; }
.busy #verbs button { opacity: .5; }

#inventory { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; }
#inventory .cell {
  background: #11161e; border: 1px solid #242c39; border-radius: 10px;
  display: grid; place-items: center; padding: 3px; overflow: hidden;
}
#inventory button.cell:hover { background: #1d2530; border-color: #3a4556; }
#inventory .cell svg { width: 50px; height: 50px; }
#inventory .cell.held { border-color: var(--gold); background: #2b2518; }
#inventory .cell.new { animation: newItem 1.4s ease-out; }
@keyframes newItem { 0% { background: #6a5520; transform: scale(1.12); } 100% { background: #11161e; transform: none; } }

#tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
#tools button {
  position: relative; background: #1b222d; border: 1px solid #2b3444; border-radius: 10px;
  font-size: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
#tools button span { font-size: 12.5px; font-weight: 700; color: #9aa6b8; margin-top: 4px; }
#tools button:hover { background: #242d3b; }
#tools .badge {
  position: absolute; right: 4px; top: 4px; font-style: normal; font-size: 11px; font-weight: 800;
  background: var(--gold); color: #1a1408; border-radius: 9px; padding: 1px 6px;
}

#held { position: absolute; z-index: 40; width: 54px; height: 54px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
#held svg { width: 54px; height: 54px; }

/* Avisos */
#toasts { position: absolute; right: 18px; top: 18px; z-index: 35; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: rgba(10,13,18,.92); border: 1px solid rgba(242,196,109,.35); border-radius: 12px;
  padding: 8px 16px 8px 10px; font-size: 20px; font-weight: 700;
  opacity: 0; transform: translateX(20px); transition: opacity .35s, transform .35s;
  max-width: 460px;
}
.toast.show { opacity: 1; transform: none; }
.toast small { display: block; font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.toast .ti { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.toast .ti svg { width: 44px; height: 44px; }
.toast .ti.emo { font-size: 30px; }

/* ─────────── Capas ─────────── */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(3,5,8,.72); backdrop-filter: blur(3px);
  display: grid; place-items: center;
}
.overlay.full { background: #06080c; backdrop-filter: none; }
.box {
  position: relative; background: #121821; border: 1px solid #2b3444; border-radius: 18px;
  padding: 26px 34px 28px; min-width: 420px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.box.wide { width: 760px; text-align: left; }
.box h3 { margin: 0 0 18px; font-size: 28px; font-family: 'Playfair Display', Georgia, serif; }
.primary {
  background: linear-gradient(#f5cf7f, #e0ab4a); color: #241906 !important; border: 0; border-radius: 12px;
  font-weight: 800; font-size: 20px; padding: 12px 26px;
  box-shadow: 0 4px 0 #9c7426;
}
.primary:hover { filter: brightness(1.07); }
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #9c7426; }
.big { font-size: 24px; padding: 14px 34px; min-width: 280px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Documento */
.doc-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.doc-ctl { display: flex; gap: 10px; }
.doc-ctl button:not(.primary) { background: #1b222d; border: 1px solid #2f394a; border-radius: 12px; font-size: 18px; font-weight: 700; padding: 10px 18px; }
.paper {
  width: 760px; max-height: 520px; overflow: auto; padding: 38px 48px;
  background: var(--paper); color: #26211a; border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6), inset 0 0 60px rgba(160,130,80,.25);
  transform: rotate(-.6deg); user-select: text;
}
.paper p { margin: 0 0 12px; }
.paper .gw { border-bottom-color: rgba(60,90,140,.6); }
.paper .gw:hover { background: rgba(60,90,140,.12); }
.paper.carta, .paper.nota, .paper.cuaderno {
  font-family: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive; font-size: 34px; line-height: 1.25; color: #1f2b4a;
}
.paper.nota { width: 560px; background: #fbf3b9; transform: rotate(1.2deg); box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.paper.cuaderno {
  background:
    repeating-linear-gradient(transparent 0 41px, rgba(90,120,170,.35) 41px 42px),
    #efe4c8;
  line-height: 42px; font-size: 32px; padding-top: 42px; color: #3a2616;
}
.paper.cuaderno p { margin: 0; }
.paper.periodico { font-family: Georgia, 'Times New Roman', serif; background: #e7e2d5; font-size: 21px; line-height: 1.45; transform: rotate(.4deg); }
.paper.periodico .masthead { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 44px; text-align: center; border-bottom: 3px double #333; padding-bottom: 6px; margin-bottom: 12px; letter-spacing: .02em; }
.paper.periodico h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 30px; line-height: 1.15; margin: 0 0 14px; }
.paper.periodico .cols { column-count: 2; column-gap: 32px; }
.paper.placa {
  background: linear-gradient(135deg, #a7834a, #6f5128 55%, #9a7641); color: #f4e3bd;
  font-family: 'Playfair Display', Georgia, serif; text-align: center; font-size: 25px; letter-spacing: .04em;
  border: 10px solid #4d3818; border-radius: 10px; transform: none;
  text-shadow: 0 1px 0 rgba(0,0,0,.5), 0 -1px 0 rgba(255,240,200,.2);
}
.paper.placa p.big { font-size: 30px; font-weight: 700; margin-bottom: 4px; }
.paper.placa .gw { border-bottom-color: rgba(255,230,180,.5); }

/* Candado */
#lock-digits { display: flex; gap: 14px; justify-content: center; margin: 8px 0 12px; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wheel button { width: 64px; height: 42px; border-radius: 10px; border: 1px solid #3a4556; background: #1d2530; font-size: 18px; }
.wheel button:hover { background: #2a3444; }
.wheel .dg {
  width: 64px; height: 80px; display: grid; place-items: center; font-size: 50px; font-weight: 800;
  background: linear-gradient(#cfd5dc, #8c96a2); color: #1a1f27; border-radius: 10px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.35); font-variant-numeric: tabular-nums;
}
#lock-msg { min-height: 26px; color: #ff9d8a; font-weight: 700; font-size: 20px; margin-bottom: 10px; }

/* Radio */
#radio .box { background: linear-gradient(#34402f, #232c21); border-color: #56654c; }
.dial { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 10px 0 22px; }
.dial > button { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #6d7c60; background: #1b2218; font-size: 24px; }
.dial > button:hover { background: #2b3527; }
.lcd {
  width: 200px; height: 100px; border-radius: 10px; background: #0b1a0d; border: 3px solid #111;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #59ff7a; text-shadow: 0 0 10px rgba(89,255,122,.6); font-family: 'Courier New', monospace;
}
.lcd small { font-size: 16px; letter-spacing: .2em; opacity: .8; }
.lcd span { font-size: 54px; font-weight: 700; line-height: 1; }

/* Diario */
.book {
  position: relative; width: 980px; height: 600px; background: #f1e7d0; color: #2a2419;
  border-radius: 16px; padding: 26px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column;
}
.book h2 { margin: 0 0 12px; font-family: 'Playfair Display', Georgia, serif; font-size: 34px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { border: 0; background: #e2d5b6; border-radius: 10px 10px 0 0; padding: 10px 20px; font-size: 19px; font-weight: 800; color: #5c4f37; }
.tabs button.sel { background: #fffaf0; color: #2a2419; }
#diary-body { flex: 1; overflow: auto; background: #fffaf0; border-radius: 0 12px 12px 12px; padding: 18px 22px; user-select: text; }
#diary-body .empty { color: #8c7f64; font-size: 20px; font-style: italic; }
#diary .gw { border-bottom-color: rgba(60,90,140,.5); }
.task { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 700; padding: 8px 4px; border-bottom: 1px dashed #d9ccae; }
.task .tt { flex: 1; }
.task.done { color: #9a8f79; font-weight: 600; text-decoration: line-through; }
.task .chk { font-size: 24px; }
.spk { border: 0; background: #ece2c8; border-radius: 50%; width: 36px; height: 36px; font-size: 16px; flex: none; }
.spk.sm { width: 30px; height: 30px; font-size: 13px; vertical-align: middle; }
.spk:hover { background: #dfd1ae; }
.words { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.word { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed #e0d4b8; }
.word .emo { font-size: 36px; width: 48px; text-align: center; flex: none; }
.word .ww { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.word .wd { font-size: 17px; color: #54493a; line-height: 1.35; margin-top: 2px; }
.person { display: flex; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e0d4b8; font-size: 20px; }
.person .pic { width: 72px; height: 72px; border-radius: 50%; flex: none; overflow: hidden; }
.person .pic svg { width: 72px; height: 72px; }
.person .pn { font-weight: 900; font-size: 22px; filter: brightness(.7) saturate(1.3); }

/* Opciones */
#settings .row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
#settings .row label { width: 230px; font-size: 19px; font-weight: 700; color: #b9c4d4; }
#settings .row button { background: #1b222d; border: 1px solid #2f394a; border-radius: 10px; padding: 8px 16px; font-size: 18px; font-weight: 700; }
#settings .row button.sel { background: #3b3220; border-color: var(--gold); color: var(--gold2); }
#settings .rng { display: flex; align-items: center; gap: 10px; font-size: 20px; }
#settings input[type=range] { width: 300px; accent-color: var(--gold); }
#settings .keys { margin: 18px 0 16px; font-size: 15px; color: #8d99ab; line-height: 1.6; }
#settings .keys b { color: #d8e0ea; background: #1d2530; padding: 1px 7px; border-radius: 5px; }
#btn-menu { background: #1b222d; border: 1px solid #2f394a; border-radius: 10px; padding: 10px 18px; font-size: 18px; font-weight: 700; }

/* Título */
#title { place-items: stretch; }
#title-art, #title-art svg { position: absolute; inset: 0; width: 1280px; height: 720px; }
.title-text { position: absolute; left: 90px; top: 110px; }
.title-text h1 {
  margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 104px; line-height: .95;
  color: #fff4dc; text-shadow: 0 4px 30px rgba(0,0,0,.8);
}
.title-text h1 span { font-style: italic; font-weight: 500; font-size: 70px; color: var(--gold2); }
.title-text .sub { font-size: 26px; color: #cfd8e3; margin: 16px 0 44px; letter-spacing: .04em; }
.title-text .menu { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.more-games { margin-top: 6px; color: #b9c4d4; font-weight: 700; font-size: 19px; text-decoration: none; padding: 6px 4px; }
.more-games:hover { color: var(--gold2); }
#rotate { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  #rotate { display: flex; position: fixed; inset: 0; z-index: 999; background: #06080c; color: #e9eef4;
    flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 22px; font-weight: 700; }
  #rotate div { font-size: 64px; margin-bottom: 10px; }
}
.title-text .menu button:not(.primary) { background: rgba(20,26,35,.85); border: 1px solid #3a4556; border-radius: 12px; font-weight: 800; }

/* Preparación */
#setup { background: radial-gradient(ellipse at 50% 30%, #1b2638, #06080c 70%); }
.setup-box { text-align: center; width: 1000px; }
.setup-box h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 34px; margin: 0 0 18px; }
.cards { display: flex; gap: 24px; justify-content: center; margin-bottom: 30px; }
.card {
  width: 420px; padding: 20px 26px; border-radius: 18px; text-align: left;
  background: #121821; border: 2px solid #2b3444; transition: transform .15s, border-color .15s;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
}
.card:hover { transform: translateY(-3px); border-color: #4a5870; }
.card.sel { border-color: var(--gold); background: #211d14; box-shadow: 0 0 30px rgba(242,196,109,.15); }
.card .ci { font-size: 44px; }
.card h3 { margin: 6px 0 8px; font-size: 30px; }
.card p { margin: 0; font-size: 19px; line-height: 1.5; color: #b8c3d2; }
.voices { display: flex; gap: 16px; justify-content: center; margin-bottom: 14px; }
.voices button { background: #121821; border: 2px solid #2b3444; border-radius: 14px; font-size: 22px; font-weight: 800; padding: 14px 30px; }
.voices button.sel { border-color: var(--gold); background: #211d14; color: var(--gold2); }
.tip { color: #8d99ab; font-size: 17px; margin: 6px 0 22px; }

/* Final */
#end { background: radial-gradient(ellipse at 50% 20%, rgba(80,60,30,.55), rgba(6,8,12,.94) 70%); }
.end-box { text-align: center; }
.end-box h1 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 110px; margin: 0; color: var(--gold2); }
.end-box > p { font-size: 26px; color: #cfd8e3; margin: 6px 0 26px; }
#end-stats { display: flex; gap: 22px; justify-content: center; margin-bottom: 26px; }
#end-stats div { background: rgba(18,24,33,.9); border: 1px solid #2b3444; border-radius: 16px; padding: 16px 26px; min-width: 180px; }
#end-stats b { display: block; font-size: 48px; color: var(--gold2); }
#end-stats span { font-size: 17px; color: #b8c3d2; }
.end-box .thanks { font-size: 24px; }

#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .42s; z-index: 45; }
#fade.on { opacity: 1; }

/* ─────────── Animaciones de las escenas ─────────── */
.rain line { stroke: rgba(190,210,235,.38); stroke-width: 1.4; animation-name: fall; animation-timing-function: linear; animation-iteration-count: infinite; }
.rain-light line { stroke: rgba(190,210,235,.22); }
@keyframes fall { from { transform: translateY(0); } to { transform: translateY(var(--fall)); } }
.flicker { animation: flicker 5s infinite; }
@keyframes flicker { 0%, 40%, 44%, 70%, 73%, 100% { opacity: 1; } 42% { opacity: .35; } 71.5% { opacity: .6; } }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bob { animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.bob2 { animation: bob2 3.2s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-4px) rotate(-.6deg); } }
.drift { animation: drift 40s linear infinite alternate; }
@keyframes drift { to { transform: translateX(-120px); } }
.wave { animation: wave 7s ease-in-out infinite; }
.wave.w2 { animation-duration: 9s; animation-delay: -3s; }
.wave.w3 { animation-duration: 5.5s; animation-delay: -1s; }
@keyframes wave { 50% { transform: translateX(-40px); } }
.shimmer { animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .35; } }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.sway { transform-box: fill-box; transform-origin: 0% 100%; animation: sway 3s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(10deg); } }
.flag { transform-box: fill-box; transform-origin: 0% 50%; animation: flag 2.2s ease-in-out infinite; }
@keyframes flag { 50% { transform: skewY(4deg) scaleX(.94); } }
.lightning { animation: lightning 17s infinite; }
@keyframes lightning { 0%, 88%, 89.6%, 90.6%, 100% { opacity: 0; } 89% { opacity: .55; } 90.2% { opacity: .35; } }
.beam { animation: beam 5s linear infinite; }
@keyframes beam { from { transform: translateX(-700px); } to { transform: translateX(1500px); } }
.beam.b2 { animation-delay: -2.5s; }
.beamL, .beamR { transform-box: view-box; transform-origin: 1030px 233px; animation: beamL 7s linear infinite; }
.beamR { animation-name: beamR; }
@keyframes beamL { 0% { transform: scaleX(0); opacity: 0; } 25% { transform: scaleX(1); opacity: 1; } 50%, 100% { transform: scaleX(0); opacity: 0; } }
@keyframes beamR { 0%, 50% { transform: scaleX(0); opacity: 0; } 75% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(0); opacity: 0; } }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.police { animation: police .8s steps(1) infinite; }
@keyframes police { 50% { fill: #ff3b3b; } }
.train { animation: train 9s linear infinite; }
@keyframes train { from { transform: translateX(-900px); } to { transform: translateX(1400px); } }
.steam { transform-box: fill-box; transform-origin: 50% 100%; animation: steam 3s ease-out infinite; }
@keyframes steam { from { opacity: .5; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }
.splash ellipse { transform-box: fill-box; transform-origin: center; animation: splash 1.2s ease-out infinite; opacity: 0; }
@keyframes splash { 0% { transform: scale(.2); opacity: .7; } 60% { opacity: .25; } 100% { transform: scale(1.6); opacity: 0; } }
.breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 4.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleY(1.012); } }
.blinkeye { animation: blinkeye 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blinkeye { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(.1); } }
.smoke { transform-box: fill-box; transform-origin: 50% 100%; animation: smoke 6s ease-out infinite; }
@keyframes smoke { from { opacity: .45; transform: translate(0,0) scale(1); } to { opacity: 0; transform: translate(-30px,-80px) scale(1.8); } }
.tail { transform-box: fill-box; transform-origin: 100% 100%; animation: tail 2.6s ease-in-out infinite; }
@keyframes tail { 50% { transform: rotate(-14deg); } }
.head-bob { transform-box: fill-box; transform-origin: 50% 100%; animation: headbob 4s ease-in-out infinite; }
@keyframes headbob { 0%, 60%, 100% { transform: none; } 70% { transform: rotate(-12deg); } 80% { transform: rotate(8deg); } }
