:root {
  color-scheme: light;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #cbe8ff;
}

button,
summary {
  font: inherit;
}

#unity-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#unity-fullscreen-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #cbe8ff;
  outline: none;
  touch-action: none;
}

.hub-back,
.game-info {
  position: fixed;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
}

.hub-back {
  left: max(14px, env(safe-area-inset-left));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid rgba(55, 31, 103, 0.88);
  border-radius: 999px;
  color: #3d1d6c;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 rgba(91, 50, 145, 0.28);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.hub-back:hover,
.hub-back:focus-visible {
  box-shadow: 0 6px 0 rgba(91, 50, 145, 0.28);
  transform: translateY(-2px);
  outline: none;
}

.game-info {
  right: max(14px, env(safe-area-inset-right));
}

.game-info summary {
  min-height: 40px;
  display: grid;
  padding: 0 14px;
  place-items: center;
  border: 2px solid rgba(55, 31, 103, 0.88);
  border-radius: 999px;
  color: #3d1d6c;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 rgba(91, 50, 145, 0.28);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.game-info summary::-webkit-details-marker {
  display: none;
}

.game-info-panel {
  width: min(340px, calc(100vw - 28px));
  margin-top: 10px;
  padding: 18px;
  border: 2px solid rgba(55, 31, 103, 0.88);
  border-radius: 20px;
  color: #3d1d6c;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(46, 20, 82, 0.2);
  backdrop-filter: blur(18px);
}

.game-info-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1;
}

.game-info-panel p {
  margin: 0;
  color: #6f5193;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.game-info-panel p + p {
  margin-top: 8px;
}

#unity-loading-container {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.72), transparent 25%),
    linear-gradient(145deg, #b91cff 0 48%, #ff8a08 48% 100%);
}

#unity-loading-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(280px, calc(100vw - 44px));
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
}

#unity-logo {
  width: 124px;
  height: 124px;
  border: 5px solid white;
  border-radius: 30px;
  background: url("../catdoku-icon.png") center / cover no-repeat;
  box-shadow: 0 12px 28px rgba(52, 21, 83, 0.28);
  transform: rotate(-3deg);
}

#unity-loading-bar strong {
  margin-top: 18px;
  color: white;
  font-size: 16px;
  text-align: center;
  text-shadow: 0 2px 0 rgba(74, 31, 102, 0.3);
}

#unity-progress-bar-empty {
  width: 100%;
  height: 16px;
  margin-top: 12px;
  overflow: hidden;
  border: 3px solid white;
  border-radius: 999px;
  background: rgba(67, 28, 97, 0.25);
  box-shadow: 0 4px 0 rgba(67, 28, 97, 0.2);
}

#unity-progress-bar-full {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff58c, #fff);
  transition: width 120ms linear;
}

#unity-warning {
  position: fixed;
  z-index: 30;
  top: max(68px, calc(env(safe-area-inset-top) + 54px));
  left: 50%;
  width: min(560px, calc(100vw - 28px));
  display: none;
  transform: translateX(-50%);
}

.unity-message {
  padding: 11px 14px;
  border: 2px solid #512b70;
  border-radius: 13px;
  color: #3d1d6c;
  background: #fff3ae;
  box-shadow: 0 5px 0 rgba(81, 43, 112, 0.2);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.unity-message--error {
  color: #721d2c;
  background: #ffd7df;
}

@media (max-width: 520px) {
  .hub-back,
  .game-info summary {
    min-height: 36px;
    padding-inline: 11px;
    font-size: 11px;
  }

  .game-info-panel {
    max-height: calc(100vh - 72px);
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
