:root {
  --hud-bg: rgba(0, 0, 0, 0.45);
  --hud-fg: #fff;
  --accent: #38bdf8;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: url(img/kut1.svg), url(img/kut2.svg) #db5727;
  background-size: 40%;
  background-position: left top, right center;
  background-repeat: no-repeat;
  color: #f0d8b4;
  font-family: "Montserrat", sans-serif;
  overflow: hidden;
}
/* Glavni container */
#game {
  position: fixed;
  inset: 0;
  touch-action: none; /* spriječi scroll pinch tijekom igre */
  user-select: none;
}
#game {
  isolation: isolate;
}
/* Početni ekran */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
}
#startScreen {
}
.title {
  font-size: clamp(10rem, 8vw, 96px);
  color: #f0d8b4;
  text-align: center;
  font-family: DoUbLeBaSs;
  font-style: normal;
  font-weight: 700;
  line-height: 1.1;
  max-width: 59rem;
  font-family: "doublebass", sans-serif;
}
#startScreen {
  z-index: 120; /* > #playfield (10) i > #hud (50) */
  pointer-events: auto;
  gap: 1rem;
}
.logo-sub {
  color: #fff;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.5rem, 1vw, 36px);
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  max-width: 58rem;
  margin: 0 auto;
  max-width: 934px;
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 0.65081rem;
  background: #5c463e;
  color: #fff;
  text-align: center;
  font-size: 2.08269rem;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  text-transform: uppercase;
  padding: 1rem 3rem;
}
.btn:active {
  transform: scale(0.98);
}

#startBtn {
  cursor: pointer;
  position: relative;
  width: 387px;
  height: 86px;
  font-weight: 700;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.pill {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 14px;
}

/* HUD */
#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 50;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #f0d8b4;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 36px;
}
#time,
#score {
  font-variant-numeric: tabular-nums;
}
#settingsBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
  background: var(--hud-bg);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* Postavke */
#panel {
  position: absolute;
  right: 12px;
  top: 56px;
  z-index: 60;
  width: min(92vw, 320px);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 14px;
  display: none;
}
#panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #fff;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.field label {
  flex: 0 0 110px;
  font-size: 14px;
  color: #cbd5e1;
}
.field input[type="range"] {
  flex: 1;
}
.hint {
  font-size: 12px;
  color: #94a3b8;
}

/* Igralište */
#playfield {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* Food item */
.food {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.food img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Posuda – dva sloja */
#bowl {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 150px;
  z-index: 30; /* iznad food-back, ali ispod bowl-front rim-a */

  display: none;
}
#bowl-back,
#bowl-front {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Back dio (unutrašnjost posude) */
#bowl-back {
  transform: translateY(-15%);
  z-index: 5;
}

#bowl-back img,
#bowl-front img {
  width: 100%;
  height: auto;
}

/* Prednji rub (rim) – prekriva hranu da izgleda da ulazi u posudu */
#bowl-front {
  z-index: 5;
}

/* sve u posudi propušta klik/touch */
#bowl,
#bowl * {
  pointer-events: none;
}
/* za svaki slučaj i pseudo-rub */
#bowl-front::before {
  pointer-events: none;
}

/* Kraj igre + forma */
#gameOver {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
}
.card {
  width: min(92vw, 560px);
  color: #e2e8f0;
  border-radius: 16px;
  padding: 18px;
}
.card h2 {
  margin: 0 0 6px;
  color: #fff;
}
.card .meta {
  color: #94a3b8;
  margin-bottom: 12px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid .full {
  grid-column: 1 / -1;
}
.input {
  width: 100%;
  border-radius: 50px;
  color: var(--Gray-1, #333);
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  border-radius: 50px;
  background: #f3e9df;
  padding: 24px;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
  border: none;
}

label {
  color: #fff;
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.submit {
  cursor: pointer;
  margin: 1rem auto;
  display: block;
}
.small {
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  margin: 1.5rem auto;
}

.subtitle {
  color: var(--boja_02, #f0d8b4);
  text-align: center;
  font-family: DoUbLeBaSs;
  font-size: 64px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.small a {
  text-decoration: none;
  color: #fff;
  font-weight: 700;
}

/* Tooltip za kontrole */
#controlsHint {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  color: #fff;
  display: none;
  font-size: 0;
}

.orange {
  width: 100%;
  height: 15vh;
  background: #b3461e;
  position: absolute;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.broki {
  width: 116px;
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%) rotate(-16deg);
}

.ukras {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.ukras1 {
  right: 5%;
  top: 5%;
}

.ukras2 {
  left: 5%;
  bottom: 0;
}

.ukras3 {
  left: 20%;
  top: 20%;
}

.ukras4 {
  right: 15%;
  bottom: 10%;
}

.ukras5 {
  right: 20%;
  top: 10%;
  transform: rotate(16deg);
  z-index: 9999;
}

.pravila {
  color: var(--boja_02, #f0d8b4);
  text-align: right;
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  position: absolute;
  right: 10%;
  bottom: 3%;
  z-index: 150;
}

.pravila a {
  color: var(--boja_02, #f0d8b4);
  text-decoration: none;
}

.ikona {
  width: 46px;
  padding: 0 0.5rem;
}

.bestek {
  width: 38px;
  padding-right: 2rem;
}

@media (max-width: 1680px) {
  html {
    font-size: 90%;
  }
  .title {
    font-size: 8rem;
  }
}

@media (max-width: 1441px) {
  html {
    font-size: 90%;
  }
  .title {
    font-size: 8rem;
  }
}

@media (max-width: 840px) {
  .title {
    font-size: 4rem;
  }
  .ukras,
  .broki,
  .pravila {
    display: none;
  }
  .logo-sub {
    max-width: 90%;
    font-size: 1rem;
  }
  .logo {
    padding-top: 5rem;
  }
  #hud {
    font-size: 20px;
  }
  .ikona {
    width: 24px;
  }
  .bestek {
    width: 18px;
  }
  #startBtn {
    width: 90%;
  }
  #controlsHint img {
    width: 60px;
  }
  #bowl {
    width: 140px;
    height: 90px;
  }
  .subtitle {
    font-size: 2rem;
    padding-top: 0;
  }
  label {
    font-size: 1rem;
  }
  .input {
    padding: 10px;
  }
  .pravila {
    width: 100%;
    right: 50%;
    transform: translateX(50%);
    bottom: 6px;
    text-align: center;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .food {
    font-size: 24px;
    width: 34px;
    height: 34px;
  }
}

/* Sakrij start screen kada je aria-hidden="true" i ugasi mu pointere */
#startScreen[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
#gameOver {
  z-index: 200;
}

/* Osiguraj da form elementi primaju klik */
#gameOver .card,
#gameOver .card * {
  pointer-events: auto;
}

#gameOver input,
#gameOver textarea,
#gameOver select,
#gameOver label,
#gameOver button {
  user-select: text; /* dozvoli označavanje/fokus u formi */
}

h3 {
  text-align: center;
  font-size: 2rem;
}

[inert] {
  pointer-events: none;
}
[inert] * {
  pointer-events: none !important;
}
