/* Rizzie's Cafe: Tuk-Tuk Jam — mobile-first, portrait, no-scroll */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', 'Baloo 2', 'Nunito', 'Segoe UI Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
  background: #0e7490;
}

#app {
  height: 100dvh;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    url(assets/background.jpg) center / cover no-repeat,
    radial-gradient(circle at 85% 10%, rgba(255,247,237,.9) 0, rgba(255,214,170,.55) 34px, transparent 80px),
    linear-gradient(180deg, #ffb877 0%, #ffd9a8 22%, #fdecc8 48%, #f6d99c 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.35);
}

#app::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70px;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(255,255,255,.35), transparent);
}

/* ---------- Awning header ---------- */
#awning {
  position: relative;
  flex: 0 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.awning-stripes {
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    #ea6a0a 0px, #ea6a0a 22px,
    #fff7ed 22px, #fff7ed 44px
  );
  box-shadow: 0 2px 4px rgba(0,0,0,.18);
}

.awning-scallop {
  height: 12px;
  background:
    radial-gradient(circle at 11px -4px, #ea6a0a 12px, transparent 13px) 0 0 / 44px 12px repeat-x,
    radial-gradient(circle at 33px -4px, #fff7ed 12px, transparent 13px) 0 0 / 44px 12px repeat-x;
  margin-top: -1px;
}

#title {
  text-align: center;
  padding: 4px 8px 6px;
  line-height: 1.05;
  color: #3b1d0a;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}

.title-cafe {
  display: block;
  font-size: clamp(19px, 5.4vw, 27px);
  font-weight: 900;
  letter-spacing: .5px;
  color: #ea6a0a;
  -webkit-text-stroke: 1.5px #7c2d12;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #7c2d12, 0 5px 8px rgba(0,0,0,.25);
}

.title-sub {
  display: block;
  font-size: clamp(10px, 2.9vw, 13px);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7c2d12;
}

/* ---------- Top bar ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px;
}

.tbtn {
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf0, #ffe4c4);border: 2px solid #ea6a0a;
  color: #3b1d0a;
  font-size: 17px;
  font-weight: 800;
  min-width: 42px;
  height: 38px;
  padding: 0 10px;
  box-shadow: 0 3px 0 #c2410c, 0 4px 6px rgba(0,0,0,.15);
  cursor: pointer;
  font-family: inherit;
}

.tbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d6b08a; }

.tbtn-label { font-size: 14px; }

#moves-pill {
  background: linear-gradient(180deg, #fff7ed, #fed7aa);
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 14px;
  padding: 6px 18px;
  border: 3px solid #ea6a0a;
  box-shadow: 0 0 0 2px #fff7ed, 0 4px 8px rgba(60,20,0,.3);
  white-space: nowrap;
}

#moves-count { color: #c2410c; font-size: 20px; margin-left: 4px; }

/* ---------- Board ---------- */
#board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#board {
  display: block;
  border-radius: 14px;
  box-shadow: 0 0 0 4px #9a3412, 0 0 0 8px #ffd9a8, 0 0 0 11px #ea6a0a, 0 12px 24px 11px rgba(60,20,0,.35);
  background: #f2dca7;
}

#footer {
  flex: 0 0 auto;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #3b1d0a;
  opacity: .75;
  padding: 3px 0 calc(5px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Overlays & cards ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 50, 60, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 18px;
}

.overlay.hidden { display: none; }

.card {
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border-radius: 22px;
  border: 4px solid #f59e0b;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  padding: 18px 20px 20px;
  width: 100%;
  max-width: 330px;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  touch-action: pan-y;
  text-align: center;
}

.card h2 {
  color: #9a3412;
  font-size: 22px;
  margin-bottom: 12px;
}

/* Level select grid */
#level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.lvl-btn {
  border: 3px solid #7c2d12;
  border-radius: 14px;
  background: #ecfeff;
  padding: 8px 4px 6px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 #fdba74;
}

.lvl-btn:active { transform: translateY(2px); box-shadow: none; }

.lvl-btn .lvl-num {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #3b1d0a;
}

.lvl-btn .lvl-stars {
  display: block;
  font-size: 11px;
  color: #f59e0b;
  letter-spacing: 1px;
  min-height: 14px;
}

.lvl-btn.locked {
  opacity: .45;
  border-color: #94a3b8;
  background: #e2e8f0;
  box-shadow: 0 3px 0 #cbd5e1;
}

.lvl-btn.locked .lvl-stars { color: #64748b; }

/* Win card — vertical, Instagram-story friendly */
#win-card {
  max-width: 300px;
  padding-top: 0;
  overflow: hidden auto;
}

.win-awning {
  height: 16px;
  margin: 0 -20px 12px;
  background: repeating-linear-gradient(
    90deg,
    #ea6a0a 0px, #ea6a0a 20px,
    #fff7ed 20px, #fff7ed 40px
  );
  border-bottom: 3px solid #f59e0b;
}

.win-title {
  font-size: 26px;
  color: #7c2d12;
  margin-bottom: 6px;
}

.win-stars {
  font-size: 44px;
  letter-spacing: 6px;
  color: #f59e0b;
  text-shadow: 0 2px 0 #b45309;
  margin-bottom: 4px;
  min-height: 56px;
}

.win-stars .dim { color: #d6c9a8; text-shadow: none; }

.win-moves {
  font-size: 17px;
  font-weight: 800;
  color: #78350f;
  margin-bottom: 2px;
}

.win-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #7c2d12;
  opacity: .8;
  margin-bottom: 6px;
}

.win-beach { font-size: 24px; margin-bottom: 12px; }

.big-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #f97316, #7c2d12);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  padding: 13px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 0 #9a3412, 0 6px 10px rgba(0,0,0,.2);
}

.big-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #9a3412; }

.win-row { display: flex; gap: 10px; }

.small-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  background: #fff7ed;
  border: 2px solid #f59e0b;
  color: #9a3412;
  font-size: 14px;
  font-weight: 800;
  padding: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 #f59e0b;
}

.small-btn:active { transform: translateY(2px); box-shadow: none; }

.hidden { display: none !important; }

#logo { display: block; margin: 0 auto; height: clamp(46px, 11vh, 78px); width: auto; max-width: 80%; filter: drop-shadow(0 2px 3px rgba(60,20,0,.35)); }
#title.has-logo .title-cafe { display: none; }
#title.has-logo .title-sub { display: table; margin: 4px auto 0; padding: 2px 12px; border-radius: 999px; background: rgba(59,29,10,.82); color: #ffe7c7; text-shadow: none; }
