/* Shared game controller. Every rule stays under a game parent. */

#mg-ws-app .mg-ctrl-actions,
#mg-wm-app .mg-ctrl-actions,
#mg-wt-app .mg-ctrl-actions,
#mg-mm-app .mg-ctrl-actions,
#page-games .mg-ctrl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#mg-ws-app .mg-ctrl-btn-state,
#mg-wm-app .mg-ctrl-btn-state,
#mg-wt-app .mg-ctrl-btn-state,
#mg-mm-app .mg-ctrl-btn-state,
#page-games .mg-ctrl-btn-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

#mg-ws-app .mg-ctrl-btn-state[hidden],
#mg-wm-app .mg-ctrl-btn-state[hidden],
#mg-wt-app .mg-ctrl-btn-state[hidden],
#mg-mm-app .mg-ctrl-btn-state[hidden],
#page-games .mg-ctrl-btn-state[hidden] {
  display: none !important;
}

#mg-ws-app .mg-ctrl-btn-start,
#mg-wm-app .mg-ctrl-btn-start,
#mg-wt-app .mg-ctrl-btn-start,
#mg-mm-app .mg-ctrl-btn-start,
#page-games .mg-ctrl-btn-start,
#mg-ws-app .mg-ctrl-btn-resume,
#mg-wm-app .mg-ctrl-btn-resume,
#mg-wt-app .mg-ctrl-btn-resume,
#mg-mm-app .mg-ctrl-btn-resume,
#page-games .mg-ctrl-btn-resume {
  color: #ffffff;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

#mg-ws-app .mg-ctrl-btn-pause,
#mg-wm-app .mg-ctrl-btn-pause,
#mg-wt-app .mg-ctrl-btn-pause,
#mg-mm-app .mg-ctrl-btn-pause,
#page-games .mg-ctrl-btn-pause {
  color: #7c2d12;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 4px 0 #d97706;
}

#mg-ws-app .mg-ctrl-btn-state:active,
#mg-wm-app .mg-ctrl-btn-state:active,
#mg-wt-app .mg-ctrl-btn-state:active,
#mg-mm-app .mg-ctrl-btn-state:active,
#page-games .mg-ctrl-btn-state:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #15803d;
}

#mg-ws-app .mg-ctrl-btn-pause:active,
#mg-wm-app .mg-ctrl-btn-pause:active,
#mg-wt-app .mg-ctrl-btn-pause:active,
#mg-mm-app .mg-ctrl-btn-pause:active,
#page-games .mg-ctrl-btn-pause:active {
  box-shadow: 0 2px 0 #d97706;
}

#mg-ws-app .mg-ctrl-board-locked,
#mg-wm-app .mg-ctrl-board-locked,
#mg-wt-app .mg-ctrl-board-locked,
#mg-mm-app .mg-ctrl-board-locked,
#page-games .mg-ctrl-board-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}

#mg-ws-app .mg-ctrl-board-locked::after,
#mg-wm-app .mg-ctrl-board-locked::after,
#mg-wt-app .mg-ctrl-board-locked::after,
#mg-mm-app .mg-ctrl-board-locked::after,
#page-games .mg-ctrl-board-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.42);
}

#mg-ws-app.mg-ctrl-paused .mg-ctrl-board-locked::after,
#mg-wm-app.mg-ctrl-paused .mg-ctrl-board-locked::after,
#mg-wt-app.mg-ctrl-paused .mg-ctrl-board-locked::after,
#mg-mm-app.mg-ctrl-paused .mg-ctrl-board-locked::after,
#page-games .mg-crossword-container.mg-ctrl-paused .mg-ctrl-board-locked::after {
  background: transparent;
}

#mg-ws-app .mg-ctrl-countdown-overlay,
#mg-wm-app .mg-ctrl-countdown-overlay,
#mg-wt-app .mg-ctrl-countdown-overlay,
#mg-mm-app .mg-ctrl-countdown-overlay,
#page-games .mg-crossword-container .mg-ctrl-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  transition: opacity 0.4s ease;
}

#page-games .mg-crossword-container .mg-ctrl-countdown-overlay {
  z-index: 1200;
}

#mg-ws-app .mg-ctrl-countdown-overlay[hidden],
#mg-wm-app .mg-ctrl-countdown-overlay[hidden],
#mg-wt-app .mg-ctrl-countdown-overlay[hidden],
#mg-mm-app .mg-ctrl-countdown-overlay[hidden],
#page-games .mg-ctrl-countdown-overlay[hidden],
#mg-ws-app .mg-ctrl-pause-modal[hidden],
#mg-wm-app .mg-ctrl-pause-modal[hidden],
#mg-wt-app .mg-ctrl-pause-modal[hidden],
#mg-mm-app .mg-ctrl-pause-modal[hidden],
#page-games .mg-ctrl-pause-modal[hidden] {
  display: none !important;
}

#mg-ws-app .mg-ctrl-countdown-fade,
#mg-wm-app .mg-ctrl-countdown-fade,
#mg-wt-app .mg-ctrl-countdown-fade,
#mg-mm-app .mg-ctrl-countdown-fade,
#page-games .mg-ctrl-countdown-fade {
  opacity: 0;
}

#mg-ws-app .mg-ctrl-countdown-num,
#mg-wm-app .mg-ctrl-countdown-num,
#mg-wt-app .mg-ctrl-countdown-num,
#mg-mm-app .mg-ctrl-countdown-num,
#page-games .mg-ctrl-countdown-num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(92px, 18vw, 168px);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 10px 0 rgba(225, 29, 72, 0.35), 0 18px 30px rgba(15, 23, 42, 0.28);
}

#mg-ws-app .mg-ctrl-pop,
#mg-wm-app .mg-ctrl-pop,
#mg-wt-app .mg-ctrl-pop,
#mg-mm-app .mg-ctrl-pop,
#page-games .mg-ctrl-pop {
  animation: mg-ctrl-pop 0.45s cubic-bezier(0.2, 1.45, 0.4, 1) both;
}

#mg-ws-app .mg-ctrl-pause-modal,
#mg-wm-app .mg-ctrl-pause-modal,
#mg-wt-app .mg-ctrl-pause-modal,
#mg-mm-app .mg-ctrl-pause-modal,
#page-games .mg-crossword-container .mg-ctrl-pause-modal {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-self: center;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 10px auto 0;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

#mg-ws-app.mg-ctrl-paused .mg-ws-header,
#mg-wm-app.mg-ctrl-paused .mg-wm-header,
#mg-wt-app.mg-ctrl-paused .mg-wt-header,
#mg-mm-app.mg-ctrl-paused .mg-mm-header {
  position: relative;
  z-index: 28;
}

#page-games .mg-crossword-container.mg-ctrl-paused .mg-cw-topbar {
  position: relative;
  z-index: 1000;
}

#mg-ws-app .mg-ctrl-pause-card,
#mg-wm-app .mg-ctrl-pause-card,
#mg-wt-app .mg-ctrl-pause-card,
#mg-mm-app .mg-ctrl-pause-card,
#page-games .mg-ctrl-pause-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  height: 68px;
  max-height: 75px;
  padding: 0 10px 0 16px;
  border: 1.5px solid #fde68a;
  border-radius: 50px;
  background: rgba(255, 251, 245, 0.97);
  box-shadow: 0 10px 26px rgba(120, 80, 40, 0.16);
  animation: mg-ctrl-pause-in 0.28s ease;
}

#mg-ws-app .mg-ctrl-pause-title,
#mg-wm-app .mg-ctrl-pause-title,
#mg-wt-app .mg-ctrl-pause-title,
#mg-mm-app .mg-ctrl-pause-title,
#page-games .mg-ctrl-pause-title {
  margin: 0;
  min-width: 0;
  font-family: 'Mali', 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #9a3412;
}

#mg-ws-app .mg-ctrl-pause-actions,
#mg-wm-app .mg-ctrl-pause-actions,
#mg-wt-app .mg-ctrl-pause-actions,
#mg-mm-app .mg-ctrl-pause-actions,
#page-games .mg-ctrl-pause-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

#mg-ws-app .mg-ctrl-pause-resume,
#mg-wm-app .mg-ctrl-pause-resume,
#mg-wt-app .mg-ctrl-pause-resume,
#mg-mm-app .mg-ctrl-pause-resume,
#page-games .mg-ctrl-pause-resume,
#mg-ws-app .mg-ctrl-pause-home,
#mg-wm-app .mg-ctrl-pause-home,
#mg-wt-app .mg-ctrl-pause-home,
#mg-mm-app .mg-ctrl-pause-home,
#page-games .mg-ctrl-pause-home {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#mg-ws-app .mg-ctrl-pause-resume,
#mg-wm-app .mg-ctrl-pause-resume,
#mg-wt-app .mg-ctrl-pause-resume,
#mg-mm-app .mg-ctrl-pause-resume,
#page-games .mg-ctrl-pause-resume {
  border: none;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  box-shadow: 0 3px 0 #16a34a;
}

#mg-ws-app .mg-ctrl-pause-home,
#mg-wm-app .mg-ctrl-pause-home,
#mg-wt-app .mg-ctrl-pause-home,
#mg-mm-app .mg-ctrl-pause-home,
#page-games .mg-ctrl-pause-home {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

@keyframes mg-ctrl-pause-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mg-ctrl-pop {
  0% {
    transform: scale(0.35);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Phonics Bubble Pop uses the same controller chrome. */

#mg-bp-app .mg-ctrl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#mg-bp-app .mg-ctrl-btn-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

#mg-bp-app .mg-ctrl-btn-state[hidden],
#mg-bp-app .mg-ctrl-countdown-overlay[hidden],
#mg-bp-app .mg-ctrl-pause-modal[hidden] {
  display: none !important;
}

#mg-bp-app .mg-ctrl-btn-start,
#mg-bp-app .mg-ctrl-btn-resume {
  color: #ffffff;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

#mg-bp-app .mg-ctrl-btn-pause {
  color: #7c2d12;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 4px 0 #d97706;
}

#mg-bp-app .mg-ctrl-btn-start:active,
#mg-bp-app .mg-ctrl-btn-resume:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #15803d;
}

#mg-bp-app .mg-ctrl-btn-pause:active {
  box-shadow: 0 2px 0 #d97706;
}

#mg-bp-app .mg-ctrl-board-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}

#mg-bp-app .mg-ctrl-board-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.42);
}

#mg-bp-app.mg-ctrl-paused .mg-ctrl-board-locked::after {
  background: transparent;
}

#mg-bp-app .mg-ctrl-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  transition: opacity 0.4s ease;
}

#mg-bp-app .mg-ctrl-countdown-fade {
  opacity: 0;
}

#mg-bp-app .mg-ctrl-countdown-num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(92px, 18vw, 168px);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 10px 0 rgba(225, 29, 72, 0.35), 0 18px 30px rgba(15, 23, 42, 0.28);
}

#mg-bp-app .mg-ctrl-pop {
  animation: mg-ctrl-pop 0.45s cubic-bezier(0.2, 1.45, 0.4, 1) both;
}

#mg-bp-app .mg-ctrl-pause-modal {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 40;
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 0;
  pointer-events: none;
  background: transparent;
  transform: translateX(-50%);
}

#mg-bp-app.mg-ctrl-paused .mg-bp-header {
  position: relative;
  z-index: 28;
}

#mg-bp-app .mg-ctrl-pause-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 16px);
  height: 64px;
  max-height: 68px;
  padding: 0 10px 0 16px;
  border: 1.5px solid #fde68a;
  border-radius: 50px;
  background: rgba(255, 251, 245, 0.97);
  box-shadow: 0 10px 26px rgba(120, 80, 40, 0.16);
  animation: mg-ctrl-pause-in 0.28s ease;
}

#mg-bp-app .mg-ctrl-pause-title {
  margin: 0;
  min-width: 0;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Mali', 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #9a3412;
}

#mg-bp-app .mg-ctrl-pause-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

#mg-bp-app .mg-ctrl-pause-resume,
#mg-bp-app .mg-ctrl-pause-home {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#mg-bp-app .mg-ctrl-pause-resume {
  border: none;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  box-shadow: 0 3px 0 #16a34a;
}

#mg-bp-app .mg-ctrl-pause-home {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

/* Hidden Object uses the same controller chrome. */

#mg-ho-app .mg-ctrl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#mg-ho-app .mg-ctrl-btn-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

#mg-ho-app .mg-ctrl-btn-state[hidden],
#mg-ho-app .mg-ctrl-countdown-overlay[hidden],
#mg-ho-app .mg-ctrl-pause-modal[hidden] {
  display: none !important;
}

#mg-ho-app .mg-ctrl-btn-start,
#mg-ho-app .mg-ctrl-btn-resume {
  color: #ffffff;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

#mg-ho-app .mg-ctrl-btn-pause {
  color: #7c2d12;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 4px 0 #d97706;
}

#mg-ho-app .mg-ctrl-btn-start:active,
#mg-ho-app .mg-ctrl-btn-resume:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #15803d;
}

#mg-ho-app .mg-ctrl-btn-pause:active {
  box-shadow: 0 2px 0 #d97706;
}

#mg-ho-app .mg-ctrl-board-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}

#mg-ho-app .mg-ctrl-board-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.42);
}

#mg-ho-app.mg-ctrl-paused .mg-ctrl-board-locked::after {
  background: transparent;
}

#mg-ho-app .mg-ctrl-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  transition: opacity 0.4s ease;
}

#mg-ho-app .mg-ctrl-countdown-fade {
  opacity: 0;
}

#mg-ho-app .mg-ctrl-countdown-num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(92px, 18vw, 168px);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 10px 0 rgba(225, 29, 72, 0.35), 0 18px 30px rgba(15, 23, 42, 0.28);
}

#mg-ho-app .mg-ctrl-pop {
  animation: mg-ctrl-pop 0.45s cubic-bezier(0.2, 1.45, 0.4, 1) both;
}

#mg-ho-app .mg-ctrl-pause-modal {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 40;
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 0;
  pointer-events: none;
  background: transparent;
  transform: translateX(-50%);
}

#mg-ho-app.mg-ctrl-paused .mg-ho-header {
  position: relative;
  z-index: 28;
}

#mg-ho-app .mg-ctrl-pause-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 16px);
  height: 64px;
  max-height: 68px;
  padding: 0 10px 0 16px;
  border: 1.5px solid #fde68a;
  border-radius: 50px;
  background: rgba(255, 251, 245, 0.97);
  box-shadow: 0 10px 26px rgba(120, 80, 40, 0.16);
  animation: mg-ctrl-pause-in 0.28s ease;
}

#mg-ho-app .mg-ctrl-pause-title {
  margin: 0;
  min-width: 0;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Mali', 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #9a3412;
}

#mg-ho-app .mg-ctrl-pause-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

#mg-ho-app .mg-ctrl-pause-resume,
#mg-ho-app .mg-ctrl-pause-home {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#mg-ho-app .mg-ctrl-pause-resume {
  border: none;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  box-shadow: 0 3px 0 #16a34a;
}

#mg-ho-app .mg-ctrl-pause-home {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

/* Word Quiz uses the same controller chrome. The pause capsule sits in its own row. */

#mg-wq-app .mg-ctrl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#mg-wq-app .mg-ctrl-btn-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

#mg-wq-app .mg-ctrl-btn-state[hidden],
#mg-wq-app .mg-ctrl-countdown-overlay[hidden],
#mg-wq-app .mg-ctrl-pause-modal[hidden] {
  display: none !important;
}

#mg-wq-app .mg-ctrl-btn-start,
#mg-wq-app .mg-ctrl-btn-resume {
  color: #ffffff;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

#mg-wq-app .mg-ctrl-btn-pause {
  color: #7c2d12;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 4px 0 #d97706;
}

#mg-wq-app .mg-ctrl-btn-start:active,
#mg-wq-app .mg-ctrl-btn-resume:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #15803d;
}

#mg-wq-app .mg-ctrl-btn-pause:active {
  box-shadow: 0 2px 0 #d97706;
}

#mg-wq-app .mg-ctrl-board-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}

#mg-wq-app .mg-ctrl-board-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.42);
}

#mg-wq-app.mg-ctrl-paused .mg-ctrl-board-locked::after {
  background: transparent;
}

#mg-wq-app .mg-ctrl-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  transition: opacity 0.4s ease;
}

#mg-wq-app .mg-ctrl-countdown-fade {
  opacity: 0;
}

#mg-wq-app .mg-ctrl-countdown-num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(92px, 18vw, 168px);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 10px 0 rgba(225, 29, 72, 0.35), 0 18px 30px rgba(15, 23, 42, 0.28);
}

#mg-wq-app .mg-ctrl-pop {
  animation: mg-ctrl-pop 0.45s cubic-bezier(0.2, 1.45, 0.4, 1) both;
}

#mg-wq-app .mg-ctrl-pause-modal {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: calc(100% - 8px);
  margin: 0 auto;
  pointer-events: none;
  background: transparent;
}

#mg-wq-app.mg-ctrl-paused .mg-wq-header {
  position: relative;
  z-index: 28;
}

#mg-wq-app .mg-ctrl-pause-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 16px);
  height: 58px;
  max-height: 64px;
  padding: 0 10px 0 16px;
  border: 1.5px solid #fde68a;
  border-radius: 50px;
  background: rgba(255, 251, 245, 0.97);
  box-shadow: 0 10px 26px rgba(120, 80, 40, 0.16);
  animation: mg-ctrl-pause-in 0.28s ease;
}

#mg-wq-app .mg-ctrl-pause-title {
  margin: 0;
  min-width: 0;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Mali', 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #9a3412;
}

#mg-wq-app .mg-ctrl-pause-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

#mg-wq-app .mg-ctrl-pause-resume,
#mg-wq-app .mg-ctrl-pause-home {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#mg-wq-app .mg-ctrl-pause-resume {
  border: none;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  box-shadow: 0 3px 0 #16a34a;
}

#mg-wq-app .mg-ctrl-pause-home {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

#mg-cl-app .mg-ctrl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#mg-cl-app .mg-ctrl-btn-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
}

#mg-cl-app .mg-ctrl-btn-state[hidden],
#mg-cl-app .mg-ctrl-countdown-overlay[hidden],
#mg-cl-app .mg-ctrl-pause-modal[hidden] {
  display: none !important;
}

#mg-cl-app .mg-ctrl-btn-start,
#mg-cl-app .mg-ctrl-btn-resume {
  color: #ffffff;
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  box-shadow: 0 4px 0 #15803d;
}

#mg-cl-app .mg-ctrl-btn-pause {
  color: #7c2d12;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 4px 0 #d97706;
}

#mg-cl-app .mg-ctrl-btn-start:active,
#mg-cl-app .mg-ctrl-btn-resume:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #15803d;
}

#mg-cl-app .mg-ctrl-btn-pause:active {
  box-shadow: 0 2px 0 #d97706;
}

#mg-cl-app .mg-ctrl-board-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}

#mg-cl-app .mg-ctrl-board-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.28);
}

#mg-cl-app.mg-ctrl-paused .mg-ctrl-board-locked::after {
  background: transparent;
}

#mg-cl-app .mg-ctrl-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  transition: opacity 0.4s ease;
}

#mg-cl-app .mg-ctrl-countdown-fade {
  opacity: 0;
}

#mg-cl-app .mg-ctrl-countdown-num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: clamp(92px, 18vw, 168px);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 10px 0 rgba(225, 29, 72, 0.35), 0 18px 30px rgba(15, 23, 42, 0.28);
}

#mg-cl-app .mg-ctrl-pop {
  animation: mg-ctrl-pop 0.45s cubic-bezier(0.2, 1.45, 0.4, 1) both;
}

#mg-cl-app .mg-ctrl-pause-modal {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: calc(100% - 8px);
  margin: 0 auto;
  pointer-events: none;
  background: transparent;
}

#mg-cl-app.mg-ctrl-paused .mg-cl-header {
  position: relative;
  z-index: 28;
}

#mg-cl-app .mg-ctrl-pause-card {
  pointer-events: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 16px);
  height: 58px;
  max-height: 64px;
  padding: 0 10px 0 16px;
  border: 1.5px solid #fde68a;
  border-radius: 50px;
  background: rgba(255, 251, 245, 0.97);
  box-shadow: 0 10px 26px rgba(120, 80, 40, 0.16);
  animation: mg-ctrl-pause-in 0.28s ease;
}

#mg-cl-app .mg-ctrl-pause-title {
  margin: 0;
  min-width: 0;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Mali', 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: #9a3412;
}

#mg-cl-app .mg-ctrl-pause-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

#mg-cl-app .mg-ctrl-pause-resume,
#mg-cl-app .mg-ctrl-pause-home {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#mg-cl-app .mg-ctrl-pause-resume {
  border: none;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 100%);
  box-shadow: 0 3px 0 #16a34a;
}

#mg-cl-app .mg-ctrl-pause-home {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
}

@media (max-width: 768px) {
  #mg-mm-app .mg-mm-header,
  #mg-wm-app .mg-wm-header,
  #mg-ws-app .mg-ws-header,
  #mg-wt-app .mg-wt-header {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  #mg-mm-app .mg-mm-category,
  #mg-wm-app .mg-wm-category,
  #mg-ws-app .mg-ws-category,
  #mg-wt-app .mg-wt-category,
  #mg-mm-app select,
  #mg-wm-app select,
  #mg-ws-app select,
  #mg-wt-app select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #mg-mm-app .mg-mm-restart,
  #mg-wm-app .mg-wm-restart,
  #mg-ws-app .mg-ws-restart,
  #mg-wt-app .mg-wt-restart {
    display: inline-flex;
    visibility: visible;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
}
