/* FRUIT CRANE (prototype 2026-11-30): arcade family like Fruit Drop / GachaPull / Jam Rush: ink outlines, hard shadows, Anton, candy sunburst */
:root { --ink: #13212B; --paper: #FFF7E6; --white: #fff; --yellow: #FFD600; --teal: #0A8375; --red: #D8193A;
  --sky: #8FD3FF; --sky2: #74C3F5; --pink: #FF6FA8; --pink2: #FFB3D1; --display: Anton, Impact, 'Arial Narrow Bold', sans-serif;
 }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--sky); background-image: repeating-conic-gradient(from 0deg at 50% 30%, var(--sky) 0deg 9deg, var(--sky2) 9deg 18deg);
  background-attachment: fixed; color: var(--ink); font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
.fc-main { max-width: 480px; margin: 0 auto; padding: 10px 12px 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fc-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pill { font-family: var(--display); letter-spacing: 1.5px; background: var(--white); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-size: .95rem; }
.pill-ink { background: var(--ink); color: var(--white); }
.pill-score { background: var(--yellow); }
.pill.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.3); } }

/* streak + popups + overlay */
.popup { position: absolute; transform: translate(-50%, -100%); font-family: var(--display); font-size: 1.7rem; color: var(--white); text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink);
  pointer-events: none; z-index: 5; animation: popup .9s ease forwards; white-space: nowrap; }
.popup.neg { color: #ff5a6e; }
@keyframes popup { to { transform: translate(-50%, -240%); opacity: 0; } }
.fc-overlay { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: #fff7e6ee; padding: 18px; }
.fc-overlay[hidden] { display: none; }
.fc-ov-title { font-family: var(--display); font-size: 3rem; letter-spacing: 2px; line-height: 1; }
.fc-ov-sub { font-weight: 700; max-width: 300px; }
.fc-count { font-family: var(--display); font-size: 5rem; line-height: 1; }

.hint { margin: 0; font-weight: 700; text-align: center; background: #ffffffcc; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 12px; }
.hint[hidden] { display: none; }

/* finished */
.done { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.done[hidden] { display: none; }
.score-box { width: 100%; background: var(--white); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); padding: 14px; text-align: center; }
.score-line { font-weight: 700; }
.score-big { font-family: var(--display); font-size: 3.2rem; line-height: 1.05; }
.score-big small { font-size: 1.05rem; letter-spacing: 2px; }
.fc-stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; font-weight: 700; }
.fc-stats span { background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.done-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.act { font: 700 1.05rem 'Space Grotesk', sans-serif; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--ink); padding: 10px 18px; cursor: pointer; color: var(--ink); }
.act:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.act-teal { background: var(--teal); color: #fff; }
.act-yellow { background: var(--yellow); }
.next { margin: 0; font-weight: 700; background: #fffc; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 14px; }
.more { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.more a { font-weight: 700; color: var(--ink); text-decoration: none; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 6px 12px; box-shadow: 3px 3px 0 var(--ink); }
.how { width: 100%; background: var(--white); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); padding: 14px 18px; }
.how h2 { font-family: var(--display); font-weight: 400; letter-spacing: 1.5px; margin: 0 0 6px; font-size: 1.6rem; }
.how ul { margin: 0; padding-left: 20px; } .how li { margin: 4px 0; }
.toast { visibility: hidden; white-space: nowrap; position: fixed; left: 50%; bottom: calc(var(--tgg-ad-h, 50px) + 20px); transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px; z-index: 50; transition: transform .25s; }
.toast.show { visibility: visible; transform: translateX(-50%) translateY(0); }
.g-footer { max-width: 480px; margin: 0 auto 10px; padding: 0 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.g-footer .footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.g-footer .footer-link { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }
.g-footer .footer-contact { font-weight: 700; font-size: .85rem; background: #fffc; border: 2px solid var(--ink); border-radius: 12px; padding: 4px 12px; }
.g-footer .footer-contact a { color: var(--ink); }
.g-footer .footer-copy { font-size: .75rem; font-weight: 700; color: #13212bcc; letter-spacing: 1px; }

/* colorblind: nothing in Fruit Crane depends on colour alone (rare fruit wear ✨, the star wears ⭐); this mode makes
   everything higher-contrast and labels the points on rare fruit and the star so they're easy to spot */
body.colorblind-mode { background: #fff; background-image: none; }
body.colorblind-mode .fc-board { background: #fff; }
body.colorblind-mode .fruit img { filter: drop-shadow(0 0 0 #000) drop-shadow(1px 1px 0 #000) drop-shadow(-1px -1px 0 #000); }
body.colorblind-mode .fruit.rare::after { content: '25'; font: 700 .72rem 'Space Grotesk', sans-serif; background: #13212B; color: #fff; border-radius: 6px; padding: 0 3px; animation: none; }
body.colorblind-mode .fruit.star::after { content: '100'; font: 700 .72rem 'Space Grotesk', sans-serif; background: #13212B; color: #FFD600; border-radius: 6px; padding: 0 3px; animation: none; }
body.colorblind-mode #cb-btn { background: #000; color: #fff; }



/* the machine: everything inside is positioned in % of the board (x = % of width, y = % of height) */
.fc-board-wrap { width: 100%; display: flex; justify-content: center; }
.fc-board { position: relative; width: 100%; aspect-ratio: 9 / 11; border: 4px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); overflow: hidden;
  background: linear-gradient(#FFF4FA, #FFE3F0); cursor: pointer; outline: none; }
.fc-board:focus-visible { box-shadow: 6px 6px 0 var(--ink), 0 0 0 4px var(--yellow); }
.fc-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fruit { position: absolute; width: 10.5%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: 2; }
.fruit img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 0 #0004); }
.fruit.rare::after { content: '✨'; position: absolute; right: -18%; top: -22%; font-size: 1.05rem; animation: twinkle 1.4s ease-in-out infinite; }
.fruit.star img { filter: drop-shadow(0 0 6px #ffe066) drop-shadow(0 0 2px #ffcc00) drop-shadow(0 2px 0 #0004); }
.fruit.star::after { content: '⭐'; position: absolute; right: -16%; top: -20%; font-size: 1rem; animation: twinkle 1.1s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.55) rotate(20deg); opacity: .5; } }
.fruit.target img { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 2px 0 #0004) brightness(1.08); }
.fc-cable { position: absolute; width: 1%; min-width: 3px; transform: translateX(-50%); background: repeating-linear-gradient(#13212B 0 4px, #5b6b78 4px 7px); z-index: 4; }
.fc-carriage { position: absolute; top: 3.2%; width: 13%; height: 4.2%; transform: translateX(-50%); background: var(--yellow); border: 3px solid var(--ink); border-radius: 8px; z-index: 5;
  background-image: repeating-linear-gradient(90deg, #0000 0 6px, #13212b22 6px 9px); }
.fc-claw { position: absolute; width: 15%; aspect-ratio: 1; transform: translate(-50%, -32%); z-index: 4; }
.fc-claw svg { width: 100%; height: 100%; overflow: visible; }
.fc-claw .arm { transition: none; }
.fc-guide { position: absolute; width: 0; border-left: 3px dashed #13212b99; transform: translateX(-50%); z-index: 1; pointer-events: none; }
.fc-guide[hidden] { display: none; }

.fc-overlay { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  background: #fff4faee; padding: 18px; }
.fc-overlay[hidden] { display: none; }
.fc-ov-title { font-family: var(--display); font-size: 3rem; letter-spacing: 2px; line-height: 1; }
.fc-ov-sub { font-weight: 700; max-width: 300px; }
.popup { z-index: 7; }

/* under the machine: prize tray + the big arcade button */
.fc-controls { width: 100%; display: flex; align-items: center; gap: 12px; }
.fc-tray { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: var(--white); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink); padding: 6px; }
.fc-tray span { aspect-ratio: 1; border: 2px dashed #13212b40; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--paper); }
.fc-tray span.won { border: 2px solid var(--ink); background: #FFF2B3; animation: bump .45s ease; }
.fc-tray span.lost { border-style: solid; border-color: #13212b30; opacity: .75; }
.fc-tray img { width: 86%; height: 86%; object-fit: contain; }
.fc-drop { flex: none; width: 104px; height: 104px; border-radius: 50%; border: 4px solid var(--ink); cursor: pointer;
  background: radial-gradient(circle at 38% 32%, #ff8a9b 0 18%, #F0294D 45%, #B5122F 100%); color: #fff; font-family: var(--display); font-size: 1.6rem; letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--ink); box-shadow: 0 7px 0 var(--ink), inset 0 -6px 0 #0003; transform: translateY(-4px); transition: transform .06s, box-shadow .06s; }
.fc-drop:active, .fc-drop.press { transform: translateY(3px); box-shadow: 0 0 0 var(--ink), inset 0 -3px 0 #0003; }
.fc-drop:disabled { filter: grayscale(.6) brightness(.9); cursor: default; }
.fc-prizes { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 6px 0 2px; font-size: 1.5rem; }
.fc-stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; font-weight: 700; }
.fc-stats span { background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; }

/* colorblind: nothing in Fruit Crane depends on colour alone (rare fruit wear ✨, the star wears ⭐); this mode makes
   everything higher-contrast and labels the points on rare fruit and the star so they're easy to spot */
body.colorblind-mode { background: #fff; background-image: none; }
body.colorblind-mode .fc-board { background: #fff; }
body.colorblind-mode .fruit img { filter: drop-shadow(0 0 0 #000) drop-shadow(1px 1px 0 #000) drop-shadow(-1px -1px 0 #000); }
body.colorblind-mode .fruit.rare::after { content: '25'; font: 700 .72rem 'Space Grotesk', sans-serif; background: #13212B; color: #fff; border-radius: 6px; padding: 0 3px; animation: none; }
body.colorblind-mode .fruit.star::after { content: '100'; font: 700 .72rem 'Space Grotesk', sans-serif; background: #13212B; color: #FFD600; border-radius: 6px; padding: 0 3px; animation: none; }
body.colorblind-mode #cb-btn { background: #000; color: #fff; }

/* fit status + machine + button on one screen: the machine's width follows the visible height */
:root { --fc-chrome: 330px; }
@media (min-width: 760px) { :root { --fc-chrome: 380px; } }
.fc-board { width: min(100%, calc((100vh - var(--fc-chrome)) * 9 / 11)); width: min(100%, calc((100dvh - var(--fc-chrome)) * 9 / 11)); min-width: 250px; }
@media (max-width: 380px) { .fc-drop { width: 88px; height: 88px; font-size: 1.35rem; } }

/* fast tapping must never select, drag, zoom or long-press-menu */
.fc-board, .fc-controls, .fc-drop { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fc-board img, .fc-tray img { -webkit-user-drag: none; pointer-events: none; }
