/* Style sheet for Cooking Frenzy - Hyper-casual theme */

:root {
  /* Color Palette */
  --bg-main: #fcf8f2;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --primary: #ff6b6b; /* Tomato Red */
  --primary-hover: #ee5253;
  --secondary: #ff9f43; /* Warm Orange */
  --accent-green: #1dd1a1; /* Mint Green */
  --accent-blue: #48dbfb; /* Sky Blue */
  --dark-text: #2f3542;
  --light-text: #747d8c;
  --border-radius: 20px;
  --card-radius: 16px;
  --shadow-soft: 0 8px 16px rgba(0, 0, 0, 0.05);
  --shadow-hard: 0 12px 24px rgba(255, 107, 107, 0.15);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  
  /* Fonts */
  --font-logo: 'Fredoka', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-body);
  background-color: #2f3542;
  color: var(--dark-text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 10px;
}

/* Main Container: Fixed ratio, maximum mobile compatibility */
.game-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 840px;
  max-height: 95vh;
  background: radial-gradient(circle at top, #ffeaa7 0%, var(--bg-main) 100%);
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 8px solid #ffffff;
}

/* Screens control */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.screen.active {
  display: flex;
}

/* START SCREEN */
#start-screen {
  justify-content: space-between;
  align-items: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, #ff9f43 0%, #ff6b6b 100%);
  color: white;
  text-align: center;
}

.title-logo {
  margin-top: 20px;
}

.logo-emoji {
  font-size: 80px;
  display: inline-block;
  animation: logo-bounce 2s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 42px;
  line-height: 0.9;
  letter-spacing: -1px;
  text-shadow: 0 4px 0px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
}

.logo-subtext {
  color: #ffeaa7;
  font-size: 52px;
}

.game-tagline {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1.4;
  margin: 15px 0;
}

.high-score-board {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--border-radius);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-soft);
}

.trophy-icon {
  font-size: 32px;
}

.score-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.score-details .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.score-details .value {
  font-size: 26px;
  font-weight: 800;
  color: #ffeaa7;
}

.btn {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 22px;
  padding: 16px 36px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 0px rgba(0, 0, 0, 0.15);
  transition: all 0.1s ease;
  width: 100%;
}

.btn-primary {
  background-color: #ffeaa7;
  color: #d35400;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0px rgba(0, 0, 0, 0.15);
}

.btn-pulse {
  animation: pulse-button 1.5s infinite;
}

.how-to-play {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--card-radius);
  padding: 15px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  width: 100%;
  margin-top: 15px;
}

.how-to-play h3 {
  margin-bottom: 8px;
  color: #ffeaa7;
  font-size: 14px;
}

.how-to-play ul {
  list-style: none;
}

.how-to-play li {
  margin-bottom: 5px;
  padding-left: 10px;
  position: relative;
}

/* PLAYING GAME SCREEN */
#game-screen {
  padding: 12px;
  overflow: hidden;
  justify-content: flex-start;
  gap: 10px;
}

/* HUD HEADER */
.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 52px;
}

.hud-item {
  background: white;
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.score-box {
  border-left: 4px solid var(--secondary);
}

.level-box {
  border-left: 4px solid var(--accent-green);
}

.hearts-box {
  background: #fff0f0;
  border-left: 4px solid var(--primary);
  flex: 0 0 110px;
}

.hud-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--light-text);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.hud-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark-text);
  line-height: 1.1;
}

.hud-sound-btn {
  background: white;
  border: none;
  font-size: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.hud-sound-btn:active {
  transform: scale(0.9);
}

.hud-sound-btn.muted {
  background: #ffe6e6;
  opacity: 0.7;
}

/* CUSTOMER AREA */
.customers-section {
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--card-radius);
  height: 155px;
  padding: 10px 5px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-inset);
  border: 2px dashed rgba(0, 0, 0, 0.05);
}

.customers-container {
  display: flex;
  width: 100%;
  justify-content: space-around;
  align-items: flex-end;
  gap: 5px;
}

/* Customer Card */
.customer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  animation: customer-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  cursor: pointer;
}

.customer:active .avatar-circle {
  transform: scale(0.95);
}

.avatar-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 3px solid white;
  transition: transform 0.15s ease;
  position: relative;
}

.customer.happy .avatar-circle {
  border-color: var(--accent-green);
  background: #e6fcf5;
}

.customer.angry .avatar-circle {
  border-color: var(--primary);
  background: #ffe3e3;
  animation: shake 0.3s infinite;
}

/* Speech order bubble */
.order-bubble {
  position: absolute;
  bottom: 60px;
  background: white;
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 76px;
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid white;
}

.order-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: white transparent;
  display: block;
  width: 0;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.order-item-badge {
  font-size: 18px;
  display: inline-block;
  padding: 1px;
}

.burger-recipe-badge {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1px;
  background: #f1f2f6;
  padding: 3px;
  border-radius: 6px;
}

.burger-layer-mini {
  font-size: 10px;
  line-height: 1;
}

/* Patience Timer bar */
.patience-container {
  width: 80%;
  height: 6px;
  background: #e1e2e6;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-inset);
}

.patience-bar {
  height: 100%;
  width: 100%;
  background-color: var(--accent-green);
  border-radius: 3px;
  transition: width 0.1s linear, background-color 0.3s ease;
}

/* KITCHEN WORKSPACE Layout */
.kitchen-workspace {
  display: flex;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  height: 380px;
}

.stations-area {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.station-block {
  background: var(--panel-bg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: var(--card-radius);
  padding: 8px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.6);
}

.station-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--light-text);
  margin-bottom: 6px;
  padding-left: 2px;
}

.appliances-grid {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

/* Appliance Slots */
.appliance {
  flex: 1;
  height: 80px;
  background: #dfe4ea;
  border-radius: 12px;
  border: 2px solid #ced6e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.appliance:active {
  transform: scale(0.95);
}

.appliance.slot-empty {
  border-style: dashed;
  background: rgba(223, 228, 234, 0.6);
  color: var(--light-text);
}

.appliance .item-visual {
  font-size: 26px;
  transition: transform 0.3s ease;
}

.slot-status-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--light-text);
}

/* Cooking States */
.appliance.cooking {
  background: #ffeaa7;
  border-color: var(--secondary);
}

.appliance.cooking .item-visual {
  animation: cook-vibrate 0.4s infinite;
}

.appliance.cooked {
  background: #c8f7dc;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(29, 209, 161, 0.4);
}

.appliance.cooked .item-visual {
  animation: cook-bounce 0.8s infinite;
}

.appliance.burning {
  background: #ffd2d2;
  border-color: var(--primary);
  animation: alert-flash 0.5s infinite;
}

.appliance.burning .item-visual {
  animation: cook-vibrate 0.15s infinite;
}

.appliance.burned {
  background: #747d8c;
  border-color: #2f3542;
}

.appliance.burned .item-visual {
  transform: scale(0.95);
  filter: brightness(0.4);
}

/* Circular/Linear Progress Bar on slots */
.progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.appliance.cooking .progress-bar-container,
.appliance.cooked .progress-bar-container,
.appliance.burning .progress-bar-container {
  opacity: 1;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--secondary);
  border-radius: 3px;
}

.appliance.burning .progress-bar {
  background-color: var(--primary);
}

/* Soda Machine Drink Dispenser */
.drink-machine-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 80px;
}

.drink-nozzle {
  width: 16px;
  height: 8px;
  background: #a4b0be;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  z-index: 2;
}

.drink-dispenser {
  width: 100%;
  max-width: 80px;
  height: 72px;
  background: #dfe4ea;
  border-radius: 12px;
  border: 2px solid #ced6e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drink-dispenser.filling {
  background: #eccc68;
}

.drink-dispenser.ready {
  background: #c8f7dc;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(29, 209, 161, 0.3);
}

.cup-visual {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.drink-dispenser.ready .cup-visual {
  animation: cook-bounce 0.8s infinite;
}

#drink-status-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--light-text);
}

.drink-dispenser.filling #drink-status-label {
  color: #d35400;
}

.drink-dispenser.ready #drink-status-label {
  color: #27ae60;
}

/* ASSEMBLY AREA */
.assembly-area {
  flex: 0.9;
  display: flex;
  flex-direction: column;
}

.plate-card {
  background: var(--panel-bg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: var(--card-radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.6);
}

.plate-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(0,0,0,0.05);
  padding-bottom: 6px;
}

.plate-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-text);
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-icon:active {
  transform: scale(0.85);
  background: rgba(255, 107, 107, 0.15);
}

.plate-surface {
  width: 100%;
  height: 190px;
  background: radial-gradient(circle, #f8f9fa 60%, #e9ecef 100%);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: var(--shadow-inset), 0 8px 16px rgba(0,0,0,0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 15px 0;
}

/* Burger build stack visual */
.burger-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.plate-empty-hint {
  font-size: 10px;
  color: var(--light-text);
  text-align: center;
  line-height: 1.4;
  padding: 0 10px;
}

/* Individual burger layers styles */
.burger-layer {
  font-size: 40px;
  line-height: 0.45;
  height: 18px;
  position: relative;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: drop-layer 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.burger-layer[data-ing="bun-bottom"] {
  height: 14px;
}

.burger-layer[data-ing="bun-top"] {
  height: 22px;
  z-index: 15;
}

/* Side dishes list on the plate */
.plate-sides {
  width: 100%;
  display: flex;
  justify-content: space-around;
  gap: 6px;
  border-top: 2px dashed rgba(0, 0, 0, 0.05);
  padding-top: 8px;
}

.side-item {
  background: white;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  flex: 1;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.side-item.disabled {
  opacity: 0.35;
  background: #f1f2f6;
  box-shadow: none;
}

.side-item.pop-anim {
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* BOTTOM AREA: CONTROL SHELF */
.controls-footer {
  background: white;
  border-radius: var(--card-radius);
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.ingredient-box-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--light-text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

.ingredients-shelf {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.ingredient-btn {
  flex: 1;
  height: 60px;
  background: #f1f2f6;
  border: 2px solid #e4e7eb;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ingredient-btn:active {
  transform: scale(0.9);
  background: #dfe4ea;
  border-color: #ced6e0;
}

.ing-emoji {
  font-size: 22px;
  margin-bottom: 2px;
}

.ing-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--dark-text);
}

.help-action-tips {
  font-size: 9px;
  color: var(--light-text);
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
}

/* GAME OVER MODAL */
#game-over-screen {
  background: rgba(47, 53, 66, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 24px;
}

.game-over-card {
  background: white;
  border-radius: 28px;
  padding: 30px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  text-align: center;
  border: 4px solid #fff;
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-over-title {
  font-family: var(--font-logo);
  color: var(--primary);
  font-size: 32px;
  margin-bottom: 8px;
}

.game-over-desc {
  font-size: 14px;
  color: var(--light-text);
  line-height: 1.4;
  margin-bottom: 24px;
}

.result-stats {
  background: #f8f9fa;
  border-radius: var(--card-radius);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--light-text);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark-text);
}

.new-record-badge {
  background: linear-gradient(45deg, var(--secondary), var(--primary));
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 6px;
  border-radius: 20px;
  animation: pulse-button 1s infinite;
}

.new-record-badge.hide {
  display: none;
}

.btn-bounce {
  animation: bounce 2s infinite;
}

/* FLOATING TIP TEXT */
.floating-tip {
  position: absolute;
  color: #27ae60;
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-logo);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 99;
  animation: float-up-fade 1s forwards ease-out;
}

.floating-tip.wrong {
  color: var(--primary);
}

/* ANIMATIONS */
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes pulse-button {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes customer-slide-in {
  from { transform: translateX(100px) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes drop-layer {
  from { transform: translateY(-80px) scaleY(1.4); }
  to { transform: translateY(0) scaleY(1); }
}

@keyframes cook-vibrate {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-1px, 1px) rotate(-1deg); }
  50% { transform: translate(1px, -1px) rotate(1deg); }
  75% { transform: translate(-1px, -1px) rotate(-1deg); }
}

@keyframes cook-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px) scaleY(1.05); }
}

@keyframes alert-flash {
  0%, 100% { background: #ffd2d2; }
  50% { background: #ff7675; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes float-up-fade {
  from { transform: translateY(0) scale(0.8); opacity: 1; }
  to { transform: translateY(-100px) scale(1.2); opacity: 0; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* SCREEN SHAKE EFFECT */
.shake-screen {
  animation: screen-shake 0.3s ease-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-3px, 2px); }
  20%, 40%, 60%, 80% { transform: translate(3px, -2px); }
}

/* Scrollbar tweaks */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
