:root {
  --bg: #f5f0e8;
  --bg2: #fff8ef;
  --card: #fffdf8;
  --line: #e5d9ca;
  --ink: #17212b;
  --mut: #6f7a83;
  --red: #c83b32;
  --red2: #a8322c;
  --gold: #b6762e;
  --ok: #2f9b68;
  --rad: 16px;
}

html,
body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 59, 50, .12), transparent 30%),
    linear-gradient(180deg, #fbf6ee 0%, #f5f0e8 48%, #efe7dc 100%);
}

.top,
.tabbar {
  background: rgba(255, 253, 248, .94);
  border-color: rgba(60, 42, 28, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.top {
  min-width: 0;
}

.top .spacer {
  min-width: 10px;
}

#userbox {
  flex: 0 0 auto;
}

.brand {
  color: #182432;
}

.tabbar a {
  color: #697782;
}

.tabbar a.on {
  color: var(--red);
}

.btn {
  background: #fffaf1;
  border-color: #e3d4c2;
  color: #17212b;
}

.btn.red,
.tab.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.wrap {
  max-width: 760px;
}

.card {
  background: rgba(255, 253, 248, .96);
  border-color: rgba(103, 75, 48, .16);
  box-shadow: 0 12px 32px rgba(72, 54, 36, .08);
}

.card h2 {
  color: #1c2731;
}

.hero.pwaHero {
  position: relative;
  min-height: 430px;
  padding: 70px 18px 42px;
  isolation: isolate;
  background-position: center;
}

.hero.pwaHero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(9, 18, 28, .18), rgba(9, 18, 28, .82)),
    linear-gradient(90deg, rgba(9, 18, 28, .76), rgba(9, 18, 28, .22));
}

.heroInner {
  max-width: 760px;
}

.pwaHero h1 {
  max-width: 520px;
  margin-bottom: 8px;
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.08;
}

.pwaHero p {
  max-width: 430px;
  color: rgba(255, 255, 255, .92);
  font-size: 1rem;
}

.heroChips {
  margin-top: 18px;
}

.chip {
  min-height: 34px;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

.installbar {
  margin-top: -38px;
  background: rgba(255, 253, 248, .96);
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 18px 40px rgba(31, 38, 46, .16);
}

.photoMood {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.photoMoodCard {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  padding: 12px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(38, 31, 24, .16);
}

.photoMoodCard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 14, .05), rgba(5, 10, 14, .74));
}

.photoMoodCard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.photoMoodCard:hover img {
  transform: scale(1.04);
}

.photoMoodCard span,
.photoMoodCard b {
  position: relative;
  z-index: 1;
  display: block;
}

.photoMoodCard span {
  margin-bottom: 52px;
  font-size: .75rem;
  font-weight: 800;
  opacity: .9;
}

.photoMoodCard b {
  font-size: 1rem;
  line-height: 1.25;
}

.dashMetric,
.simGrid > div,
.result,
input[type=number],
input[type=text],
textarea,
select,
.taskBtn,
.tab {
  background: #fff8ef;
  border-color: #e3d4c2;
  color: #17212b;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 59, 50, .16);
}

.dashMetric b,
.simGrid b,
.result .big {
  color: #b6762e;
}

.taskBtn.done {
  border-color: rgba(47, 155, 104, .45);
  background: #eff9f2;
}

.photoGrid {
  gap: 10px;
}

.photoGrid img {
  border: 0;
  border-radius: 14px;
  background: #eadfce;
  box-shadow: 0 10px 22px rgba(38, 31, 24, .12);
  transition: transform .22s ease, box-shadow .22s ease;
}

.photoGrid img:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(38, 31, 24, .18);
}

.toast {
  background: rgba(23, 33, 43, .96);
}

@media (max-width: 520px) {
  .top {
    gap: 8px;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
    font-size: 1rem;
  }

  #userbox .btn.g {
    justify-content: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    padding: 0;
    font-size: 0;
  }

  #userbox .btn.g svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  .hero.pwaHero {
    min-height: 380px;
    padding-top: 54px;
  }

  .pwaHero h1 {
    font-size: 2.05rem;
  }

  .installbar {
    margin-top: -26px;
  }

  .photoMood {
    grid-template-columns: 1fr;
  }

  .photoMoodCard {
    min-height: 118px;
  }

  .photoMoodCard span {
    margin-bottom: 38px;
  }

  .photoGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.teamsHero,
.teamHero {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: #fff;
  isolation: isolate;
}

.teamsHero::after,
.teamHero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team, #c83b32) 36%, transparent), transparent 62%);
}

.teamsHeroInner,
.teamHeroInner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 16px 38px;
}

.teamsHero h1,
.teamHero h1 {
  margin: 10px 0 8px;
  max-width: 560px;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.06;
  color: #fff;
}

.teamsHero p,
.teamHero p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, .9);
}

.teamGrid,
.fanHubGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team.teamPhotoCard,
.team.miniFanCard {
  min-height: 210px;
  padding: 14px;
  background-size: cover;
  background-position: center;
  border: 0;
  box-shadow: 0 18px 34px rgba(34, 28, 22, .18);
}

.team.teamPhotoCard::before,
.team.miniFanCard::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid color-mix(in srgb, var(--team, #c83b32) 56%, white);
  opacity: .55;
  pointer-events: none;
}

.teamTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .78rem;
  opacity: .92;
}

.pill.live,
.guestBadge {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}

.teamPhotoCard .nm,
.miniFanCard .nm {
  font-size: 1.38rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .42);
}

.teamPhotoCard .meta,
.teamPhotoCard .cnt,
.miniFanCard .cnt {
  text-shadow: 0 2px 10px rgba(0, 0, 0, .42);
}

.teamStatBar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.teamStatBar span {
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: .8rem;
  font-weight: 700;
}

.teamPhotoStrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -42px 0 14px;
  position: relative;
  z-index: 2;
}

.teamPhotoStrip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(23, 33, 43, .2);
  border: 2px solid rgba(255, 253, 248, .82);
  background: #eadfce;
}

.fanHubIntro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 253, 248, .96);
  border: 1px solid rgba(103, 75, 48, .16);
  box-shadow: 0 12px 32px rgba(72, 54, 36, .08);
}

.fanHubIntro span {
  color: var(--mut);
  font-size: .9rem;
}

.miniFanCard {
  min-height: 150px;
}

.playerFanSearch {
  margin-top: 14px;
}

.commentWrite {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.guestFields {
  display: grid;
  grid-template-columns: minmax(0, 180px) 1fr;
  gap: 10px;
  align-items: center;
}

.anonNotice {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8ef;
  border: 1px solid #e3d4c2;
  color: var(--mut);
  font-size: .9rem;
}

.anonNotice b {
  color: var(--ink);
}

.commentActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cmt .ax span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

@media (min-width: 700px) {
  .teamGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .teamsHero,
  .teamHero {
    min-height: 330px;
  }

  .teamGrid,
  .fanHubGrid,
  .teamPhotoStrip {
    grid-template-columns: 1fr;
  }

  .team.teamPhotoCard {
    min-height: 190px;
  }

  .teamPhotoStrip {
    margin-top: -28px;
  }

  .guestFields,
  .commentActions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .commentActions .btn {
    width: 100%;
  }
}
