* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  touch-action: manipulation;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background-color: #1a1a1a;
  background-image: linear-gradient(rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0.55)), url('media/Chalkboard-Background-Graphics.png');
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
  color: #20242b;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
}

.screen.active {
  display: flex;
}

/* ---- Home screen ---- */

#home {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6vh;
  padding: 4vh 4vw;
}

.home-logo {
  width: min(50vw, 420px);
  height: auto;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4vw;
  width: 100%;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  width: min(28vw, 380px);
  height: min(28vw, 380px);
  min-width: 220px;
  min-height: 220px;
  border-radius: 28px;
  border: none;
  background: #f7f8f1;
  color: #20242b;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, background 0.12s ease;
}

.tile:active {
  transform: scale(0.96);
  background: #bbe58b;
}

.tile-icon {
  display: flex;
}

.tile-icon img {
  width: clamp(3rem, 8vw, 6rem);
  height: clamp(3rem, 8vw, 6rem);
  object-fit: contain;
}

.tile-label {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 600;
  text-align: center;
}

/* ---- Viewer screen ---- */

#viewer {
  flex-direction: column;
}

.viewer-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2vw;
  padding: 1.2vh 2vw;
  background: #f7f8f1;
  color: #20242b;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

#home-btn {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 1.4vh 2.4vw;
  border: none;
  border-radius: 14px;
  background: #bbe58b;
  color: #20242b;
  cursor: pointer;
}

#home-btn img {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

#home-btn:active {
  background: #9cc873;
}

#viewer-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

#viewer-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}
