/* Aggy's Retro TV: setup menu and shared utility rules. */

[hidden] { display: none !important; }

/* ============ SETUP MENU (90s set OSD) ============ */

#setup {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 2.6% 3.4%;
  background: rgba(6, 12, 62, 0.86);
  border: 2px solid #8ea2ff;
  border-radius: 4px;
  font-family: 'Jersey 15', 'Archivo', sans-serif;
  color: #e9edff;
  letter-spacing: 0.05em;
  line-height: 1.16;
  text-shadow: 1px 1px 0 #000;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.su-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1em;
  padding-bottom: 0.25em;
  margin-bottom: 0.3em;
  border-bottom: 2px solid rgba(142, 162, 255, 0.5);
  font-size: 1.3em;
  color: #ffd451;
}
.su-sub { font-size: 0.46em; line-height: 1.2; color: #9fb4ff; text-align: right; }

.su-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2em; }

.su-opts {
  margin-top: 0.3em;
  padding-top: 0.3em;
  border-top: 2px solid rgba(142, 162, 255, 0.5);
}

.su-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.02em 0.4em;
  border-radius: 2px;
  white-space: nowrap;
  cursor: pointer;
}
.su-name { overflow: hidden; text-overflow: ellipsis; }
.su-row.sel { background: #2e46d6; box-shadow: inset 0 0 0 1px #b9c6ff; }
.su-state { color: #35e05a; }
.su-row.off .su-state { color: #ff9a62; }
.su-row.off .su-name { color: #8f98c9; }

.su-foot {
  margin-top: auto;
  padding-top: 0.3em;
  font-size: 0.62em;
  color: #9fb4ff;
  text-align: center;
}

/* phones: a sheet with thumb-sized rows instead of a tiny on-tube menu */
#setup.sheet {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78dvh;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  border-radius: 14px 14px 0 0;
  border-width: 2px 0 0;
  font-size: 17px;
  line-height: 1.5;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(6, 12, 62, 0.96);
}
#setup.sheet .su-grid { grid-template-columns: 1fr; }
#setup.sheet .su-row { padding: 0.25em 0.5em; }

@media (orientation: landscape) and (max-height: 520px) {
  #setup.sheet {
    left: 50%;
    right: auto;
    top: 4vh;
    bottom: 4vh;
    width: min(620px, 88vw);
    max-height: none;
    transform: translateX(-50%);
    border-radius: 10px;
    border-width: 2px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.35;
  }
  #setup.sheet .su-grid { grid-template-columns: 1fr 1fr; }
}

/* ============ FULL SCREEN TIP (phones, once, 10s after walking in) ============ */

#fs-tip {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 16px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + 16px)
    calc(env(safe-area-inset-left, 0px) + 16px);
  background: rgba(2, 3, 12, 0);
  transition: background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
#fs-tip.show { background: rgba(2, 3, 12, 0.45); }

.fs-card {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 16px 18px 14px;
  background: rgba(6, 12, 62, 0.95);
  border: 2px solid #8ea2ff;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  color: #e9edff;
  font: 500 15px/1.4 'Archivo', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.3s cubic-bezier(.22,1,.36,1), transform 0.3s cubic-bezier(.22,1,.36,1);
}
#fs-tip.show .fs-card { opacity: 1; transform: none; }

.fs-title {
  font-family: 'Jersey 15', 'Archivo', sans-serif;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #ffd451;
  text-shadow: 1px 1px 0 #000;
}
.fs-sub {
  margin: 4px 0 10px;
  font-family: 'Jersey 15', 'Archivo', sans-serif;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: #35e05a;
  text-shadow: 1px 1px 0 #000;
}

.fs-steps { margin: 0 0 14px; }
ol.fs-steps { padding-left: 1.3em; }
ol.fs-steps li { margin: 6px 0; }
.fs-steps b { color: #fff; font-weight: 800; }
.fs-share { width: 1.15em; height: 1.15em; vertical-align: -0.22em; color: #9fb4ff; }
.fs-android p { margin: 0 0 8px; }
.fs-android .fs-alt { margin: 10px 0 0; font-size: 13px; color: #9fb4ff; }

#fs-tip-go,
#fs-tip-ok {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  font: 800 14px/1 'Archivo', system-ui, sans-serif;
  letter-spacing: 0.12em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#fs-tip-go { border: 0; background: #35e05a; color: #04210c; }
#fs-tip-ok { border: 1px solid rgba(142, 162, 255, 0.6); background: transparent; color: #e9edff; }

/* iPhone (and any browser without page full screen) gets the Home Screen steps */
#fs-tip .fs-ios { display: none; }
#fs-tip.ios .fs-ios { display: block; }
#fs-tip.ios .fs-android { display: none; }

@media (orientation: landscape) and (max-height: 520px) {
  .fs-card { width: min(560px, 100%); padding: 12px 16px; font-size: 14px; }
  .fs-title { font-size: 22px; }
  .fs-sub { font-size: 17px; margin-bottom: 6px; }
  ol.fs-steps li { margin: 3px 0; }
  .fs-steps { margin-bottom: 10px; }
  #fs-tip-go, #fs-tip-ok { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .fs-card, #fs-tip { transition: none; }
}
