@font-face {
  font-family: 'TT Commons Pro';
  src: url('../assets/fonts/TTCommonsPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TT Commons Pro';
  src: url('../assets/fonts/TTCommonsPro-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TT Commons Pro';
  src: url('../assets/fonts/TTCommonsPro-DemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TT Commons Pro';
  src: url('../assets/fonts/TTCommonsPro-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ui: 'TT Commons Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'TT Commons Pro', 'TT Commons', system-ui, sans-serif;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-solid: #ffffff;
  --panel-soft: #f2f4f7;
  --panel-hover: #e8ecf2;
  --ink: #111827;
  --ink-muted: #6b7280;
  --ink-dim: #9ca3af;
  --accent: #111827;
  --accent-hover: #243045;
  --accent-soft: #e9edf5;
  --accent-ink: #ffffff;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --success: #22c55e;
  --shadow-flat: 0 6px 24px rgba(15, 23, 42, 0.12);
  --shadow-modal: 0 18px 48px rgba(15, 23, 42, 0.18);
  --radius: 8px;
  --radius-md: 12px;
  --sky-top: #1a76d4;
  --sky-mid: #2ca3f2;
  --sky-bot: #1358ab;
  --sky-glow: rgba(96, 214, 255, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 48%,
      var(--sky-glow) 0%,
      rgba(20, 40, 80, 0.12) 55%,
      rgba(8, 16, 36, 0.48) 100%
    ),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-bot) 100%);
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
}

#app::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: repeat;
  background-size: 240px 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='%23ffffff' font-family='monospace' font-weight='700'%3E%3Ctext x='18' y='34' font-size='22' opacity='0.14' transform='rotate(-14 18 34)'%3E%5C%3A%3C/text%3E%3Ctext x='94' y='26' font-size='16' opacity='0.11' transform='rotate(18 94 26)'%3E%5C%3A%3C/text%3E%3Ctext x='176' y='44' font-size='26' opacity='0.15' transform='rotate(-8 176 44)'%3E%5C%3A%3C/text%3E%3Ctext x='52' y='92' font-size='28' opacity='0.12' transform='rotate(12 52 92)'%3E%5C%3A%3C/text%3E%3Ctext x='138' y='88' font-size='18' opacity='0.16' transform='rotate(-22 138 88)'%3E%5C%3A%3C/text%3E%3Ctext x='208' y='108' font-size='20' opacity='0.11' transform='rotate(15 208 108)'%3E%5C%3A%3C/text%3E%3Ctext x='24' y='158' font-size='19' opacity='0.15' transform='rotate(9 24 158)'%3E%5C%3A%3C/text%3E%3Ctext x='104' y='152' font-size='25' opacity='0.12' transform='rotate(-16 104 152)'%3E%5C%3A%3C/text%3E%3Ctext x='184' y='168' font-size='17' opacity='0.14' transform='rotate(24 184 168)'%3E%5C%3A%3C/text%3E%3Ctext x='46' y='218' font-size='24' opacity='0.13' transform='rotate(-11 46 218)'%3E%5C%3A%3C/text%3E%3Ctext x='132' y='224' font-size='21' opacity='0.15' transform='rotate(14 132 224)'%3E%5C%3A%3C/text%3E%3Ctext x='206' y='220' font-size='26' opacity='0.1' transform='rotate(-18 206 220)'%3E%5C%3A%3C/text%3E%3C/g%3E%3C/svg%3E");
}

#game-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#game-canvas.is-dragging {
  cursor: grabbing;
}

#game-canvas.mode-explore {
  cursor: grab;
}

/* Fullscreen White Loading Screen with Animated :\ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.36s ease;
}

.loading-screen.is-done {
  opacity: 0;
  pointer-events: none;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(260px, calc(100vw - 48px));
  user-select: none;
}

.loading-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  animation: smileBob 1.7s ease-in-out infinite;
}

.lf-eyes {
  display: inline-block;
  transform-origin: center;
  animation: smileBlink 3.2s ease-in-out infinite;
}

.lf-mouth {
  display: inline-block;
  transform-origin: left center;
  animation: smileTilt 1.7s ease-in-out infinite;
}

@keyframes smileBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes smileBlink {
  0%, 44%, 52%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.12); }
}

@keyframes smileTilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-10deg); }
}

.loading-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.loading-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.loading-bar-fill {
  width: 8%;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 0.24s ease;
}

.loading-status {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
}
