/**
 * Sushi Smash - Modern Izakaya Theme Styling
 * Desktop Widescreen Layout + Mobile Responsive
 */

:root {
  --bg-main: #0c1015;
  --bg-panel: rgba(18, 24, 32, 0.95);
  --bg-card: #1e2632;
  --bg-slot: rgba(30, 39, 50, 0.7);
  --bg-slot-alt: rgba(23, 30, 39, 0.7);

  --wood-dark: #1e1614;
  --wood-rim: #3d2314;
  --gold: #f1c40f;
  --gold-glow: rgba(241, 196, 15, 0.4);
  --wasabi: #2ed573;
  --crimson: #c0392b;
  --crimson-light: #eb4d4b;
  --text-main: #ffffff;
  --text-muted: #a4b0be;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-main: 0 12px 40px rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(circle at 50% 20%, rgba(235, 77, 75, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(46, 213, 115, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #151a21 0%, #090c0f 100%);
  color: var(--text-main);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
}

/* --- App Container (Full Window Desktop & Mobile Scenery Experience) --- */
#app-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background-color: #0c1015;
  background-image:
    linear-gradient(rgba(10, 14, 20, 0.4), rgba(8, 12, 16, 0.65)),
    url('../assets/backgrounds/bg_izakaya.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease-in-out;
}

/* Dynamic Japanese Scenery Themes */
#app-container.theme-izakaya {
  background-image:
    linear-gradient(rgba(10, 14, 20, 0.4), rgba(8, 12, 16, 0.65)),
    url('../assets/backgrounds/bg_izakaya.jpg');
}

#app-container.theme-sakura {
  background-image:
    linear-gradient(rgba(10, 14, 20, 0.35), rgba(8, 12, 16, 0.55)),
    url('../assets/backgrounds/bg_sakura.jpg');
}

#app-container.theme-fuji {
  background-image:
    linear-gradient(rgba(10, 14, 20, 0.35), rgba(8, 12, 16, 0.55)),
    url('../assets/backgrounds/bg_fuji.jpg');
}

#app-container.theme-night {
  background-image:
    linear-gradient(rgba(10, 14, 20, 0.4), rgba(8, 12, 16, 0.65)),
    url('../assets/backgrounds/bg_night_alley.jpg');
}

/* --- Top Navigation Header --- */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(14, 18, 24, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--wood-rim);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-logo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ff7675, #fab1a0, #fdcb6e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 28px;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(1px);
}

.btn-muted {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.25);
}

.hidden {
  display: none !important;
}

/* --- Non-Obstructive Top Combo Toast Banner --- */
.combo-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.96), rgba(214, 48, 49, 0.96));
  border: 2px solid var(--gold);
  border-radius: 30px;
  padding: 6px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 16px rgba(241, 196, 15, 0.5);
  pointer-events: none;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-toast.hidden {
  display: none !important;
}

.toast-main {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.toast-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.pop-in {
  animation: toast-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fade-out {
  opacity: 0;
  transform: translate(-50%, -75%) scale(0.85);
}

@keyframes toast-pop {
  0% { transform: translate(-50%, -20%) scale(0.6); opacity: 0; }
  70% { transform: translate(-50%, -55%) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; }
}

/* --- Main Game Workspace (Widescreen Multi-Column) --- */
.game-workspace {
  flex: 1;
  display: flex;
  width: 100%;
  height: calc(100vh - 65px);
  overflow: hidden;
  background: transparent;
}

/* --- Left Sidebar HUD --- */
.sidebar-hud {
  width: 360px;
  padding: 20px 22px;
  background: rgba(14, 18, 26, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-card {
  background: rgba(26, 34, 44, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.sidebar-section-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fab1a0;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.level-meta h2 {
  font-size: 20px;
  font-weight: 900;
  color: #fab1a0;
  margin-bottom: 4px;
}

.level-meta p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.moves-card {
  padding: 0;
  background: transparent;
  border: none;
}

.moves-badge {
  background: linear-gradient(145deg, #2c1e1a, #4a1c18);
  border: 2px solid var(--crimson-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.moves-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fab1a0;
  letter-spacing: 0.6px;
}

.moves-count {
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  margin-top: 2px;
}

.moves-badge.low-moves {
  animation: pulse-danger 0.8s infinite alternate;
  border-color: #ff3838;
}

/* Score Progress Bar in Sidebar */
.score-progress-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-text-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--gold);
}

.progress-bar-track {
  width: 100%;
  height: 14px;
  background: rgba(10, 14, 20, 0.85);
  border-radius: 12px;
  position: relative;
  margin: 10px 0 4px 0;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff7675, #fab1a0, #f1c40f);
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(241, 196, 15, 0.7);
}

.star-nodes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.star-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2c3848 0%, #151c26 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #718093;
  line-height: 1;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3;
}

.star-node.earned {
  background: radial-gradient(circle at 35% 35%, #ffeaa7 0%, #fdcb6e 40%, #e17055 100%);
  border-color: #ffffff;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 14px rgba(241, 196, 15, 0.9), 0 3px 8px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%) scale(1.25);
  animation: starBubblePop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starBubblePop {
  0% { transform: translate(-50%, -50%) scale(0.8); }
  50% { transform: translate(-50%, -50%) scale(1.4); }
  100% { transform: translate(-50%, -50%) scale(1.25); }
}

/* Bento Order Objectives (1-Per-Line Spacious List) */
.orders-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(14, 18, 24, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all 0.25s ease;
}

.order-row:hover {
  background: rgba(22, 28, 38, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

.order-row.order-done {
  background: rgba(46, 213, 115, 0.15);
  border-color: var(--wasabi);
}

.order-piece-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.order-piece-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.order-icon-large {
  font-size: 32px;
}

.order-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.order-subtitle {
  font-size: 11px;
  color: #fab1a0;
  font-weight: 600;
}

.order-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  background: rgba(235, 77, 75, 0.2);
  border: 1px solid var(--crimson-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
}

.order-badge.badge-done {
  background: rgba(46, 213, 115, 0.25);
  border-color: var(--wasabi);
  color: var(--wasabi);
  font-weight: 900;
  font-size: 13px;
}

.remaining-num {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.remaining-label {
  font-size: 10px;
  font-weight: 800;
  color: #fab1a0;
  letter-spacing: 0.5px;
}

.check-icon {
  font-size: 16px;
  color: var(--wasabi);
  margin-right: 2px;
}

/* --- Center Game Canvas Arena with Cute Japanese Backgrounds --- */
.canvas-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow: hidden;
  background: transparent;
}

#canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: transparent;
}

#game-canvas {
  display: block;
  touch-action: none;
  cursor: pointer;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.7));
}

/* --- Right Sidebar Special Powers --- */
.sidebar-powers {
  width: 340px;
  padding: 20px 22px;
  background: rgba(14, 18, 26, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.quick-power-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-power-item {
  background: rgba(14, 18, 24, 0.75);
  border-left: 3px solid;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.wasabi-border { border-left-color: var(--wasabi); }
.aburi-border { border-left-color: #ff9f1a; }
.dragon-border { border-left-color: var(--gold); }

.quick-power-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.quick-power-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.quick-merger-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.merger-pill {
  background: rgba(14, 18, 24, 0.75);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-main);
  border-left: 2px solid var(--crimson-light);
}

.merger-pill strong {
  color: var(--gold);
}

/* --- MODALS (Widescreen Optimized) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000 !important;
  padding: 24px;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-main);
  animation: modal-enter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.modal-widescreen {
  max-width: 980px !important;
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1.0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 900;
  color: #fab1a0;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-close:hover {
  color: #ffffff;
}

/* Level Select Grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.level-card {
  background: rgba(24, 30, 38, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.level-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px var(--gold-glow);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.level-number, .level-num {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.level-name {
  font-size: 13px;
  font-weight: 700;
  color: #fab1a0;
}

.level-stars {
  display: flex;
  gap: 4px;
  font-size: 18px;
  color: #485460;
}

.star-icon {
  color: #3d4a5d;
  transition: all 0.2s ease;
}

.star-icon.earned,
.level-stars .earned,
.level-stars .star-earned {
  color: var(--gold) !important;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.95), 0 0 4px #e67e22 !important;
  filter: drop-shadow(0 2px 4px rgba(241, 196, 15, 0.5));
}

.level-score {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(241, 196, 15, 0.12);
  border: 1px solid rgba(241, 196, 15, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Victory / Game Over Modals */
.victory-modal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.victory-title {
  font-size: 32px;
  font-weight: 900;
  color: #fbc531;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.victory-stars {
  display: flex;
  gap: 12px;
  font-size: 42px;
  margin: 10px 0;
}

.victory-star {
  color: #2d3436;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-star.earned {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(241, 196, 15, 0.9);
  animation: star-bounce 0.5s ease;
}

@keyframes star-bounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); opacity: 1; }
}

.highscore-badge {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.5);
  animation: pulse-badge 1s infinite alternate;
}

@keyframes pulse-badge {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.stats-card {
  background: rgba(18, 23, 29, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 28px;
  display: flex;
  gap: 30px;
}

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

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-value {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
}

/* --- Continue / Out of Moves Modal --- */
.continue-modal {
  max-width: 540px !important;
  padding: 32px 30px !important;
  gap: 20px;
}

.continue-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.continue-badge {
  background: rgba(235, 77, 75, 0.2);
  border: 1px solid var(--crimson-light);
  color: #fab1a0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
}

.continue-title {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.continue-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

/* Extra Moves Buttons */
.extra-moves-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.move-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.move-option-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.ad-option-btn {
  background: linear-gradient(135deg, rgba(20, 45, 30, 0.9), rgba(15, 30, 22, 0.95));
  border-color: #2ed573;
  box-shadow: 0 6px 20px rgba(46, 213, 115, 0.25);
}

.ad-option-btn:hover {
  box-shadow: 0 10px 28px rgba(46, 213, 115, 0.45);
  border-color: #7bed9f;
}

.buy-option-btn {
  background: linear-gradient(135deg, rgba(50, 35, 10, 0.9), rgba(30, 20, 8, 0.95));
  border-color: #f1c40f;
  box-shadow: 0 6px 20px rgba(241, 196, 15, 0.25);
}

.buy-option-btn:hover {
  box-shadow: 0 10px 28px rgba(241, 196, 15, 0.45);
  border-color: #ffeaa7;
}

.move-option-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.option-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.option-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.option-name {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
}

.option-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.option-reward-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  min-width: 80px;
}

.ad-reward {
  background: rgba(46, 213, 115, 0.2);
  border: 1px solid #2ed573;
  color: #2ed573;
}

.buy-reward {
  background: rgba(241, 196, 15, 0.2);
  border: 1px solid #f1c40f;
  color: #f1c40f;
}

.reward-plus {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.reward-unit {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.reward-tag {
  font-size: 11px;
  font-weight: 900;
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #2ed573;
  color: #0d1e13;
}

.price-tag {
  background: #f1c40f;
  color: #2b1d03;
}

.continue-stats {
  width: 100%;
  justify-content: space-around;
  padding: 12px 20px;
}

.continue-actions {
  width: 100%;
  gap: 12px;
}

/* --- Simulated Ad Player Modal --- */
.ad-player-card {
  max-width: 480px !important;
  background: #0d1117 !important;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-sponsor-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.ad-timer {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
}

.ad-screen {
  background: linear-gradient(145deg, #1b2838, #2a475e);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-tv-icon {
  font-size: 48px;
  animation: pulse-tv 1s infinite alternate;
}

@keyframes pulse-tv {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.ad-content-box h3 {
  font-size: 18px;
  font-weight: 900;
  color: #fab1a0;
  margin-bottom: 6px;
}

.ad-content-box p {
  font-size: 13px;
  color: #ffffff;
  opacity: 0.85;
  margin-bottom: 16px;
}

.ad-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
}

.ad-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2ed573, #7bed9f);
  border-radius: 10px;
  transition: width 0.05s linear;
}

.ad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #2ed573;
}

.ad-simulated-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Simulated Store Purchase Modal --- */
.iap-confirm-card {
  max-width: 440px !important;
  text-align: center;
}

.iap-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.iap-icon {
  font-size: 52px;
}

.iap-body h3 {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.iap-price-tag {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  background: rgba(241, 196, 15, 0.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 6px 20px;
  margin: 6px 0;
}

.iap-note {
  font-size: 12px;
  color: var(--text-muted);
}

.iap-pay-btn {
  background: linear-gradient(135deg, #f1c40f, #e67e22) !important;
  color: #1a1202 !important;
  font-weight: 900 !important;
  font-size: 17px !important;
}

.modal-actions {
  display: flex;
  gap: 14px;
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff7675, #d63031);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(214, 48, 49, 0.4);
  transition: all 0.18s ease;
  flex: 1;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff6b6b, #c0392b);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(214, 48, 49, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  flex: 1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* --- Sushi Cookbook Guide Cards --- */
.guide-section {
  margin-bottom: 24px;
}

.guide-section h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fab1a0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.guide-card {
  background: rgba(24, 30, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.guide-piece-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.guide-jp {
  font-size: 11px;
  color: #fab1a0;
  font-weight: 600;
}

.guide-header strong {
  font-size: 15px;
  color: #ffffff;
}

.guide-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.special-card {
  border-width: 2px;
}

.wasabi-card {
  border-color: var(--wasabi);
  background: rgba(46, 213, 115, 0.12);
}

.aburi-card {
  border-color: #ff9f1a;
  background: rgba(255, 159, 26, 0.12);
}

.dragon-card {
  border-color: var(--gold);
  background: rgba(241, 196, 15, 0.12);
}

.combo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.combo-item {
  background: rgba(18, 23, 29, 0.7);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-main);
  border-left: 3px solid var(--crimson-light);
  display: flex;
  align-items: center;
  gap: 16px;
}

.combo-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: var(--gold);
  font-size: 15px;
  min-width: 76px;
}

.combo-mini-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.order-piece-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* --- Developer Tools Styles --- */
.dev-toggle-btn {
  background: rgba(0, 206, 201, 0.15) !important;
  border-color: #00cec9 !important;
  color: #81ecec !important;
  font-weight: 800 !important;
}

.dev-toggle-btn:hover {
  background: rgba(0, 206, 201, 0.3) !important;
  box-shadow: 0 0 14px rgba(0, 206, 201, 0.5) !important;
}

.dev-modal-card {
  max-width: 680px !important;
  background: #0f141c !important;
  border: 2px solid #00cec9 !important;
  box-shadow: 0 10px 40px rgba(0, 206, 201, 0.25) !important;
}

.dev-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.dev-section {
  background: rgba(22, 29, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dev-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #81ecec;
  letter-spacing: 0.6px;
}

.dev-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dev-select {
  background: rgba(10, 14, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  min-width: 180px;
}

.dev-select option {
  background: #161d28;
  color: #ffffff;
}

.dev-input {
  background: rgba(10, 14, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  width: 90px;
  text-align: center;
}

.dev-btn {
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  flex: initial !important;
}

/* Settings Slider Component */
.setting-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.setting-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.8);
  cursor: pointer;
}

/* --- Main Menu Title & Mode Selection Screen --- */
.main-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(28px, env(safe-area-inset-top, 28px)) 16px max(48px, env(safe-area-inset-bottom, 48px)) 16px;
  animation: fadeIn 0.3s ease;
}

.main-menu-overlay.hidden {
  display: none !important;
}

/* --- Initial Landing / Auth Screen --- */
.landing-card {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 29, 40, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.landing-logo-icon {
  font-size: 54px;
  animation: floatBounce 2.5s ease-in-out infinite;
}

.landing-game-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ff7675, #fab1a0, #fdcb6e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.landing-tagline {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.landing-auth-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.landing-prompt {
  font-size: 13px;
  color: #fab1a0;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}

.btn-google-large {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.btn-google-large:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.google-icon-large {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.landing-divider {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 4px 0;
}

.landing-divider::before, .landing-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.landing-divider span {
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.landing-free-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
}

.main-menu-content {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: auto;
}

.menu-hero {
  text-align: center;
}

.menu-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  padding: 8px 24px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.menu-logo-icon {
  font-size: 36px;
  animation: floatBounce 2.5s ease-in-out infinite;
}

.menu-game-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ff7675, #fab1a0, #fdcb6e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-tagline {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 8px;
}

/* Player Profile Card in Main Menu */
.menu-profile-card {
  width: 100%;
  max-width: 780px;
  background: linear-gradient(135deg, rgba(26, 34, 46, 0.9), rgba(16, 22, 30, 0.9));
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
}

.google-connected-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
  border-radius: 10px;
  padding: 1px 6px;
}

.btn-mini {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}

.btn-mini:hover {
  opacity: 1;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-google-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google-compact:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.profile-rank-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.profile-rank-title {
  color: var(--gold);
}

.profile-rank-rp {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  background: rgba(10, 14, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

.stat-lbl {
  color: var(--text-muted);
  margin-right: 4px;
}

/* Mode Selection Cards Grid */
.mode-cards-grid {
  width: 100%;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.mode-card {
  background: rgba(22, 29, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.mode-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.mode-card-badge.ranked-glow {
  background: rgba(230, 126, 34, 0.25);
  color: #ff9f43;
  border: 1px solid rgba(230, 126, 34, 0.4);
}

.mode-card-badge.live-badge {
  background: rgba(9, 132, 227, 0.25);
  color: #74b9ff;
  border: 1px solid rgba(9, 132, 227, 0.4);
}

.mode-card-badge.zen-badge {
  background: rgba(46, 213, 115, 0.25);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
}

.mode-card-icon {
  font-size: 38px;
}

.mode-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.mode-play-btn {
  margin-top: auto;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 800;
}

.menu-bottom-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Speed Battle 60s Live Battle HUD --- */
.speed-battle-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(14, 18, 26, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--crimson);
  z-index: 15;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.battle-player-side, .battle-rival-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.battle-rival-side {
  justify-content: flex-end;
}

.battle-avatar {
  font-size: 26px;
}

.battle-info {
  display: flex;
  flex-direction: column;
}

.battle-info.align-right {
  text-align: right;
}

.battle-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.battle-score {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.battle-fever-badge {
  background: linear-gradient(135deg, #e74c3c, #f39c12);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  animation: pulse-danger 0.5s infinite alternate;
}

.rival-action-tag {
  font-size: 10px;
  font-weight: 800;
  color: #ff7675;
  background: rgba(255, 118, 117, 0.15);
  border: 1px solid rgba(255, 118, 117, 0.35);
  padding: 1px 6px;
  border-radius: 6px;
  margin-top: 3px;
  white-space: nowrap;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.battle-center-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.battle-timer-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(22, 29, 40, 0.9);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
}

.timer-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
}

.timer-unit {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.tug-bar-track {
  width: 180px;
  height: 6px;
  background: rgba(235, 77, 75, 0.7);
  border-radius: 3px;
  overflow: hidden;
}

.tug-bar-fill {
  height: 100%;
  background: #2ed573;
  transition: width 0.2s ease;
}

/* --- Settings Modal --- */
.settings-modal-card {
  max-width: 480px !important;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(22, 29, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.setting-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.setting-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.setting-toggle-btn {
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  min-width: 60px;
}

/* --- Ranked Match Podium Modal --- */
.ranked-result-card {
  max-width: 460px !important;
  text-align: center;
}

.ranked-banner {
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranked-banner.victory {
  background: linear-gradient(135deg, rgba(46, 213, 115, 0.25), rgba(16, 172, 132, 0.35));
  border: 2px solid var(--wasabi);
}

.ranked-banner.defeat {
  background: linear-gradient(135deg, rgba(235, 77, 75, 0.25), rgba(192, 57, 43, 0.35));
  border: 2px solid var(--crimson);
}

.ranked-banner-title {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
}

.ranked-banner-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.ranked-rp-card {
  background: rgba(22, 29, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.ranked-tier-icon-wrap {
  font-size: 38px;
}

.ranked-rp-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranked-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranked-tier-name {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}

.ranked-rp-change {
  font-size: 14px;
  font-weight: 900;
}

.ranked-rp-change.plus {
  color: var(--wasabi);
}

.ranked-rp-change.minus {
  color: var(--crimson-light);
}

.ranked-rp-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(10, 14, 20, 0.8);
  border-radius: 4px;
  overflow: hidden;
}

.ranked-rp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f1c40f, #2ecc71);
  transition: width 0.5s ease;
}

.ranked-rp-subtext {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.promotion-toast {
  background: linear-gradient(135deg, #f1c40f, #e67e22);
  color: #000000;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 12px;
  animation: pulse-danger 0.6s infinite alternate;
}

.ranked-scores-comparison {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(14, 18, 26, 0.8);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.score-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-col .col-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.score-col .col-val {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

.score-col-vs {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
}

/* --- Mobile / Small Screen Fallback --- */
@media (max-width: 960px) {
  .sidebar-powers {
    display: none;
  }
  .sidebar-hud {
    width: 280px;
  }
}

/* --- Desktop Sidebar Groups --- */
.hud-top-group, .hud-bottom-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* --- Mobile Responsive (<= 768px): Spacious Native Layout & Zero Overlap --- */
@media (max-width: 768px) {
  .game-header {
    padding: max(10px, env(safe-area-inset-top, 10px)) 16px 8px 16px;
    height: auto;
    min-height: calc(48px + env(safe-area-inset-top, 0px));
    background: rgba(14, 18, 26, 0.96);
    border-bottom: 1.5px solid var(--wood-rim);
  }

  .game-logo {
    font-size: 16px;
    gap: 6px;
  }

  .logo-icon {
    font-size: 20px;
  }

  .header-controls {
    gap: 6px;
  }

  /* Keep top header clean by showing essential actions on mobile */
  .header-controls .btn-icon:not(#btn-home):not(#btn-settings):not(#btn-toggle-sfx) {
    display: none !important;
  }

  .btn-icon {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  /* Game Workspace as Full-Height Column */
  .game-workspace {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100vh - 48px - env(safe-area-inset-top, 0px));
    overflow: hidden;
    position: relative;
    padding: 0;
  }

  .sidebar-hud {
    display: contents; /* Unwraps top and bottom groups into game-workspace flex */
  }

  /* 1. TOP HUD (Above Board): Level Info & Bento Goals (Full Width, One Objective Per Line!) */
  .hud-top-group {
    order: 1;
    width: 100%;
    padding: 10px 16px 12px 16px;
    background: rgba(14, 18, 26, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
  }

  .level-info-card {
    padding: 0;
    background: transparent;
    border: none;
    width: 100%;
    text-align: center;
    box-shadow: none;
  }

  .level-meta h2 {
    font-size: 16px;
    font-weight: 900;
    margin: 0 0 2px 0;
    color: #fab1a0;
    letter-spacing: 0.5px;
  }

  .level-meta p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin: 0;
  }

  .orders-card {
    width: 100%;
    max-width: 480px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .orders-card .sidebar-section-title {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    text-align: center;
  }

  /* Each Objective on its OWN Full-Width Row */
  .orders-tray {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .order-row {
    width: 100%;
    padding: 8px 14px;
    gap: 12px;
    border-radius: var(--radius-md);
    background: rgba(26, 34, 46, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }

  .order-piece-wrapper {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .order-piece-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
  }

  .order-icon-large {
    font-size: 24px;
  }

  .order-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .order-name {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
  }

  .order-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: #fab1a0;
    display: inline-block;
  }

  .order-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 800;
    min-width: 65px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(235, 77, 75, 0.25);
    border: 1px solid var(--crimson-light);
  }

  .order-badge.badge-done {
    background: rgba(46, 213, 115, 0.25);
    border-color: var(--wasabi);
    color: var(--wasabi);
  }

  .remaining-num {
    font-size: 15px;
    font-weight: 900;
    color: #ffffff;
  }

  .remaining-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    color: #fab1a0;
    text-transform: uppercase;
  }

  /* 2. CENTER GAME ARENA (Maximized Canvas Board) */
  .canvas-wrapper {
    order: 2;
    flex: 1;
    width: 100%;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-height: 0;
  }

  #canvas-container {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* 3. BOTTOM HUD (Below Board): Generous Breathing Room above Android Nav Bar */
  .hud-bottom-group {
    order: 3;
    width: 100%;
    padding: 12px 16px max(24px, env(safe-area-inset-bottom, 24px)) 16px;
    background: rgba(14, 18, 26, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1.5px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
  }

  .moves-card {
    flex: 0 0 auto;
    min-width: 105px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .moves-badge {
    padding: 10px 16px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(235, 77, 75, 0.35), rgba(192, 57, 43, 0.25));
    border: 2px solid var(--crimson-light);
    box-shadow: 0 4px 16px rgba(235, 77, 75, 0.25);
  }

  .moves-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #fab1a0;
    text-transform: uppercase;
  }

  .moves-count {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
  }

  .score-card {
    flex: 1;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: rgba(22, 29, 40, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .score-text-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .score-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .score-num {
    font-size: 18px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
  }

  .progress-bar-track {
    height: 13px;
    border-radius: 10px;
    margin: 8px 2px 2px 2px;
  }

  .star-nodes {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .star-node {
    width: 23px;
    height: 23px;
    font-size: 13px;
  }

  .speed-battle-hud {
    padding: max(10px, env(safe-area-inset-top, 10px)) 14px 8px 14px;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
  }

  /* --- Main Menu Mobile Formatting --- */
  .main-menu-content {
    gap: 14px;
    padding-bottom: 24px;
  }

  .menu-logo-badge {
    padding: 6px 18px;
    gap: 8px;
  }

  .menu-logo-icon {
    font-size: 28px;
  }

  .menu-game-title {
    font-size: 26px;
  }

  .menu-tagline {
    font-size: 12px;
    margin-top: 4px;
  }

  /* Spacious Clean Profile Card on Mobile */
  .menu-profile-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
  }

  .profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .profile-avatar {
    width: 44px;
    height: 44px;
    font-size: 26px;
    flex-shrink: 0;
  }

  .profile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .profile-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .profile-name {
    font-size: 16px;
    font-weight: 900;
  }

  .profile-rank-row {
    font-size: 12px;
    gap: 4px;
  }

  .profile-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    width: auto;
    border-top: none;
    padding-top: 0;
  }

  .profile-right .stat-pill {
    padding: 3px 8px;
    font-size: 11px;
    white-space: nowrap;
    width: auto;
  }

  /* Game Modes Grid on Mobile */
  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .mode-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .mode-title {
    font-size: 17px;
  }

  .mode-desc {
    font-size: 12px;
  }

  .mode-play-btn {
    padding: 11px;
    font-size: 14px;
    margin-top: 4px;
  }

  /* Bottom Actions Grid on Mobile */
  .menu-bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin-top: 8px;
    padding-bottom: 24px;
  }

  .menu-bottom-actions .btn-icon {
    width: 100%;
    justify-content: center;
    height: 38px;
    font-size: 12px;
    font-weight: 800;
  }
}
