.game-root,
.game-root * {
  box-sizing: border-box;
}

.game-root {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f3eadc;
  color: #243044;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cartoon-game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f3eadc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cartoon-game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

.cartoon-hint {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 4;
  width: min(620px, calc(100% - 260px));
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.76);
  color: #243044;
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 24px rgba(18, 28, 44, 0.12);
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.cartoon-hud {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 4;
  min-width: 92px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #243044;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 14px 32px rgba(20, 47, 37, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
}

.cartoon-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 42, 38, 0.34);
  backdrop-filter: blur(5px);
}

.cartoon-overlay[hidden] {
  display: none;
}

.cartoon-card {
  width: min(100%, 500px);
  border: 3px solid #ffffff;
  border-radius: 8px;
  padding: clamp(24px, 4vw, 40px);
  background: #ffffff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(21, 32, 48, 0.26);
}

.cartoon-kicker {
  margin: 0 0 8px;
  color: #2f7a58;
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cartoon-card h2 {
  margin: 0;
  color: #243044;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.cartoon-card p {
  margin: 14px auto 0;
  max-width: 390px;
  color: #526173;
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 700;
  line-height: 1.45;
}

.cartoon-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.cartoon-button,
.cartoon-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #2f7a58;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(47, 122, 88, 0.24);
  cursor: pointer;
}

.cartoon-link {
  background: #4d74c9;
  box-shadow: 0 12px 24px rgba(77, 116, 201, 0.22);
}

.cartoon-error {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f3eadc;
  color: #9f2e24;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 640px) {
  .cartoon-hint {
    top: max(58px, calc(env(safe-area-inset-top) + 54px));
    width: min(340px, calc(100% - 28px));
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
  }

  .cartoon-hud {
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 38px;
    padding: 6px 12px;
    font-size: 18px;
  }

  .cartoon-card {
    padding: 24px 18px;
  }
}
