:root {
  --wall: #cdc6ba;
  --ink: #1c1c1e;
  --scr: #0c2d6e;
  --scr-text: #eaf2ff;
  --scr-dim: #9fc0ff;
  --scr-line: #6f95e0;
  --amber: #ffd66b;
  --green: #3ddc84;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #3a3d42; }

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
* { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* The whole viewport is the ATM: the machine face sits in the middle,
   and the space around it is more of the same steel casing. */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--ink);
  background-color: #3a3d42;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0px, rgba(255, 255, 255, 0.025) 1px, rgba(0, 0, 0, 0.04) 1px, rgba(0, 0, 0, 0.04) 3px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.18));
  -webkit-user-select: none;
  user-select: none;
}
.receipt, .content { -webkit-user-select: text; user-select: text; }

/* Side vents on the casing, shown when there is room beside the face */
body::before, body::after {
  content: '';
  position: fixed;
  top: 50%;
  width: 56px;
  height: 38vh;
  transform: translateY(-50%);
  border-radius: 6px;
  background: repeating-linear-gradient(180deg, #1b1c1f 0px, #1b1c1f 7px, transparent 7px, transparent 16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  pointer-events: none;
}
body::before { left: calc(var(--flank, 0px) / 2 - 28px); }
body::after { right: calc(var(--flank, 0px) / 2 - 28px); }
body.wide::before, body.wide::after { opacity: 0.9; }

button { font-family: inherit; }
button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Machine ---------- */

.machine {
  width: 980px;
  flex: none;
  padding: 22px;
  border-radius: 18px;
  background: #3a3d42;
  box-shadow: -1px 0 0 #232427, 1px 0 0 #232427, -2px 0 0 #4b4e54, 2px 0 0 #4b4e54;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.topper {
  height: 78px;
  padding: 0 28px;
  border-radius: 10px;
  background: #0f1a2e;
  box-shadow: inset 0 0 0 2px #1d2b47, inset 0 -18px 30px rgba(120, 160, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 20px; }
.atm-word {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.12em;
  color: #f4f7ff;
  text-shadow: 0 0 14px rgba(160, 195, 255, 0.7);
}
.divider { width: 2px; height: 34px; background: #2c3d60; }
.topper-sub { display: flex; flex-direction: column; gap: 4px; }
.tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #f2b544;
  text-shadow: 0 0 8px rgba(242, 181, 68, 0.5);
}
.icons { display: flex; align-items: center; gap: 10px; }
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #b8c4dc;
}
.status .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
}
.shine {
  position: absolute; left: 0; top: -20px;
  width: 90px; height: 120px;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.fascia {
  padding: 24px;
  border-radius: 10px;
  background-color: #c4c7cc;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.22) 0px, rgba(255, 255, 255, 0.22) 1px, rgba(0, 0, 0, 0.035) 1px, rgba(0, 0, 0, 0.035) 2px);
  box-shadow: inset 0 2px 0 #e4e6ea, inset 0 -3px 0 #8f9298;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.screw {
  position: absolute;
  width: 10px; height: 10px; border-radius: 50%;
  background: #a9acb2;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4), 0 1px 0 #e6e8ec;
  display: flex; align-items: center; justify-content: center;
}
.screw i { width: 6px; height: 1.5px; background: #6d7076; }
.screw.tl { left: 10px; top: 10px; } .screw.tl i { transform: rotate(35deg); }
.screw.tr { right: 10px; top: 10px; } .screw.tr i { transform: rotate(-20deg); }
.screw.bl { left: 10px; bottom: 10px; } .screw.bl i { transform: rotate(80deg); }
.screw.br { right: 10px; bottom: 10px; } .screw.br i { transform: rotate(10deg); }

.toprow { height: 22px; display: flex; align-items: center; justify-content: center; gap: 18px; position: relative; }
.decal { position: absolute; left: 20px; font-size: 9px; font-weight: 500; letter-spacing: 0.12em; color: #55585e; }
.cam {
  width: 14px; height: 14px; border-radius: 50%;
  background: #111214;
  box-shadow: 0 0 0 3px #7c7f86, inset 2px 2px 3px rgba(120, 140, 200, 0.6);
}
.grille { display: grid; grid-template-columns: repeat(8, 4px); gap: 4px; }
.grille i { width: 4px; height: 4px; border-radius: 50%; background: #4a4d53; }

/* ---------- Hood, side buttons, screen ---------- */

.hood {
  height: 430px;
  padding: 15px;
  border-radius: 14px;
  background: #2b2d31;
  box-shadow: inset 0 14px 18px rgba(0, 0, 0, 0.45), 0 1px 0 #e6e8ec;
  display: flex;
  gap: 14px;
}
.sidecol { width: 76px; flex: none; padding: 32px 0; display: flex; flex-direction: column; }
.sidecol > div { flex: 1; display: flex; align-items: center; justify-content: center; }
.side {
  width: 66px; height: 44px; padding: 0;
  border: 1px solid #8a8d94; border-radius: 6px;
  background: #d3d5d9;
  box-shadow: 0 4px 0 #6a6d74, inset 0 1px 0 #f4f5f7;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.05s;
}
.side:active, .side.pressed { transform: translateY(2px); box-shadow: 0 1px 0 #6a6d74, inset 0 1px 0 #f4f5f7; }
.side:disabled { cursor: default; }

.bezel {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: #0b0c0e;
  box-shadow: inset 0 0 0 2px #1c1d21;
}

.screen {
  --scr-h: 372px;
  --pad: 18px;
  height: var(--scr-h);
  padding: var(--pad) 22px;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--scr);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(120, 170, 255, 0.25);
  font-family: 'VT323', ui-monospace, monospace;
  font-size: 27px;
  line-height: 1.1;
  color: var(--scr-text);
  text-shadow: 0 0 6px rgba(170, 205, 255, 0.45);
  display: flex;
  flex-direction: column;
}
.row { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.lbl {
  font: inherit; color: inherit; text-shadow: inherit;
  background: none; border: none; padding: 4px 0;
  min-height: 44px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  text-align: left;
  position: relative;
  z-index: 2;
}
.lbl.R { flex-direction: row-reverse; text-align: right; }
.lbl .bar { width: 18px; height: 3px; background: var(--amber); flex: none; box-shadow: 0 0 6px rgba(255, 214, 107, 0.6); }
.lbl:hover .txt { color: #ffffff; }
.lbl.off { visibility: hidden; }
.lbl.anim.L { animation: lblL 0.32s ease-out both; }
.lbl.anim.R { animation: lblR 0.32s ease-out both; }
.row:nth-child(2) .lbl.anim { animation-delay: 0.06s; }
.row:nth-child(3) .lbl.anim { animation-delay: 0.12s; }
.row:nth-child(4) .lbl.anim { animation-delay: 0.18s; }

.ov { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ov > * { pointer-events: auto; }
.ov a { color: var(--amber); }
.ov a:hover { color: #ffffff; }

.center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 0 16px;
}
.center.tap { cursor: pointer; }
.dim { color: var(--scr-dim); }
.amber { color: var(--amber); }
.w-title { font-size: 30px; letter-spacing: 0.1em; }
.w-name { font-size: 68px; line-height: 1; letter-spacing: 0.04em; }
.w-sub { font-size: 24px; }
.w-insert { font-size: 28px; margin-top: 6px; }
.w-or { font-size: 22px; }
.w-card { margin-top: 8px; width: 70px; height: 44px; position: relative; overflow: hidden; border-bottom: 3px solid var(--scr-dim); }
.w-card svg { position: absolute; left: 15px; top: 8px; }

.p-title { font-size: 34px; }
.p-sub { font-size: 24px; }
.loadbar { width: 260px; max-width: 80%; height: 18px; padding: 3px; border: 2px solid var(--scr-line); }
.loadbar i { display: block; height: 100%; background: var(--amber); animation: bootBar 0.6s steps(10) both; }

.pin-title { font-size: 38px; }
.pinboxes { display: flex; gap: 14px; }
.pinbox {
  width: 54px; height: 60px;
  border: 2px solid var(--scr-line); border-radius: 4px;
  background: #0a2459;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; color: var(--amber);
  transition: border-color 0.15s;
}
.pinbox.cur { border-color: var(--amber); }
.pinbox span { display: block; margin-top: 12px; animation: pinPop 0.18s ease-out both; }
.pin-hint { font-size: 24px; }
.pin-cancel { font-size: 20px; color: var(--scr-line); }

.bye-title { font-size: 44px; }
.bye-sub { font-size: 28px; }

.menu-title {
  position: absolute; left: 50%; top: 60%;
  transform: translate(-50%, -50%);
  width: 220px; text-align: center;
  font-size: 25px; color: var(--scr-dim);
  white-space: pre-line;
  pointer-events: none;
}

.content {
  position: absolute;
  left: 22px; right: 22px; top: var(--pad);
  bottom: calc(var(--pad) + (100% - 2 * var(--pad)) / 4);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
}
.c-title { font-size: 32px; color: var(--amber); border-bottom: 2px dashed #3d64b8; padding-bottom: 6px; }
.c-line { white-space: pre-wrap; }
.c-links { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.c-links div { white-space: pre-wrap; overflow-wrap: anywhere; }

.roll {
  position: absolute; left: 0; right: 0; top: 0; height: 110px;
  pointer-events: none; z-index: 3;
  background: linear-gradient(180deg, rgba(160, 200, 255, 0) 0%, rgba(160, 200, 255, 0.06) 50%, rgba(160, 200, 255, 0) 100%);
  animation: roll 7s linear infinite;
}
.scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.08) 0px, rgba(0, 0, 0, 0.08) 1px, transparent 1px, transparent 3px);
}
.glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 28%, transparent 29%, transparent 100%);
}

/* ---------- Deck: keypad, card reader, receipt ---------- */

.deck { height: 256px; display: flex; gap: 24px; }

.keypad-panel {
  width: 340px; flex: none;
  border-radius: 12px;
  background: #2b2d31;
  box-shadow: inset 0 16px 16px rgba(0, 0, 0, 0.45), 0 1px 0 #e6e8ec;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.keypad-head {
  min-height: 24px; padding: 4px 8px;
  background: #1b1c1f;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 8.5px; font-weight: 500; letter-spacing: 0.12em; color: #9a9da3; text-align: center;
}
.led { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #3a3c42; transition: background 0.3s; }
.led.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.led.blinking { animation: ledBlink 0.9s steps(2) infinite; }

.keypad {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 58px) 104px;
  grid-template-rows: repeat(4, 46px);
  gap: 10px;
  justify-content: center;
  align-content: center;
}
.key {
  border: 1px solid #8a8d94; border-radius: 6px;
  background: #d9dbde;
  box-shadow: 0 4px 0 #6f7278, inset 0 1px 0 #f7f8f9;
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; padding: 0;
  cursor: pointer; position: relative;
  transition: transform 0.05s;
}
.key b { font-size: 20px; font-weight: 700; }
.key small { font-size: 8px; letter-spacing: 0.08em; color: #5d6066; height: 9px; margin-top: 2px; }
.key .dot5 { position: absolute; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: #9a9da3; }
.key.fn { flex-direction: row; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.key.cancel { background: #b0261c; border-color: #5e130e; box-shadow: 0 4px 0 #5e130e, inset 0 1px 0 #d9564b; color: #ffffff; }
.key.clear { background: #e3ab17; border-color: #8a6408; box-shadow: 0 4px 0 #8a6408, inset 0 1px 0 #f6cf66; }
.key.enter { background: #1f7339; border-color: #0e3a1c; box-shadow: 0 4px 0 #0e3a1c, inset 0 1px 0 #3fa060; color: #ffffff; }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #6f7278, inset 0 1px 0 #f7f8f9; }
.key.cancel:active, .key.cancel.pressed { box-shadow: 0 1px 0 #5e130e; }
.key.clear:active, .key.clear.pressed { box-shadow: 0 1px 0 #8a6408; }
.key.enter:active, .key.enter.pressed { box-shadow: 0 1px 0 #0e3a1c; }

.panel {
  border-radius: 12px;
  background: #b5b8be;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 1px 0 #e6e8ec;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 14px;
}
.card-panel { width: 200px; flex: none; gap: 12px; }
.receipt-panel { width: 300px; flex: none; gap: 14px; }
.plabel { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: #2f3136; }
.braille { display: grid; grid-template-columns: repeat(4, 3px); gap: 2px; margin-left: 4px; }
.braille i { width: 3px; height: 3px; border-radius: 50%; background: #6d7076; }
.braille i.e { background: none; }
.small-note { font-size: 9px; letter-spacing: 0.1em; color: #3d4046; text-align: center; line-height: 1.5; white-space: pre-line; }

.reader {
  width: 160px; height: 120px; flex: none;
  border: none; border-radius: 14px;
  background: #1a1b1e;
  box-shadow: 0 6px 0 #0c0d0f, inset 0 1px 0 #3a3c42;
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 0 0;
  cursor: pointer; position: relative;
}
.reader:active { transform: translateY(2px); box-shadow: 0 3px 0 #0c0d0f, inset 0 1px 0 #3a3c42; }
.mouth {
  width: 138px; height: 30px; margin-top: -9px;
  border-radius: 15px;
  background: rgba(61, 220, 132, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
  transition: background 0.4s, box-shadow 0.4s;
}
.mouth.glow { background: rgba(61, 220, 132, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 14px rgba(61, 220, 132, 0.6); }
.mouth i { width: 112px; height: 10px; border-radius: 5px; background: #000000; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.9); }
#cardSlotArea { display: flex; justify-content: center; width: 100%; }
.card {
  width: 96px; height: 44px; margin-top: -20px;
  border-radius: 0 0 6px 6px;
  background: #1e3f7a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  display: flex; align-items: flex-end; padding: 0 0 8px 12px;
  position: relative; z-index: 1;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card i { width: 16px; height: 12px; border-radius: 2px; background: #d6b35a; }
.card-arrow { display: block; margin-top: 22px; animation: pulse 1.4s ease-in-out infinite; }

.printer {
  width: 270px; max-width: 100%; height: 34px;
  border-radius: 8px;
  background: #1a1b1e;
  box-shadow: 0 5px 0 #0c0d0f, inset 0 1px 0 #3a3c42;
  display: flex; align-items: center; justify-content: center;
}
.pslot { width: 244px; max-width: calc(100% - 20px); height: 8px; border-radius: 4px; background: #000000; position: relative; }
.receipt {
  position: absolute; left: 4px; right: 4px; top: 5px;
  height: 0; overflow: hidden;
  background: #fbfaf6;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
  transition: height 1.8s steps(18);
  z-index: 20;
}
.receipt-inner {
  padding: 14px 14px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; line-height: 1.45; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.receipt a { color: var(--ink); }
.receipt a:hover { color: #8a4b00; }
.r-name { text-align: center; font-weight: 700; font-size: 13px; letter-spacing: 0.2em; }
.r-center { text-align: center; letter-spacing: 0.06em; }
.r-bold { font-weight: 700; }
.rrow { display: flex; justify-content: space-between; gap: 8px; }
.rrow a { overflow-wrap: anywhere; text-align: right; }
.dash { border-top: 1px dashed #8a857c; }
.r-barcode { text-align: center; font-size: 14px; line-height: 1; }
.r-tear { text-align: center; font-size: 9px; color: #8a857c; letter-spacing: 0.2em; }
.take {
  align-self: center;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: 6px;
  background: transparent; color: var(--ink);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  cursor: pointer;
}
.take:hover { background: #efece4; }

.jack { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; color: #3d4046; }
.jack .hole { width: 16px; height: 16px; border-radius: 50%; background: #1a1b1e; box-shadow: 0 0 0 3px #8f9298, inset 0 2px 3px rgba(0, 0, 0, 0.8); }

.seam { height: 2px; border-top: 1px solid #8f9298; border-bottom: 1px solid #eceef1; }

.cashrow { height: 78px; display: flex; align-items: center; justify-content: center; position: relative; }
.cash {
  width: 520px; max-width: 100%; height: 72px;
  border-radius: 10px;
  background: #1a1b1e;
  box-shadow: inset 0 0 0 3px #2f3035, 0 5px 0 #0c0d0f;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.cash i { width: 440px; max-width: 85%; height: 14px; border-radius: 3px; background: #050506; box-shadow: 0 0 0 2px #3a3c42, 0 0 10px rgba(61, 220, 132, 0.25); }
.cash span { font-size: 10px; font-weight: 700; letter-spacing: 0.3em; color: #8a8d94; }
.plate {
  position: absolute; left: 14px; top: 20px;
  padding: 6px 10px; border-radius: 3px;
  background: #a9acb2;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 0 #e6e8ec;
  font-size: 8px; font-weight: 700; line-height: 1.5; letter-spacing: 0.16em; color: #4a4d53;
}
.lock {
  position: absolute; right: 150px; top: 24px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #9da0a6;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45), 0 1px 0 #e6e8ec;
  display: flex; align-items: center; justify-content: center;
}
.lock i { width: 3px; height: 11px; border-radius: 2px; background: #2b2d31; }
.sticker {
  position: absolute; right: 18px; top: 14px;
  transform: rotate(-4deg);
  padding: 8px 12px;
  background: #f4d03f; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  font-size: 11px; font-weight: 700; line-height: 1.3; letter-spacing: 0.06em; color: var(--ink);
  text-align: center;
}

/* ---------- Animations ---------- */

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes scrIn {
  0% { opacity: 0; filter: brightness(2.4) blur(2px); transform: scaleY(0.94); }
  55% { opacity: 1; filter: brightness(1.3) blur(0.4px); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes lblL { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes lblR { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes roll { 0% { transform: translateY(-140px); } 100% { transform: translateY(620px); } }
@keyframes flick { 0%, 90%, 100% { opacity: 1; } 91% { opacity: 0.82; } 92% { opacity: 1; } 95% { opacity: 0.9; } 96% { opacity: 1; } }
@keyframes shine { 0% { transform: translateX(-260px) skewX(-22deg); } 22%, 100% { transform: translateX(1100px) skewX(-22deg); } }
@keyframes signOn { 0% { opacity: 0.15; } 6% { opacity: 1; } 10% { opacity: 0.25; } 16% { opacity: 1; } 22% { opacity: 0.55; } 28%, 100% { opacity: 1; } }
@keyframes cardIn { from { transform: translateY(52px); } to { transform: translateY(0); } }
@keyframes attract { 0% { transform: translateY(30px); opacity: 0; } 18% { opacity: 1; } 65% { transform: translateY(0); opacity: 1; } 85%, 100% { transform: translateY(-8px); opacity: 0; } }
@keyframes pinPop { from { transform: scale(1.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bootBar { from { width: 0; } to { width: 100%; } }
@keyframes ledBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.blink { animation: blink 1.1s steps(1) infinite; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
.scrin { animation: scrIn 0.42s ease-out both; }
.flick { animation: flick 9s infinite; }
.shine { animation: shine 8s ease-in-out 1.5s infinite; }
.signon { animation: signOn 2.4s linear both; }
.attract { animation: attract 2.4s ease-in-out infinite; }

/* ---------- Phones: a full-screen, no-scroll ATM ---------- */

@media (max-width: 760px) {
  body { position: fixed; inset: 0; display: block; }
  body::before, body::after { display: none; }

  .machine {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
    gap: 6px;
    border-radius: 0;
    box-shadow: none;
  }

  .topper { height: 44px; flex: none; padding: 0 12px; border-radius: 8px; }
  .brand { gap: 10px; }
  .atm-word { font-size: 22px; }
  .divider { height: 22px; }
  .icons { display: none; }
  .tag { font-size: 8px; letter-spacing: 0.14em; }
  .status { font-size: 8px; letter-spacing: 0.1em; gap: 6px; }
  .status .dot { width: 8px; height: 8px; }

  .fascia { flex: 1; min-height: 0; padding: 10px 8px 8px; gap: 8px; border-radius: 8px; }
  .screw { width: 7px; height: 7px; }
  .screw i { width: 4px; height: 1px; }
  .screw.tl, .screw.bl { left: 5px; } .screw.tr, .screw.br { right: 5px; }
  .screw.tl, .screw.tr { top: 5px; } .screw.bl, .screw.br { bottom: 5px; }

  .toprow { height: 12px; flex: none; gap: 12px; }
  .decal { display: none; }
  .cam { width: 10px; height: 10px; box-shadow: 0 0 0 2px #7c7f86, inset 1px 1px 2px rgba(120, 140, 200, 0.6); }
  .grille { grid-template-columns: repeat(8, 3px); gap: 3px; }
  .grille i { width: 3px; height: 3px; }

  /* Screen with its side buttons: still the heart of the machine */
  .hood { --bz: 6px; flex: 1; min-height: 0; height: auto; padding: 6px 4px; gap: 4px; border-radius: 10px; }
  .sidecol { display: flex; width: 30px; padding: calc(var(--bz) + 10px) 0; }
  .sidecol > div { min-height: 0; }
  .side { width: 28px; height: min(38px, 82%); border-radius: 5px; box-shadow: 0 3px 0 #6a6d74, inset 0 1px 0 #f4f5f7; }
  .side svg { width: 14px; height: 14px; }
  .bezel { padding: var(--bz); border-radius: 8px; display: flex; container-type: size; }

  .screen {
    --pad: 10px;
    flex: 1;
    height: auto;
    padding: var(--pad) 10px;
    font-size: clamp(13px, min(7cqh, 7.6cqw), 22px);
  }
  .lbl { gap: 5px; padding: 2px 0; min-height: 36px; letter-spacing: -0.01em; }
  .lbl .bar { width: 8px; height: 2px; }
  .row { gap: 4px; }

  .center { gap: 0.45em; padding: 0 8px; }
  .w-title { font-size: 0.95em; }
  .w-name { font-size: 1.65em; }
  .w-sub { font-size: 0.85em; }
  .w-card { width: 46px; height: 30px; margin-top: 0; border-bottom-width: 2px; }
  .w-card svg { width: 28px; height: 21px; left: 9px; top: 6px; }
  .w-insert { font-size: 1em; margin-top: 0; }
  .w-or { font-size: 0.8em; }
  .p-title { font-size: 1.2em; }
  .p-sub { font-size: 0.85em; }
  .loadbar { width: 70%; height: 14px; padding: 2px; }
  .pin-title { font-size: 1.25em; }
  .pinboxes { gap: 0.4em; }
  .pinbox { width: 1.9em; height: 2.2em; font-size: 1.6em; }
  .pinbox span { margin-top: 0.3em; }
  .pin-hint { font-size: 0.85em; }
  .pin-cancel { font-size: 0.75em; }
  .bye-title { font-size: 1.5em; }
  .bye-sub { font-size: 1em; }
  .menu-title { width: 58%; font-size: 0.85em; }
  .content { left: 10px; right: 10px; gap: 0.3em; line-height: 1.05; }
  .c-title { font-size: 1.15em; padding-bottom: 0.2em; }
  .c-links { gap: 0.3em; margin-top: 0.2em; }

  /* Keypad on top, card reader and receipt printer side by side below */
  .deck { height: auto; flex: none; display: grid; grid-template-columns: 38fr 62fr; gap: 8px; }
  .keypad-panel { grid-column: 1 / -1; width: auto; border-radius: 10px; }
  .keypad-head { min-height: 18px; padding: 3px 8px; font-size: 7.5px; letter-spacing: 0.1em; }
  .keypad {
    padding: 9px 12px 12px;
    gap: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.45fr);
    grid-template-rows: repeat(4, clamp(32px, 5.4dvh, 48px));
    justify-content: stretch;
  }
  .key b { font-size: 19px; }
  .key small { font-size: 7px; height: 8px; margin-top: 1px; }
  .key.fn { font-size: 10.5px; gap: 5px; }
  .key.fn svg { width: 10px; height: 10px; }

  .panel { padding: 8px 8px 10px; border-radius: 10px; }
  .card-panel, .receipt-panel { width: auto; gap: 7px; justify-content: flex-start; }
  .plabel { font-size: 8px; gap: 6px; letter-spacing: 0.12em; }
  .plabel svg { width: 16px; height: 12px; }
  .braille { display: none; }
  .small-note, .jack { display: none; }

  .reader { width: 100%; max-width: 124px; height: 64px; padding-top: 19px; border-radius: 10px; box-shadow: 0 4px 0 #0c0d0f, inset 0 1px 0 #3a3c42; }
  .mouth { width: 88%; height: 22px; margin-top: -7px; border-radius: 11px; }
  .mouth i { width: 82%; height: 7px; }
  .card { width: 68%; height: 30px; margin-top: -14px; padding: 0 0 6px 8px; }
  .card i { width: 11px; height: 8px; }
  .card-arrow { margin-top: 6px; }
  .card-arrow svg { width: 20px; height: 20px; }

  .receipt-panel { position: relative; }
  .printer { width: 100%; height: 30px; margin-top: 12px; border-radius: 7px; }
  .pslot { width: calc(100% - 16px); max-width: none; height: 7px; }
  /* On a phone the paper feeds up out of the slot instead of down off-screen */
  .receipt { top: auto; bottom: 3px; left: 2px; right: 2px; box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.35); z-index: 30; }
  .receipt-inner { padding: 10px 10px 8px; font-size: 9.5px; gap: 4px; }
  .rrow { gap: 4px; }
  .r-name { font-size: 11px; letter-spacing: 0.14em; }
  .take { min-height: 40px; font-size: 10px; }

  .seam, .cashrow { display: none; }
}

/* Short phones: give the screen priority over the keypad and extras */
@media (max-width: 760px) and (max-height: 680px) {
  .toprow { display: none; }
  .fascia { padding-top: 8px; }
  .keypad-head { min-height: 14px; padding: 2px 8px; font-size: 6.5px; }
  .keypad { padding: 6px 10px 9px; gap: 5px; grid-template-rows: repeat(4, clamp(28px, 5.2dvh, 40px)); }
  .key b { font-size: 16px; }
  .key small { display: none; }
  .key .dot5 { top: 3px; }
  .reader { height: 52px; padding-top: 15px; }
  .card-arrow { margin-top: 3px; }
  .card-arrow svg { width: 16px; height: 16px; }
  .printer { margin-top: 8px; }
}

/* Short screens: drop the decorative extras on the screen so the text fits */
@container (max-height: 230px) {
  .w-card, .w-sub, .pin-cancel, .p-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .roll, .shine, .flick, .attract, .signon, .pulse, .blink, .led.blinking { animation: none !important; }
  .scrin, .lbl.anim, .card, .pinbox span, .loadbar i { animation-duration: 0.01s !important; }
  .receipt { transition-duration: 0.01s; }
}
