* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #050505;
  color: #f6f1e4;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

a { color: inherit; text-decoration: none; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.shell {
  border: 3px solid #2a6ad6;
  border-radius: 22px;
  background: #0a0a0c;
  overflow: hidden;
  box-shadow: 0 8px 0 #163a86;
}

.header {
  padding: 18px 16px 10px;
  text-align: center;
  border-bottom: 2px solid #1a3f8a;
}

.pid-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  letter-spacing: -0.03em;
  color: #f0c43a;
  text-shadow: 0 0 2px #ff7a18, 2px 3px 0 #3a1a00, -1px 0 #2a6ad6;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8c0b0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
  padding: 18px 14px 20px;
}

@media (min-width: 420px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.app-tile:focus-visible .icon-wrap {
  outline: 3px solid #3aa0ff;
  outline-offset: 3px;
}

.icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 3px solid #2a6ad6;
  background: #121018;
  box-shadow: 0 3px 0 #163a86;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.app-tile:active .icon-wrap {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #163a86;
}

.icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.letter-tile {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #f0c9a0;
  color: #1a140e;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.app-label {
  max-width: 88px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: #f6f1e4;
  word-break: break-word;
}

.empty {
  margin: 0;
  padding: 36px 18px;
  text-align: center;
  color: #c8c0b0;
  font-size: 14px;
  line-height: 1.5;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: #f0c43a;
  font-size: 1.05rem;
}

.footer {
  margin: 14px 4px 0;
  text-align: center;
  font-size: 11px;
  color: #8a8378;
}

.footer a {
  color: #3aa0ff;
  font-weight: 700;
}
