/* ==========================================================================
   TASTY TRAVELS: KAITEN SUSHI JAM - STYLESHEET
   ========================================================================== */

:root {
  --wood-dark: #3e2723;
  --wood-mid: #5d4037;
  --wood-light: #8d6e63;
  --wood-floor: #d7ccc8;
  --cream-bg: #fff8e1;
  --gold: #ffb300;
  --gold-glow: rgba(255, 179, 0, 0.6);
  --green-accent: #43a047;
  --red-accent: #e53935;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at center, #23140e 0%, #0d0603 100%);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #3e2723;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 540px;
  max-height: 960px;
  background: #fbf5ee;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85), 0 0 0 4px #3e2723;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-aspect-ratio: 9/16) {
  #game-container {
    height: 98vh;
    width: calc(98vh * 9 / 16);
    border-radius: 24px;
  }
}

@media (max-aspect-ratio: 9/16) {
  #game-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* UI Overlays */
.ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Subtle corner buttons so they don't cover Japanese decorations */
.top-bar-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 14px;
  pointer-events: auto;
  z-index: 10;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #8d6e63;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.1s, background 0.1s;
  pointer-events: auto;
}

.icon-btn:active {
  transform: scale(0.9);
  background: #f0e6d6;
}

/* Booster Dock (Bottom Powerups) */
.booster-dock {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 12px 14px 12px;
  pointer-events: auto;
  z-index: 10;
  background: linear-gradient(180deg, rgba(251, 245, 238, 0) 0%, rgba(251, 245, 238, 0.95) 40%, #fbf5ee 100%);
}

.booster-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(160deg, #fffde7, #ffd54f);
  border: 2px solid #b78103;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.8);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.booster-btn:active {
  transform: scale(0.92);
}

.booster-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
  line-height: 1;
}

.booster-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.booster-label {
  font-size: 9px;
  font-weight: 900;
  color: #5d4037;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 8, 4, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 88%;
  max-width: 420px;
  background: linear-gradient(180deg, #fffdfa 0%, #f7ede2 100%);
  border-radius: 28px;
  border: 4px solid #8d6e63;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  padding: 30px 22px 24px 22px;
  text-align: center;
  transform: translateY(30px) scale(0.92);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header-badge {
  background: linear-gradient(135deg, #ff8f00, #ffb300);
  color: white;
  padding: 8px 26px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  box-shadow: 0 6px 16px rgba(255, 143, 0, 0.4);
  margin-top: -46px;
  margin-bottom: 14px;
  border: 3px solid #fff;
  letter-spacing: 1px;
}

.modal-title {
  font-size: 28px;
  font-weight: 900;
  color: #3e2723;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 15px;
  color: #6d4c41;
  margin-bottom: 20px;
  line-height: 1.45;
}

.stars-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 44px;
  margin-bottom: 20px;
}

.star {
  color: #d7ccc8;
  transition: transform 0.3s, color 0.3s;
}

.star.earned {
  color: #ffb300;
  animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes starPop {
  0% { transform: scale(0.2) rotate(-30deg); }
  70% { transform: scale(1.3) rotate(15deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.modal-stats {
  width: 100%;
  background: #efebe9;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-around;
  border: 1px solid #d7ccc8;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-weight: 800;
  color: #8d6e63;
  text-transform: uppercase;
}

.stat-val {
  font-size: 22px;
  font-weight: 900;
  color: #3e2723;
}

.primary-btn {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(180deg, #4caf50 0%, #2e7d32 100%);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.4), inset 0 2px 2px rgba(255,255,255,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.primary-btn:active {
  transform: scale(0.96);
  box-shadow: 0 3px 8px rgba(46, 125, 50, 0.3);
}

.secondary-btn {
  width: 100%;
  padding: 13px 20px;
  background: transparent;
  color: #6d4c41;
  border: 2px solid #bcaaa4;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(188, 170, 164, 0.2);
}

.start-pulse {
  animation: pulseBeat 1.4s infinite ease-in-out;
}

@keyframes pulseBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
