/* Gooner Crush + iOS home */

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(.96);
  transition: opacity .28s ease, transform .32s cubic-bezier(.22,.8,.32,1);
  z-index: 1;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  z-index: 2;
}
.screen.app { background: #000; }

/* HOME */
.screen.home {
  color: #fff;
  overflow: hidden;
}
.home-wallpaper {
  position: absolute;
  inset: 0;
  background:
    url("crush/wallpaper.jpg") center / cover no-repeat,
    linear-gradient(180deg, #1a0820, #05010a);
}
.home-body {
  position: relative;
  z-index: 1;
  padding: calc(var(--status-h) + 18px) 22px 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.home-widgets { margin-bottom: 22px; }
.clock-widget {
  text-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.cw-date {
  font-size: 20px;
  font-weight: 560;
  letter-spacing: .2px;
}
.cw-time {
  font-size: 78px;
  font-weight: 720;
  letter-spacing: -3px;
  line-height: .9;
  margin-top: 2px;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  justify-items: center;
}
.ios-app {
  background: none;
  border: 0;
  color: #fff;
  padding: 0;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ios-face {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.ios-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.16);
}
.messages-face {
  background: #120814;
}
.crush-face { background: #120814; }
.ai-face {
  background: #08010c;
  box-shadow: 0 0 16px rgba(255, 45, 149, .45);
}

.screen.ai { background: #000; overflow: hidden; }
.screen.ai iframe {
  position: absolute;
  inset: 0 0 18px;
  width: 100%;
  height: calc(100% - 18px);
  border: 0;
  background: #000;
}
.ios-label {
  font-size: 11px;
  font-weight: 520;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
  line-height: 1.15;
}
.ios-app:active { opacity: .72; transform: scale(.94); }
.home-footer {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.page-dots { display: flex; gap: 6px; }
.page-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.35);
}
.page-dots i.on { background: #fff; }
.search-pill {
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 99px;
  padding: 8px 22px;
  font-size: 16px;
  color: rgba(255,255,255,.78);
  width: min(220px, 70%);
  text-align: center;
}
.dock {
  display: flex;
  gap: 22px;
  justify-content: center;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 32px;
  padding: 12px 22px 14px;
  width: 100%;
}
.dock-app { width: auto; }
.dock-app .ios-face { width: 58px; height: 58px; border-radius: 14px; }
.dock-app .ios-label { display: none; }

.home-bar {
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  z-index: 60;
  position: absolute;
}
.home-bar::after {
  content: "";
  position: absolute;
  inset: -18px -36px;
}
.home-bar:active { opacity: .55; }

/* CRUSH APP */
.screen.crush {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,70,160,.28), transparent 55%),
    linear-gradient(180deg, #2a0830 0%, #120814 40%, #1a0620 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.crush-map, .crush-play {
  position: absolute;
  inset: 0;
  padding-top: var(--status-h);
  padding-bottom: 26px;
  display: flex;
  flex-direction: column;
}
.crush-map.hidden, .crush-play.hidden, .crush-modal.hidden { display: none; }

.crush-map-head {
  padding: 10px 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex: 0 0 auto;
}
.crush-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ff9ad4;
  font-weight: 700;
}
.crush-map-head h1 {
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.crush-progress {
  text-align: right;
  font-size: 13px;
  color: #f3c6e4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 650;
}
.crush-path {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 20px;
  -webkit-overflow-scrolling: touch;
}
.crush-lane {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  padding: 10px 0 30px;
}
.crush-lane::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  bottom: 20px;
  width: 6px;
  margin-left: -3px;
  background: linear-gradient(180deg, #ff4fa3, #7b2cff 60%, #ffb020);
  border-radius: 99px;
  opacity: .85;
}
.lvl-node {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  margin: 10px 0;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.lvl-node:nth-child(odd) { justify-content: flex-start; padding-right: 52%; }
.lvl-node:nth-child(even) { justify-content: flex-end; padding-left: 52%; }
.lvl-bubble {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  background: radial-gradient(circle at 30% 25%, #fff7, transparent 40%), linear-gradient(180deg, #ff78c0, #c2186e);
  box-shadow: 0 6px 0 #7a1048, 0 10px 18px #0008;
  position: relative;
}
.lvl-node.done .lvl-bubble {
  background: radial-gradient(circle at 30% 25%, #fff8, transparent 40%), linear-gradient(180deg, #ffe36a, #f0a000);
  box-shadow: 0 6px 0 #a46400, 0 10px 18px #0008;
  color: #4a2a00;
}
.lvl-node.locked { cursor: default; opacity: .55; }
.lvl-node.locked .lvl-bubble {
  background: linear-gradient(180deg, #4a3a52, #2a2030);
  box-shadow: 0 6px 0 #160e1c;
  color: #bbb;
  font-size: 22px;
}
.lvl-stars {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.lvl-node.current .lvl-bubble {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.crush-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 4px;
  flex: 0 0 auto;
}
.crush-map-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: #ffffff22;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.hud-pill {
  background: #00000055;
  border: 1px solid #ffffff22;
  border-radius: 12px;
  padding: 4px 10px 5px;
  min-width: 58px;
  text-align: center;
}
.hud-pill.wide { flex: 1; min-width: 0; }
.hud-pill.moves { background: #ff2d7a33; border-color: #ff6aa9; }
.hud-pill small {
  display: block;
  font-size: 9px;
  letter-spacing: .08em;
  color: #ffc2e2;
  font-weight: 700;
}
.hud-pill b { font-size: 16px; font-weight: 800; }
.hud-pill.wide b { font-size: 13px; }

.crush-scoreline {
  padding: 4px 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.star-track {
  flex: 1;
  height: 10px;
  background: #0006;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
  border: 1px solid #fff2;
}
.star-track i {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: #ffd76a;
  opacity: .8;
}
#star-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff4fa3, #ffd76a);
  border-radius: 99px;
  transition: width .25s ease;
}
.score-num { font-weight: 800; font-size: 16px; min-width: 52px; text-align: right; }

.crush-board-wrap {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0 10px 6px;
  min-height: 0;
}
.crush-board {
  width: min(100%, 372px);
  aspect-ratio: 1;
  display: grid;
  gap: 3px;
  padding: 6px;
  background: #140818cc;
  border: 1px solid #ff6aa944;
  border-radius: 16px;
  box-shadow: inset 0 0 24px #0008, 0 12px 30px #0006;
  touch-action: none;
  user-select: none;
}
.tile {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, #ffffff22, transparent 45%), #2a1633;
  cursor: pointer;
  overflow: hidden;
}
.tile img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  inset: 7%;
  filter: drop-shadow(0 2px 2px #0008);
}
.tile.selected {
  outline: 3px solid #fff;
  outline-offset: -2px;
  z-index: 2;
  transform: scale(1.06);
}
.tile.pop { animation: crush-pop .22s cubic-bezier(.2,1.4,.3,1); }
.tile.kill { animation: crush-kill .28s ease forwards; }
.tile.hint { animation: crush-hint 1s ease infinite; }
.crush-board.shake { animation: crush-shake .28s ease; }
.combo-toast {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(.6);
  z-index: 8;
  pointer-events: none;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: .08em;
  color: #fff;
  text-shadow: 0 0 18px #ff2d95, 0 4px 0 #7a1048;
  opacity: 0;
}
.combo-toast.pop { animation: combo-pop .7s ease; }
.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
}
.score-float {
  position: absolute;
  font-weight: 800;
  font-size: 16px;
  color: #ffe36a;
  text-shadow: 0 2px 8px #000;
  animation: score-up .85s ease forwards;
}
.score-float.big { font-size: 22px; color: #fff; text-shadow: 0 0 12px #ff2d95, 0 2px 8px #000; }
.hud-pill.combo { min-width: 46px; background: #ff2d7a44; border-color: #ffd76a88; }
@keyframes crush-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-0.6deg); }
  40% { transform: translateX(4px) rotate(0.6deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes combo-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  70% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(.9); }
}
@keyframes score-up {
  0% { opacity: 1; transform: translateY(0) scale(.9); }
  100% { opacity: 0; transform: translateY(-46px) scale(1.1); }
}
.tile.frost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #b8f0ff88, #6ad4ff44);
  border: 2px solid #d9f7ffaa;
  border-radius: 10px;
  pointer-events: none;
}
.tile.frost2::after { background: linear-gradient(160deg, #e8fbffcc, #8ee3ff77); }
.tile .sp {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
}
.tile .sp.stripe-h { box-shadow: inset 0 0 0 2px #ffe36a; background: linear-gradient(#0000 42%, #ffe36aaa 46%, #ffe36aaa 54%, #0000 58%); }
.tile .sp.stripe-v { box-shadow: inset 0 0 0 2px #ffe36a; background: linear-gradient(90deg, #0000 42%, #ffe36aaa 46%, #ffe36aaa 54%, #0000 58%); }
.tile .sp.wrapped { box-shadow: inset 0 0 0 3px #ff7ad9, 0 0 10px #ff4fa3; }
.tile .sp.color {
  background: conic-gradient(#ff4fa3, #ffe36a, #67f56d, #4fc3ff, #c77dff, #ff4fa3);
  mix-blend-mode: screen;
  opacity: .55;
}

@keyframes crush-pop { from { transform: scale(.2) rotate(-8deg); } to { transform: scale(1) rotate(0); } }
@keyframes crush-kill {
  40% { transform: scale(1.18); filter: brightness(1.8); }
  100% { transform: scale(.05); opacity: 0; }
}
@keyframes crush-hint { 0%,100% { filter: none; } 50% { filter: brightness(1.45); transform: scale(1.05); } }

.crush-hint-line {
  text-align: center;
  color: #f3c6e4;
  font-size: 12px;
  padding: 2px 12px 6px;
  min-height: 20px;
}

.crush-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #0a0410cc;
  display: grid;
  place-items: center;
  padding: 24px;
}
.crush-card {
  width: min(320px, 100%);
  background: linear-gradient(180deg, #4a1858, #240828);
  border: 1px solid #ff8ac866;
  border-radius: 22px;
  padding: 22px 18px 16px;
  text-align: center;
  box-shadow: 0 20px 50px #000a;
}
.crush-card h2 { margin: 0 0 6px; font-size: 26px; }
.crush-card p { margin: 0 0 14px; color: #f3c6e4; }
.big-stars { font-size: 28px; letter-spacing: 6px; margin: 4px 0 14px; color: #ffd76a; }
.crush-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.crush-actions button {
  border: 0;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 750;
  font-size: 15px;
  cursor: pointer;
  color: #3a1030;
  background: linear-gradient(180deg, #ffe36a, #f0a000);
}
.crush-actions button.ghost {
  background: #ffffff22;
  color: #fff;
}
.crush-actions button.pink {
  background: linear-gradient(180deg, #ff78c0, #ff2d7a);
  color: #fff;
}

.crush-board-panel {
  margin: 14px 16px 88px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(8,2,16,0.72);
  border: 1px solid rgba(255,45,149,0.4);
}
.crush-lb-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 8px 0;
}
.crush-lb-form input {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,45,149,0.4);
  background: #000;
  color: #fff;
}
.crush-lb-form button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff2d95, #9b30ff);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.crush-lb-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.crush-lb-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,45,149,0.35), rgba(155,48,255,0.28));
  font-size: 13px;
}
.crush-lb-status { min-height: 1.2em; font-size: 12px; color: #f3c6e4; }

@media (max-width: 520px) {
  .screen.home .home-body,
  .crush-map, .crush-play { padding-top: calc(var(--status-h) + var(--safe-top)); }
}
