/* ============================
   MOBILE HUD — touch-first
============================ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: monospace;
  background: url("assets/hub_bg.png") center center / cover no-repeat fixed;
  color: #fff;
}

button, a {
  touch-action: manipulation;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh;
}

/* ============================
   TOP BAR
============================ */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
  z-index: 100;
}

#sweetas-logo {
  width: 96px;
  filter: drop-shadow(0 0 8px #ff00ff) drop-shadow(0 0 14px #00ffff);
}

#app-title {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 8px #ff00ff, 0 0 12px #00ffff;
}

#desktop-link {
  font-size: 11px;
  color: #9fe8ff;
  text-decoration: none;
  border: 1px solid rgba(0,234,255,0.5);
  border-radius: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.55);
}

/* ============================
   CONTENT AREA (scrollable)
============================ */
#content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

.panel {
  display: none;
  padding: 14px 0 90px;
}

.panel.active {
  display: block;
}

/* ============================
   GAME CARDS (big touch targets)
============================ */
#game-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 12px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(160deg, rgba(20,25,45,0.92), rgba(5,8,20,0.95));
  border: 2px solid #00ffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 0 14px rgba(0,255,255,0.3), inset 0 0 18px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.game-card:active {
  transform: scale(0.97);
  border-color: #ff00ff;
  box-shadow: 0 0 18px rgba(255,0,255,0.45);
}

.game-card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.3);
  flex: 0 0 auto;
  background: #000;
}

.game-info {
  flex: 1 1 auto;
  min-width: 0;
}

.game-title {
  font-size: 19px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 8px #00ffff;
  margin-bottom: 6px;
}

.game-meta {
  font-size: 13px;
  line-height: 1.5;
  color: #9fe8ff;
}

.game-meta b {
  color: #fff;
  font-weight: bold;
}

.game-card.pc-only {
  border-color: #ff9a3c;
  box-shadow: 0 0 14px rgba(255,154,60,0.3), inset 0 0 18px rgba(0,0,0,0.5);
  opacity: 0.88;
}

.game-card.pc-only:active {
  border-color: #ff9a3c;
  box-shadow: 0 0 18px rgba(255,154,60,0.45);
}

/* ============================
   UNDER THE GAMES
   ============================ */
#big-screen-nudge {
  margin: 22px 12px 0;
  padding: 13px 15px;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: #00ffcc;
  text-shadow: 0 0 10px rgba(0,255,204,0.5);
  border: 1px dashed rgba(0,255,204,0.45);
  border-radius: 14px;
  background: rgba(0,255,204,0.06);
}

.card-copy {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.32);
}

.pc-only .game-play {
  color: #ff9a3c;
  text-shadow: 0 0 8px #ff9a3c;
  border-color: #ff9a3c;
  background: rgba(255, 154, 60, 0.12);
  box-shadow: 0 0 10px rgba(255, 154, 60, 0.3);
}

.pc-only .game-title {
  color: #ffd0a0;
  text-shadow: 0 0 8px #ff9a3c;
}

.pc-tag {
  color: #ff9a3c;
  font-size: 12px;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 154, 60, 0.6);
}

#pc-only-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  width: max-content;
  max-width: calc(100vw - 48px);
  background: rgba(20, 10, 4, 0.96);
  border: 2px solid #ff9a3c;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 0 22px rgba(255, 154, 60, 0.45);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9500;
}

#pc-only-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pc-only-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #ff9a3c;
  text-shadow: 0 0 10px #ff9a3c;
  margin-bottom: 6px;
}

.pc-only-body {
  font-size: 13px;
  line-height: 1.5;
  color: #ffdcc0;
}

.game-play {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: bold;
  color: #00eaff;
  text-shadow: 0 0 8px #00eaff;
  border: 2px solid #00eaff;
  border-radius: 10px;
  padding: 12px 16px;
  background: rgba(0, 234, 255, 0.12);
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.3);
}

/* ============================
   STATS PANEL — mobile cards
============================ */
#stats-content {
  padding: 6px 12px;
}

.stats-title {
  font-size: 18px;
  letter-spacing: 3px;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 8px #00ffff, 0 0 16px #ff00ff;
  margin: 10px 0 6px;
}

.stats-title-deco {
  color: #ff00ff;
  text-shadow: 0 0 8px #ff00ff;
  margin: 0 8px;
}

.stat-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.stat-card {
  background: linear-gradient(160deg, rgba(20,20,40,0.92), rgba(5,5,20,0.96));
  border: 2px solid #00ffff;
  border-radius: 16px;
  padding: 14px;
  font-family: monospace;
  box-shadow: 0 0 14px rgba(0,255,255,0.35), inset 0 0 20px rgba(0,0,0,0.6);
}

.stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.stat-rank {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700, 0 0 16px #ff8800;
}

.stat-card-name {
  font-size: 17px;
  letter-spacing: 2px;
}

.glow-0 { color: #00ffff; text-shadow: 0 0 8px #00ffff, 0 0 16px #00ffff; }
.glow-1 { color: #ff00ff; text-shadow: 0 0 8px #ff00ff, 0 0 16px #ff00ff; }
.glow-2 { color: #ffff00; text-shadow: 0 0 8px #ffff00, 0 0 16px #ff8800; }

.stat-meter {
  margin-bottom: 12px;
}

.stat-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9fe8ff;
  margin-bottom: 5px;
}

.stat-value {
  color: #fff;
  text-shadow: 0 0 6px #00ffff;
}

.meter-bg {
  height: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 4px;
}

.meter-score { background: linear-gradient(90deg, #00ffff, #ff00ff); }
.meter-plays { background: linear-gradient(90deg, #ffff00, #ff8800); }
.meter-stage { background: linear-gradient(90deg, #00ff88, #00ffff); }

.stat-lines {
  margin-top: 12px;
  font-size: 12px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stat-line span:first-child { color: #9fe8ff; }
.stat-line span:last-child { color: #fff; text-align: right; }

/* ============================
   CHATCLOUD BANNER
============================ */
#chatcloud-banner {
  margin: 16px 12px;
  padding: 30px 22px;
  cursor: pointer;
  border: 2px solid #00ffff;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(0,40,60,0.94), rgba(10,10,30,0.97));
  font-family: monospace;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 18px rgba(0,255,255,0.45), inset 0 0 30px rgba(0,0,0,0.6);
}

.cc-title {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 0 0 10px #00ffff, 0 0 24px #ff00ff;
  margin-bottom: 10px;
}

.cc-subtitle {
  font-size: 16px;
  letter-spacing: 2px;
  color: #ff00ff;
  text-shadow: 0 0 8px #ff00ff;
  margin-bottom: 18px;
}

.cc-text {
  font-size: 14px;
  line-height: 1.7;
  color: #9fe8ff;
  margin-bottom: 20px;
}

.cc-welcome {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 4px;
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700, 0 0 16px #ff8800;
  animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse {
  0%, 100% { text-shadow: 0 0 8px #ffd700, 0 0 16px #ff8800; }
  50%      { text-shadow: 0 0 16px #ffd700, 0 0 32px #ff8800; }
}

/* ============================
   HALL OF FAME PANEL
============================ */

/* the artwork scrolls with the tab (no fixed layer on touch devices) and
   only exists while the tab is open, since the panel is display:none */
#panel-halloffame {
  background:
    linear-gradient(180deg, rgba(2,4,12,0.62), rgba(2,4,12,0.82) 40%, rgba(2,4,12,0.92)),
    url("assets/halloffame.png") center top / 100% auto no-repeat;
  min-height: 100%;
  animation: hofBgIn 0.5s ease-out both;
}

@keyframes hofBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #panel-halloffame { animation: none; }
}

#halloffame-content {
  padding: 6px 12px 20px;
}

.hof-sub {
  text-align: center;
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #9fe8ff;
  margin-bottom: 12px;
}

.hof-boards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hof-card {
  background: linear-gradient(160deg, rgba(20,20,40,0.9), rgba(5,5,20,0.95));
  border: 2px solid #ff00ff;
  border-radius: 12px;
  padding: 14px;
  font-family: monospace;
  text-align: left;
  box-shadow: 0 0 14px rgba(255,0,255,0.3), inset 0 0 20px rgba(0,0,0,0.7);
}

.hof-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.hof-card-name {
  font-size: 15px;
  letter-spacing: 1px;
  color: #00eaff;
  text-shadow: 0 0 8px #00eaff;
}

.hof-card-best {
  font-size: 11px;
  color: #ffd700;
  text-shadow: 0 0 6px #ffd700;
  white-space: nowrap;
}

.hof-empty {
  font-size: 11px;
  color: #8894b8;
  padding: 14px 0;
  text-align: center;
}

.hof-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hof-row {
  display: grid;
  grid-template-columns: 34px 62px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
}

.hof-row.champ {
  background: rgba(255,215,0,0.10);
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255,215,0,0.35);
}

.hof-place {
  font-size: 11px;
  font-weight: bold;
  color: #9fe8ff;
}

.hof-row.champ .hof-place {
  color: #ffd700;
}

.hof-name {
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 8px #00ffff;
  white-space: nowrap;
  overflow: hidden;
}

.hof-row.champ .hof-name {
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
}

.hof-score {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-align: right;
  text-shadow: 0 0 6px #00ff88;
}

.hof-date {
  display: none;
}


/* ============================
   BOTTOM TAB BAR
============================ */
#tabbar {
  flex: 0 0 auto;
  display: flex;
  background: rgba(0,0,0,0.9);
  border-top: 1px solid rgba(0,234,255,0.35);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #9fe8ff;
  font-family: monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0;
  padding: 16px 4px;
  cursor: pointer;
  border-top: 3px solid transparent;
}

.tab-btn.active {
  color: #00eaff;
  text-shadow: 0 0 10px #00eaff;
  border-top-color: #00eaff;
  background: rgba(0,234,255,0.08);
}

/* ============================
   ADD TO HOME SCREEN BAR
============================ */
#a2hs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(6,3,15,0.96);
  border-top: 1px solid rgba(255,0,255,0.45);
  font-family: monospace;
  z-index: 120;
}

#a2hs[hidden] {
  display: none;
}

#a2hs-text {
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.35;
  color: #dfe6ff;
}

#a2hs-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid #00ffcc;
  background: rgba(0,255,204,0.12);
  color: #00ffcc;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
}

#a2hs-btn:active {
  transform: scale(0.95);
}

#a2hs-btn[hidden] {
  display: none;
}

#a2hs-x {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid #4a5a80;
  background: transparent;
  color: #9aa8cc;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}