:root {
  --teal: #5b97b3;
  --teal-dark: #3f7c99;
  --cream: #fdefb4;
  --gold: #f0c24a;
  --gold-dark: #d9a62c;
  --red: #ef2f2f;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: #26323d;
  display: grid;
  place-items: center;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

button, a { font: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ic { width: 28px; height: 28px; fill: currentColor; }

/* Telefono */
.phone {
  width: min(100%, 400px);
  height: min(100dvh, 780px);
  display: flex;
  flex-direction: column;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='28'%3E%3Cg fill='%23ebca6c'%3E%3Cellipse cx='22' cy='16' rx='2.5' ry='6'/%3E%3Cellipse cx='16' cy='11' rx='6' ry='2.6' transform='rotate(-22 16 11)'/%3E%3Cellipse cx='28' cy='11' rx='6' ry='2.6' transform='rotate(22 28 11)'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 0 0 8px #111, 0 20px 60px rgba(0, 0, 0, .5);
}
@media (max-width: 440px) {
  .phone { height: 100dvh; border-radius: 0; box-shadow: none; }
}

/* Barra in alto */
.bar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  height: 64px;
  background: var(--teal);
}
.brand {
  margin: 0;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: .04em;
  -webkit-text-stroke: 3px var(--teal-dark);
  paint-order: stroke fill;
}
.avatar {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd9e5;
  border: 2px solid #fff;
  font-size: 1.2rem;
}

/* Schermate: di base si vede la prima */
.screen { flex: 1; min-height: 0; display: none; padding: 16px 18px; }
#feed { display: flex; }
.phone:has(#classifica:target) #feed { display: none; }
#classifica:target { display: flex; flex-direction: column; }

/* Post */
.frame {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  padding: 58px 10px 40px;
  background: var(--gold);
  border-radius: 14px;
}
.tab {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: .06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  background: var(--gold);
  border-radius: 14px 14px 0 0;
}
.tab .ic { width: 36px; height: 36px; }

.photo {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(170deg, #bfe3f5 0%, #f7d9c4 100%);
}
.figure { font-size: 8rem; line-height: 1; }

.sticker {
  position: absolute;
  right: 6px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8;
  font-size: 1.7rem;
}
.s1 { bottom: 120px; }
.s2 { bottom: 68px; }
.s3 { bottom: 16px; }

.react {
  position: absolute;
  right: 12px;
  bottom: 0;
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  background: var(--gold-dark);
  border-radius: 12px 12px 0 0;
}
.react button {
  display: grid;
  place-items: center;
  padding: 2px;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
.react .ic { width: 20px; height: 20px; }

/* Punteggi */
.timer {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #0d0d0d;
  color: #ffd84a;
  border-radius: 14px;
  font-family: "Courier New", monospace;
  font-size: 1.3rem;
  letter-spacing: .12em;
}
.timer .ic { width: 22px; height: 22px; }

.board {
  flex: 1;
  margin: 14px 0 0;
  padding: 18px 14px;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  border: 5px solid var(--gold);
  border-radius: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48'%3E%3Cpath d='M0 16L14 8L28 16M14 8V0M0 32L14 40L28 32M14 40V48M0 16V32M28 16V32' fill='none' stroke='%23f0c24a' stroke-width='1.5'/%3E%3C/svg%3E");
}
.board li {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-right: calc(var(--i) * 26px);
}
.score {
  color: var(--red);
  font-size: 2.2rem;
  font-weight: 900;
  font-style: italic;
  text-shadow: 0 2px 0 #fff8;
}
.ring {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffe9c9;
  border: 4px solid var(--gold-dark);
  font-size: 2rem;
}
.ring.letter { background: #f4a259; color: #fff; font-weight: 900; }

/* Menu in basso */
.dock {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px 14px 0;
  height: 68px;
  background: var(--teal);
}
.dock a {
  display: grid;
  place-items: center;
  height: 58px;
  color: #fff;
  background: var(--teal-dark);
  border-radius: 18px 18px 0 0;
}
.dock a:hover { background: #356c87; }
