* {
  box-sizing: border-box;
}

:root {
  --orange: #ff5a00;
  --orange-dark: #e64a00;
  --orange-soft: #fff1e8;
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #151515;
  --muted: #6f6f6f;
  --line: #e8e8e8;
  --shadow: 0 10px 30px rgba(20, 20, 20, 0.08);
  --radius: 18px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  overflow: hidden;
}

/* TOP BAR */
#topbar{
  min-height:112px;
  background:rgba(255,255,255,0.96);
  border-bottom:1px solid var(--line);

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;

  padding:14px 28px;

  box-shadow:0 6px 24px rgba(0,0,0,0.05);

  position:relative;
  z-index:20;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:320px;
}

.tcLogo{
  height:68px;
  width:auto;
  object-fit:contain;
  display:block;
}

.liveBadge{
  color:var(--orange);
  font-size:16px;
  font-weight:900;
  letter-spacing:1px;
}

.tools{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:12px;
}

.toolGroup{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.secondaryRow{
  width:100%;
}

/* BUTTONS */
button,
select {
  font-family: Inter, Arial, sans-serif;
  font-weight: 800;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  min-height: 40px;
  box-shadow: none;
  transition: all 0.15s ease;
}

button:hover,
select:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: translateY(-1px);
}

button:active,
select:active {
  transform: translateY(0);
}

button.active,
select.active,
.modeActive,
.builderOnly {
  background: var(--orange) !important;
  color: white !important;
  border-color: var(--orange) !important;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255,90,0,0.25);
  outline-offset: 2px;
}

label {
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
}

.speedLabel {
  display: flex;
  align-items: center;
  gap: 8px;
}

#speed,
#simSpeed {
  width: 120px;
  accent-color: var(--orange);
}

/* FIELD AREA */
#fieldShell {
  position: relative;
  width: calc(100vw - 32px);
  height: calc(100vh - 108px);
  margin: 16px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 12px;
}

canvas {
  display: block;
  width: calc(100vw - 32px);
  height: calc(100vh - 108px);
  margin: 16px;
  background-image: url("assets/rugby-pitch.png");
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
background-color: #ffffff;
  border-radius: 22px;
  cursor: grab;
  box-shadow: var(--shadow);
}

#fieldShell canvas {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 18px;
  box-shadow: none;
}

#field.grabbing,
canvas.grabbing {
  cursor: grabbing;
}

/* MODALS */
.modal {
  position: fixed;
  top: 90px;
  left: 0;
  right: 0;
  bottom: 0;

  background: rgba(15,15,15,.45);
  backdrop-filter: blur(8px);

  display: flex;
  align-items: flex-start;
  justify-content: center;

  overflow-y: auto;
  padding: 20px;

  z-index: 9999;
}

.modalCard {
  width: 92vw;
  max-height: calc(100vh - 130px);

  overflow-y: auto;

  background: white;
  color: var(--text);

  border: 1px solid var(--line);
  border-radius: 24px;

  padding: 24px;

  box-shadow: var(--shadow);

  margin-top: 10px;
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modalHeader h2 {
  margin: 0;
  font-size: 28px;
}

#qrGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.qrItem {
  background: #fff;
  color: var(--text);
  text-align: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

.qrItem img {
  width: 100%;
  max-width: 150px;
}

/* PAYWALL */
.paywall {
  position: fixed;
  inset: 0;
  background: rgba(20,20,20,0.55);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.paywallCard {
  width: 460px;
  max-width: 90vw;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 34px;
  text-align: center;
  box-shadow: var(--shadow);
}

.paywallCard h1 {
  margin-top: 0;
  font-size: 30px;
}

.paywallCard p {
  font-size: 17px;
  color: var(--muted);
}

.price {
  font-size: 36px;
  font-weight: 900;
  margin: 24px 0;
  color: var(--orange);
}

#unlockBtn,
#promoBtn {
  background: var(--orange);
  border: none;
  color: white;
  border-radius: 12px;
  padding: 13px 18px;
  font-weight: 900;
  cursor: pointer;
}

#unlockBtn {
  width: 100%;
  margin-bottom: 22px;
}

#promoInput {
  width: 100%;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-align: center;
  font-weight: 900;
}

/* HOME SCREEN */
.homeBody {
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(255,90,0,0.12), transparent 32%),
    var(--bg);
}

.homeScreen {
  min-height: 100vh;
  padding: 54px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.homeLogo {
  height: 140px;
  width: auto;
  object-fit: contain;
  margin-bottom: 12px;
}

.homeLogo span,
.homeLogo em {
  color: var(--orange);
  font-style: normal;
}

.homeSubtitle {
  font-size: 18px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 40px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.5px;
}

.homeCards {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 330px));
  gap: 22px;
}

.homeCard {
  background: white;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}

.homeCard:hover {
  transform: translateY(-5px);
  border-color: var(--orange);
  box-shadow: 0 16px 38px rgba(255,90,0,0.16);
}

.homeIcon {
  font-size: 44px;
}

.homeCard h2 {
  color: var(--orange);
}

/* LISTS / FOLDERS */
#savedPlaysList,
#logsList,
.foldersList {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.savedPlayItem,
.folderCard {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.savedPlayName,
.folderTitle {
  font-size: 20px;
  font-weight: 900;
  color: var(--orange);
}

.savedPlayMeta,
.folderCode {
  font-size: 13px;
  color: var(--muted);
}

.folderCreateRow {
  display: flex;
  gap: 12px;
  margin: 20px 0 24px;
}

.folderCreateRow input {
  flex: 1;
  background: white;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
}

.folderCreateRow button {
  background: var(--orange);
  border: none;
  color: white;
  font-weight: 900;
  padding: 14px 20px;
  border-radius: 12px;
}

.folderActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shareCodeBadge {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--orange-soft);
  border: 1px solid var(--orange);
  color: var(--orange);
  border-radius: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.hidden {
  display: none !important;
}

/* SCORE */
.bigScore {
  font-size: 72px;
  font-weight: 950;
  color: var(--orange);
}

.scoreLine {
  font-size: 22px;
  margin-bottom: 12px;
}

/* SIMULATOR TOPBAR */
.simTopbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  height: auto;
}

.simHeaderRow,
.simButtonRow,
.simControlsRow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.simHeaderRow .brand {
  font-size: 28px;
  text-align: center;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  #topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand {
    min-width: unset;
  }

  .tools {
    justify-content: flex-start;
  }

  canvas {
    height: calc(100vh - 168px);
  }

  #fieldShell {
    height: calc(100vh - 168px);
  }
}

@media (max-width: 900px) {
  .homeCards {
    grid-template-columns: 1fr;
  }

  .homeLogo {
    font-size: 38px;
  }

  .homeSubtitle {
    font-size: 15px;
  }

  #qrGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .savedPlayItem,
  .folderCard {
    flex-direction: column;
    align-items: flex-start;
  }
}/* =========================================================
   TEAM-CLARITY — COMPACT PRO TOPBAR UPGRADE
   Add-on only. Safe to paste at bottom of style.css.
========================================================= */

#topbar {
  min-height: 68px;
  padding: 10px 16px;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  min-width: 220px;
  font-size: 22px;
  letter-spacing: -0.6px;
}

.tools {
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.toolGroup {
  gap: 8px;
  flex-wrap: nowrap;
}

button,
select {
  height: 42px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

button.primaryBtn,
.modeActive {
  background: var(--orange) !important;
  color: #fff !important;
  border-color: var(--orange) !important;
}

button.dangerBtn {
  background: #151515 !important;
  color: #fff !important;
  border-color: #151515 !important;
}

button.resetBtn {
  background: #fff !important;
  color: var(--orange) !important;
  border-color: rgba(255, 90, 0, 0.35) !important;
}

button.resetBtn:hover {
  background: var(--orange-soft) !important;
}

/* fixed-width controls so the topbar does not jump */
.speedLabel,
.speedGroup {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.speedLabel input[type="range"],
.speedGroup input[type="range"] {
  width: 95px;
  min-width: 95px;
}

#speedValue,
#builderSpeedValue,
#simSpeedValue {
  display: inline-block;
  width: 40px;
  min-width: 40px;
  text-align: right;
  font-weight: 900;
  color: var(--orange);
}

/* compact dropdowns */
#pitchMode {
  width: 112px;
}

#playerSize {
  width: 118px;
}

#playerGroup {
  width: 120px;
}

#playerNumber {
  width: 96px;
}

/* future set-piece button */
#setPieceCycleBtn,
#setPieceBtn,
#cycleSetPieceBtn {
  min-width: 132px;
}

/* builder action group */
.builderControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* simulator keeps same visual language */
.simTopbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0,0,0,0.05);
}

@media (max-width: 1200px) {
  .tools,
  .toolGroup,
  .builderControls {
    flex-wrap: wrap;
  }

  .speedLabel,
  .speedGroup {
    width: 180px;
    min-width: 180px;
  }
}/* =========================================================
   TEAM-CLARITY — TWO-ROW TOPBAR FIX
========================================================= */

#topbar {
  min-height: auto;
  align-items: flex-start;
}

.tools {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.toolGroup {
  justify-content: flex-end;
  width: 100%;
  flex-wrap: wrap;
}

.toolGroup.secondaryRow {
  justify-content: flex-end;
}

#freezeBtn,
.dangerBtn {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

#setPieceCycleBtn {
  min-width: 112px !important;
}

.speedLabel {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}

@media (max-width: 1200px) {
  .tools,
  .toolGroup,
  .toolGroup.secondaryRow {
    align-items: flex-start;
    justify-content: flex-start;
  }
}/* =========================================================
   TEAM-CLARITY — FINAL BUTTON COLOUR CLEANUP
========================================================= */

button,
button.primaryBtn,
#setPieceCycleBtn,
#builderMainBtn,
#loadPlayBtn,
#startSimBtn,
.modeActive {
  background: #fff !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}

button:hover,
button.primaryBtn:hover,
#setPieceCycleBtn:hover,
#builderMainBtn:hover,
#loadPlayBtn:hover,
#startSimBtn:hover {
  background: var(--orange-soft) !important;
  border-color: var(--orange) !important;
  color: var(--text) !important;
}

#resetBtn,
#resetSimBtn,
.resetBtn {
  background: #fff !important;
  color: var(--orange) !important;
  border-color: rgba(255,90,0,0.35) !important;
}

input[type="range"] {
  accent-color: var(--orange);
}

#builderSpeed,
#speed,
#simSpeed {
  accent-color: var(--orange) !important;
}/* =========================================================
   FINAL OVERRIDE — ALL TOPBAR BUTTONS SAME STYLE
========================================================= */

#topbar button,
#topbar button.primaryBtn,
#topbar button.resetBtn,
#topbar button.dangerBtn,
#topbar #freezeBtn,
#topbar #resetBtn,
#topbar #resetSimBtn,
#topbar #clearStepsBtn,
#topbar #startSimBtn,
#topbar #builderMainBtn,
#topbar #loadPlayBtn,
#topbar #setPieceCycleBtn {
  background: #fff !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

#topbar button:hover,
#topbar button.primaryBtn:hover,
#topbar button.resetBtn:hover,
#topbar button.dangerBtn:hover,
#topbar #freezeBtn:hover,
#topbar #resetBtn:hover,
#topbar #resetSimBtn:hover,
#topbar #clearStepsBtn:hover,
#topbar #startSimBtn:hover,
#topbar #builderMainBtn:hover,
#topbar #loadPlayBtn:hover,
#topbar #setPieceCycleBtn:hover {
  background: var(--orange-soft) !important;
  color: var(--text) !important;
  border-color: var(--orange) !important;
}/* Push simulator lower row fully right */
#playsimulatorControls,
.toolGroup.secondaryRow {
  justify-content: flex-end !important;
}/* Simulator lower controls hug content to right */
#playsimulatorControls {
  width: auto !important;
  margin-left: auto !important;
  justify-content: flex-end !important;
}/* =========================================
   ABSOLUTE FINAL SIMULATOR ALIGNMENT FIX
========================================= */

#playsimulatorControls {
  display: flex !important;
  flex-wrap: nowrap !important;

  width: fit-content !important;
  min-width: fit-content !important;
  max-width: fit-content !important;

  margin-left: auto !important;
  margin-right: 0 !important;

  justify-content: flex-end !important;
  align-items: center !important;

  gap: 12px !important;
}

#playsimulatorControls label,
#playsimulatorControls select,
#playsimulatorControls .speedLabel {
  margin: 0 !important;
}

#playsimulatorControls .speedLabel {
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
}.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tcLogo{
  height:78px;
  width:auto;
  object-fit:contain;
  display:block;
}

.liveBadge {
  color: var(--orange);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}.homeHero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 34px;
}

.homeLogoImg {
  width: 540px;
  max-width: 90vw;
  height: auto;
  object-fit: contain;
  display: block;
}

.homeSubtitle {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.8px;
  color: #777;
  text-transform: uppercase;
}
/* =========================
   MOBILE PLAYER SIMULATOR
   ========================= */

.mobileSimBody {
  margin: 0;
  min-height: 100vh;
  background: #f7f4f1;
  font-family: Arial, sans-serif;
  color: #111;
}

.mobileSimHome {
  min-height: 100vh;
  padding: 28px 18px;
  box-sizing: border-box;
}

.mobileSimLogo {
  display: block;
  width: 82%;
  max-width: 360px;
  margin: 18px auto 34px;
}

.mobileSimCard,
.mobileCodeCard {
  background: #fff;
  border-radius: 28px;
  padding: 32px 22px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  margin-bottom: 22px;
}

.mobileSimIcon {
  font-size: 52px;
  margin-bottom: 14px;
}

.mobileSimCard h1 {
  margin: 0 0 18px;
  color: #ff4b13;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.mobileSimCard p {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
}

.mobileCodeCard label {
  display: block;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

.mobileCodeCard input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid #ddd;
  font-size: 20px;
  text-align: center;
  margin-bottom: 14px;
}

.mobileCodeCard button,
.mobileSimControls button {
  width: 100%;
  height: 74px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 24px;
  border: 3px solid #ff5a1f;

  background: #fff;

  color: #111;
  font-size: 20px;
  font-weight: 900;

  cursor: pointer;

  transition:
    transform 0.12s ease,
    background 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;

  box-shadow:
    0 6px 0 #ff5a1f,
    0 10px 20px rgba(0,0,0,0.12);
}

.mobileCodeCard button:hover,
.mobileSimControls button:hover {
  background: #fff4ef;
}

.mobileCodeCard button:active,
.mobileSimControls button:active {
  transform: translateY(4px);

  box-shadow:
    0 2px 0 #ff5a1f,
    0 4px 10px rgba(0,0,0,0.12);

  background: #ff5a1f;
  color: white;
}

.mobileCodeCard button:disabled,
.mobileSimControls button:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.rotatePhoneOverlay {
  display: none;
}

@media screen and (orientation: portrait) {
  body.simulatorActive .rotatePhoneOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f7f4f1;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    box-sizing: border-box;
  }

  body.simulatorActive .rotatePhoneOverlayContent {
    background: #fff;
    border-radius: 32px;
    padding: 38px 26px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.16);
  }

  body.simulatorActive .rotatePhoneIcon {
    font-size: 64px;
    margin-bottom: 18px;
  }

  body.simulatorActive .rotatePhoneOverlay h2 {
    margin: 0 0 12px;
    color: #ff4b13;
    font-size: 32px;
    font-weight: 900;
  }

  body.simulatorActive .rotatePhoneOverlay p {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
  }
}
@media screen and (orientation: landscape) {
  body.simulatorActive {
    margin: 0;
    overflow: hidden;
    background: #f7f4f1;
  }

  body.simulatorActive .mobileSimulatorScreen {
    height: 100vh;
    padding: 8px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 86px 1fr 118px;
    gap: 8px;
    align-items: stretch;
  }

  body.simulatorActive .mobileSimTopbar {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 12px;
  }

  body.simulatorActive .mobileSimTopbar button {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  body.simulatorActive .mobileSimTopbar div {
    display: none;
  }

  body.simulatorActive .mobilePlayerSelect {
    grid-column: 1;
    padding-top: 58px;
    overflow-y: auto;
  }

  body.simulatorActive .mobilePlayerSelect p {
    display: none;
  }

  body.simulatorActive #mobilePlayerButtons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.simulatorActive #mobilePlayerButtons button {
    width: 74px;
    height: 42px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 900;
  }

  body.simulatorActive #mobilePitchWrap {
    grid-column: 2;
    padding: 0;
    height: 100%;
  }

  body.simulatorActive #mobilePitch {
    width: 100%;
    height: calc(100vh - 16px);
    border-radius: 24px;
    display: block;
  }

  body.simulatorActive .mobileSimControls {
    grid-column: 3;
    position: static;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: center;
  }

  body.simulatorActive .mobileSimControls button {
    width: 100%;
    height: 58px;
    font-size: 18px;
    border-radius: 18px;
  }
}
.mobileMenuToggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  border: 3px solid #ff5a1f;
  background: #fff;
  color: #111;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 6px 0 #ff5a1f, 0 10px 24px rgba(0,0,0,.18);
}

.mobileControlOverlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobileControlPanel {
  width: min(720px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 28px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}

.closeMobilePanel {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.mobileControlPanel h2 {
  margin: 0 0 14px;
  color: #ff4b13;
  font-size: 30px;
  font-weight: 900;
}

.mobilePanelScore {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 16px;
}

.mobilePanelScore span {
  display: block;
  margin-top: 4px;
}

.mobilePanelLabel {
  font-weight: 900;
}

.mobileControlPanel #mobilePlayerButtons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.mobileControlPanel #mobilePlayerButtons button {
  height: 52px;
  border-radius: 16px;
  font-weight: 900;
}
@media screen and (orientation: landscape) {
  .mobileControlPanel {
    width: min(760px, 88vw);
    max-height: 78vh;
    padding: 22px 26px;
  }

  .mobileControlPanel h2 {
    margin-bottom: 8px;
  }

  .mobilePanelScore {
    margin-bottom: 12px;
  }

  .mobileControlPanel #mobilePlayBtn,
  .mobileControlPanel #mobileResetBtn {
    width: 210px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px 18px 0;
  }

  .mobileControlPanel #mobilePlayerButtons {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 8px;
    margin-top: 10px;
  }

  .mobileControlPanel #mobilePlayerButtons button {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 15px;
  }

  .mobileControlPanel #mobilePlayerButtons button.active,
  .mobileControlPanel #mobilePlayerButtons button.activeMobilePlayer {
    background: #ff5a1f;
    color: #fff;
    border-color: #ff5a1f;
  }

  
}

/* ==============================
   MOBILE SIMULATOR PRO POLISH
   ============================== */

body.simulatorActive {
  background: #f7f4f1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.simulatorActive #mobilePitchWrap {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100dvh;

  padding: 0;
  margin: 0;

  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background: #f7f4f1;
}

body.simulatorActive #mobilePitch {
  width: 100vw;
  height: 100dvh;

  margin: 0 !important;
  border-radius: 0;

  display: block;

  background: transparent !important;
  background-image: none !important;

  box-shadow: none !important;

  touch-action: none;
}

body.simulatorActive .mobileMenuToggle {
  position: fixed;
  left: 20px;
  right: auto;
  bottom: 20px;
  z-index: 1200;
  width: 70px;
  height: 70px;
  border-radius: 24px;
  border: 3px solid #ff5a1f;
  background: #fff;
  color: #111;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 7px 0 #ff5a1f, 0 12px 28px rgba(0,0,0,.22);
}

body.simulatorActive .mobileSimTopbar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
}

body.simulatorActive .mobileSimTopbar div {
  display: none;
}

body.simulatorActive .mobileSimTopbar button {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 2px solid #e5e5e5;
  background: #fff;
  font-size: 24px;
  font-weight: 900;
}

body.simulatorActive .mobileControlOverlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(0,0,0,.46);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.simulatorActive .mobileControlOverlay.hidden {
  display: none !important;
}

body.simulatorActive .mobileControlPanel {
  width: min(980px, 92vw);
  max-height: 82dvh;
  overflow-y: auto;
  background: #fff;
  border-radius: 32px;
  padding: 26px 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.32);
  position: relative;
}

body.simulatorActive .mobileControlPanel h2 {
  margin: 0 0 14px;
  color: #ff4b13;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

body.simulatorActive .closeMobilePanel {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 2px solid #e5e5e5;
  background: #fff;
  font-size: 24px;
  font-weight: 900;
}

body.simulatorActive .mobilePanelScore {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 18px;
}

body.simulatorActive .mobilePanelScore strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

body.simulatorActive .mobilePanelLabel {
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 900;
}

body.simulatorActive .mobileControlPanel #mobilePlayBtn,
body.simulatorActive .mobileControlPanel #mobileResetBtn,
body.simulatorActive .mobileControlPanel #mobileShadowToggle {
  width: 190px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 16px 0;
  border-radius: 18px;
  border: 3px solid #ff5a1f;
  background: #fff;
  color: #111;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 5px 0 #ff5a1f, 0 8px 18px rgba(0,0,0,.14);
}

body.simulatorActive .mobileControlPanel #mobilePlayBtn:active,
body.simulatorActive .mobileControlPanel #mobileResetBtn:active,
body.simulatorActive .mobileControlPanel #mobileShadowToggle:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #ff5a1f, 0 4px 10px rgba(0,0,0,.14);
}

body.simulatorActive .mobileControlPanel #mobilePlayerButtons {
  display: grid;
  grid-template-columns: repeat(8, 52px);
  gap: 10px;
  margin-top: 8px;
  justify-content: start;
}

body.simulatorActive .mobileControlPanel #mobilePlayerButtons button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 2px solid #e5e5e5;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 900;
}

body.simulatorActive .mobileControlPanel #mobilePlayerButtons button.active,
body.simulatorActive .mobileControlPanel #mobilePlayerButtons button.activeMobilePlayer {
  background: #ff5a1f;
  color: #fff;
  border-color: #ff5a1f;
}

.mobileCountdownOverlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.22);
  color: #fff;
  font-size: 110px;
  font-weight: 900;
  text-shadow: 0 8px 28px rgba(0,0,0,.45);
}

.mobileScorePopup {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.36);
}

.mobileScorePopupCard {
  width: min(360px, 82vw);
  background: #fff;
  border-radius: 30px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
}

.mobileScorePopupTitle {
  color: #ff4b13;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}

.mobileScorePopupValue {
  font-size: 54px;
  font-weight: 900;
  color: #111;
  margin-bottom: 18px;
}

.mobileScorePopupCard button {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: 3px solid #ff5a1f;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
}

body.simulatorActive .mobileControlPanel #mobileViewToggle,
body.simulatorActive .mobileControlPanel #mobileSpeedToggle {
  width: 190px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 16px 0;

  border-radius: 18px;
  border: 3px solid #ff5a1f;

  background: #fff;
  color: #111;

  font-size: 17px;
  font-weight: 900;

  box-shadow:
    0 5px 0 #ff5a1f,
    0 8px 18px rgba(0,0,0,.14);
}

body.simulatorActive #mobilePlayName {
  position: fixed;
  top: 14px;
  left: 84px;
  z-index: 1200;

  background: rgba(255,255,255,0.92);
  border: 2px solid #eee;
  border-radius: 16px;

  padding: 10px 14px;
  font-size: 16px;
  font-weight: 900;
  color: #111;

  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dangerBtn {
  border: 2px solid #d71920;
  color: #d71920;
  background: #fff;
  font-weight: 900;
}

.dangerBtn:hover {
  background: #d71920;
  color: #fff;
}

/* MOBILE LANDING / FOLDER / PLAY SELECTION SCROLL FIX */
.mobileSimBody {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  min-height: 100dvh;
  height: auto !important;
  -webkit-overflow-scrolling: touch;
}

.mobileSimHome {
  min-height: 100dvh;
  height: auto !important;
  overflow-y: visible !important;
  padding-bottom: 140px !important;
}

#mobilePlaysList,
.mobilePlaysList,
.foldersList,
#savedPlaysList {
  max-height: none !important;
  overflow: visible !important;
}

body.simulatorActive .mobileControlPanel #mobileChoosePlayBtn,
body.simulatorActive .mobileControlPanel #choosePlayBtn,
body.simulatorActive .mobileControlPanel #mobileLoadPlayBtn {
  width: 190px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 16px 0;

  border-radius: 18px;
  border: 3px solid #ff5a1f;

  background: #fff;
  color: #111;

  font-size: 17px;
  font-weight: 900;

  box-shadow:
    0 5px 0 #ff5a1f,
    0 8px 18px rgba(0,0,0,.14);
}

/* MOBILE PLAY NAME — LAPTOP STYLE TOP RIGHT */
body.simulatorActive #mobilePlayName {
  display: block !important;
  position: fixed !important;

  top: 22px !important;
  right: 28px !important;
  left: auto !important;
  bottom: auto !important;

  z-index: 1600;

  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  padding: 0 !important;

  font-family: "Courier New", monospace;
  font-size: clamp(18px, 2.8vw, 28px);
  font-weight: 900;
  color: #ffd400;

  letter-spacing: 1px;
  text-transform: uppercase;
line-height: 0.95;
  text-shadow:
    3px 3px 0 #111,
    5px 5px 0 rgba(0,0,0,0.25);

  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FIX — SHOW SELECTED PLAY NAME ON MOBILE SIMULATOR */
body.simulatorActive .mobileSimTopbar div {
  display: block !important;
}

body.simulatorActive #mobileScoreText {
  display: none !important;
}

/* =========================
   TEAM-CLARITY AUTH SCREEN
========================= */

.authBody {
  margin: 0;
  min-height: 100dvh;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(255,90,0,0.16), transparent 34%),
    #f7f4f1;
  font-family: Inter, Arial, sans-serif;
}

.authScreen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.authCard {
  width: min(430px, 94vw);
  background: #fff;
  border-radius: 32px;
  padding: 34px 26px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,.16);
  border: 1px solid #eee;
}

.authLogo {
  width: 300px;
  max-width: 88%;
  height: auto;
  margin: 0 auto 18px;
  display: block;
}

.authCard h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 900;
  color: #ff4b13;
}

.authCard p {
  margin: 0 0 22px;
  color: #666;
  font-weight: 800;
  line-height: 1.35;
}

.authCard input {
  width: 100%;
  height: 56px;
  border-radius: 18px;
  border: 2px solid #e5e5e5;
  padding: 0 16px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 800;
  box-sizing: border-box;
}

.authProviderBtn,
.authMainBtn {
  width: 100%;
  height: 58px;
  border-radius: 20px;
  border: 3px solid #ff5a1f;
  background: #fff;
  color: #111;
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 12px;
  box-shadow: 0 5px 0 #ff5a1f, 0 9px 18px rgba(0,0,0,.13);
}

.authMainBtn {
  background: #ff5a1f;
  color: #fff;
}

.authDivider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #888;
  font-weight: 900;
  margin: 10px 0 18px;
}

.authDivider::before,
.authDivider::after {
  content: "";
  height: 1px;
  background: #e5e5e5;
  flex: 1;
}

.authMessage {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
  color: #777;
  line-height: 1.35;
}

/* =========================
   TEAM-CLARITY JOIN FOLDER
========================= */

.joinFolderBody {
  margin: 0;
  min-height: 100dvh;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(255,90,0,0.16), transparent 34%),
    #f7f4f1;
  font-family: Inter, Arial, sans-serif;
  color: #111;
}

.joinFolderScreen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 18px;
}

.joinFolderLogo {
  width: 420px;
  max-width: 88vw;
  height: auto;
}

.joinFolderCard {
  width: min(430px, 94vw);
  background: #fff;
  border-radius: 32px;
  padding: 34px 26px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0,0,0,.16);
  border: 1px solid #eee;
}

.joinFolderIcon {
  font-size: 46px;
  margin-bottom: 12px;
}

.joinFolderCard h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 900;
  color: #ff4b13;
}

.joinFolderCard p {
  margin: 0 0 22px;
  color: #666;
  font-weight: 800;
  line-height: 1.35;
}

.joinFolderCard input {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  border: 2px solid #e5e5e5;
  padding: 0 16px;
  margin-bottom: 14px;
  font-size: 19px;
  font-weight: 900;
  text-align: center;
  box-sizing: border-box;
}

#joinFolderBtn,
.joinBackBtn {
  width: 100%;
  height: 58px;
  border-radius: 20px;
  border: 3px solid #ff5a1f;
  background: #ff5a1f;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 12px;
  box-shadow: 0 5px 0 #d9430b, 0 9px 18px rgba(0,0,0,.13);
}

.joinBackBtn {
  background: #fff;
  color: #111;
  box-shadow: 0 5px 0 #ff5a1f, 0 9px 18px rgba(0,0,0,.13);
}

#joinMessage {
  margin-top: 10px;
  min-height: 22px;
  font-size: 14px;
  font-weight: 900;
}

#joinMessage.success {
  color: #138a38;
}

#joinMessage.error {
  color: #d71920;
}