/* ========================================
   Barlow Font (local)
   ======================================== */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Barlow/Barlow-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Barlow/Barlow-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Barlow/Barlow-Bold.woff2") format("woff2");
}

/* ========================================
   Reset & Base
   ======================================== */

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

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  font-family: "Barlow", sans-serif;
  background-color: #002c47;
  background-image: url("../assets/images/puzzle/background.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}

/* ========================================
   Game Container
   ======================================== */

#gameContainer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ========================================
   Canvas
   ======================================== */

#gameCanvas {
  display: block;
  cursor: default;
}

/* ========================================
   CI Buttons (shared design language)
   ======================================== */

.ci-btn {
  display: inline-block;
  padding: 16px 56px;
  background: #cad400;
  color: #002c47;
  font-family: "Barlow", sans-serif;
  font-size: 22px;
  font-weight: 700;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: opacity 150ms ease;
}

.ci-btn:hover {
  opacity: 0.9;
}

.ci-btn:active {
  opacity: 0.8;
}

/* Small button (restart in corner) */
.ci-btn--small {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  font-size: 16px;
  z-index: 150;
}

/* ========================================
   Overlays (shared start / completion)
   ======================================== */

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 44, 71, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 300ms ease;
  gap: 16px;
}

.overlay.active {
  display: flex;
}

.overlay-title {
  font-family: "Barlow", sans-serif;
  font-size: 56px;
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  line-height: 1.1;
}

.overlay-subtitle {
  font-family: "Barlow", sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-bottom: 16px;
}

/* ========================================
   UI Overlay (pointer passthrough)
   ======================================== */

.ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.ui-overlay > * {
  pointer-events: auto;
}

/* ========================================
   Loading Indicator
   ======================================== */

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  z-index: 50;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
