/* Jegg - style.css */

[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 0 16px 30px;
  background: #ffffff;
  color: #222222;
  font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color-scheme: light;
}

a { color: #1a4fa0; }
a:visited { color: #5a3a8a; }

img { max-width: 100%; display: block; }

#page { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; }

/* the bouncing JEGG lives on this layer, behind everything */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* header */
#header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 12px;
  border-bottom: 4px solid #f5c400;
}
#header h1 {
  margin: 0;
  font-size: 46px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.01em;
}
#header h1 a, #header h1 a:visited { color: #222222; text-decoration: none; }

/* catalog buttons: rounded, glossy yellow gradient */
.btn, .btn:visited {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: linear-gradient(to bottom, #fff7c2 0%, #ffe34d 45%, #f5c400 55%, #e0a800 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(0,0,0,.25);
  color: #222222;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.btn:hover {
  background: linear-gradient(to bottom, #fffbe0 0%, #fff07a 45%, #ffd21f 55%, #f0b800 100%);
  color: #000000;
}
.btn:active, .btn.here {
  background: linear-gradient(to bottom, #e0a800 0%, #f5c400 50%, #ffe34d 100%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.25);
}

/* nav bar */
#nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
}
#nav .btn { min-width: 120px; }

/* picture spots: fill in when files are in the images folder */
.pic { margin: 0; background: #f2f2f2; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d9b300;
  background: #fffbe6;
  color: #8a7000;
  font-size: 12px;
  text-align: center;
}
.pic.empty::after { content: attr(data-label); padding: 4px; }

.logo { width: 150px; flex: none; background: #ffffff; }
.logo img { height: auto; object-fit: contain; }

#content { padding: 20px 0 10px; }

h2 {
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid #f5c400;
  font-size: 26px;
}
h3 { font-size: 16px; margin: 8px 0 0; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }

/* videos */
.videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 20px;
}
.video {
  padding: 10px;
  border: 1px solid #dddddd;
  border-top: 4px solid #f5c400;
  border-radius: 6px;
  background: #ffffff;
}
.player {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #111111;
  color: #222222;
  cursor: pointer;
  font: bold 15px Arial, Helvetica, sans-serif;
}
.player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player span {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 18px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: linear-gradient(to bottom, #fff7c2 0%, #ffe34d 45%, #f5c400 55%, #e0a800 100%);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.player:hover span { background: linear-gradient(to bottom, #fffbe0, #ffd21f); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* gallery */
.gallery {
  columns: 3;
  column-gap: 12px;
}
.gallery .pic {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid #f5c400;
}
.gallery .pic img { height: auto; }
.gallery .pic.empty { aspect-ratio: 4 / 3; }
.gallery a:hover img { opacity: .85; }

/* about */
.about-pic { max-width: 560px; border-radius: 8px; overflow: hidden; margin-bottom: 24px; border: 3px solid #f5c400; }
.about-pic img { height: auto; }
.about-pic.empty { aspect-ratio: 1; }
.members {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.member {
  padding: 8px;
  border: 1px solid #dddddd;
  border-top: 4px solid #f5c400;
  border-radius: 6px;
  background: #ffffff;
}
.member .pic { aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.member p { margin: 8px 0 2px; text-align: center; font-weight: bold; }
.member a { display: block; }
.member a:hover img { opacity: .85; }

/* member pages (boys/) */
.profile {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.profile-pic { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 3px solid #f5c400; }
.bio p:first-child { margin-top: 0; }
.bio.empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d9b300;
  background: #fffbe6;
  color: #8a7000;
  font-size: 12px;
}
.bio.empty::after { content: attr(data-label); }

/* Jegg Games: catalog-style game buttons */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.game-tile, .game-tile:visited {
  display: block;
  padding: 8px 8px 10px;
  border: 1px solid #b38a00;
  border-radius: 8px;
  background: linear-gradient(to bottom, #fff7c2 0%, #ffe34d 45%, #f5c400 55%, #e0a800 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 3px rgba(0,0,0,.3);
  color: #222222;
  text-decoration: none;
  text-align: center;
}
.game-tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #b38a00;
  border-radius: 4px;
  background: #111111;
}
.game-tile span {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.game-tile:hover {
  background: linear-gradient(to bottom, #fffbe0 0%, #fff07a 45%, #ffd21f 55%, #f0b800 100%);
  color: #000000;
}
.game-tile:active {
  background: linear-gradient(to bottom, #e0a800 0%, #f5c400 50%, #ffe34d 100%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.25);
}

#footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 4px solid #f5c400;
}
#footer .btn { font-size: 13px; padding: 5px 14px; }

@media (max-width: 640px) {
  #header h1 { font-size: 36px; }
  .logo { width: 110px; }
  #nav .btn { flex: 1 1 auto; min-width: 0; }
  .videos { grid-template-columns: minmax(0, 1fr); }
  .gallery { columns: 2; }
  .members { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .profile { grid-template-columns: minmax(0, 1fr); }
  .profile-pic { max-width: 320px; }
}

/* Kev Game page */
#kevgame-box {
  position: relative;
  border: 3px solid #f5c400;
  border-radius: 6px;
  overflow: hidden;
  background: #000000;
}
#kevgame-box:fullscreen { border: 0; border-radius: 0; display: flex; align-items: center; }
#kevgame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
  outline: none;
}
#kevgame-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
}
.btn.big { font-size: 20px; padding: 12px 34px; }
.btn.small { font-size: 12px; padding: 3px 10px; }
button.btn { cursor: pointer; font-family: inherit; }
button.btn:disabled { opacity: .7; cursor: wait; }
.controls { margin: 12px 0 0; font-size: 14px; }

#kevgame-pad { display: none; gap: 8px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
#kevgame-pad .btn { min-width: 64px; padding: 14px 10px; font-size: 18px; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (pointer: coarse) {
  #kevgame-pad { display: flex; }
}

#kevgame-overlay { gap: 16px; flex-wrap: wrap; }
.btn.bungus, .btn.bungus:visited {
  border-color: #000000;
  background: linear-gradient(to bottom, #3a2a10 0%, #1a1206 55%, #000000 100%);
  color: #ffd23a;
  text-shadow: 0 0 12px rgba(255, 180, 40, .7);
  box-shadow: inset 0 1px 0 rgba(255, 210, 90, .5), 0 0 18px rgba(255, 170, 40, .45);
  font-family: Cinzel, Georgia, serif;
  letter-spacing: .06em;
}
.btn.bungus:hover { color: #fff3c4; background: linear-gradient(to bottom, #4a3614 0%, #22170a 55%, #050300 100%); }
h2.glitch { animation: glitch .9s steps(2) 1; }
@keyframes glitch {
  0%   { transform: translate(0, 0); text-shadow: 3px 0 #ff0040, -3px 0 #00e5ff; }
  20%  { transform: translate(-4px, 2px); text-shadow: -5px 0 #ff0040, 5px 0 #00e5ff; }
  40%  { transform: translate(5px, -1px) skewX(-12deg); opacity: .6; }
  60%  { transform: translate(-2px, 1px); text-shadow: 4px 0 #ff0040, -4px 0 #00e5ff; }
  80%  { transform: translate(2px, 0) skewX(8deg); }
  100% { transform: none; text-shadow: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { h2.glitch { animation: none; } }
.gallery .pic video { display: block; width: 100%; height: auto; background: #000000; }

/* Jegg Balls page */
#balls-wrap { max-width: 480px; margin: 0 auto; }
.balls-score { margin: 0 0 8px; font-size: 16px; }
#balls-box {
  position: relative;
  border: 3px solid #f5c400;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: #fffdf2;
}
#balls {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  touch-action: none;
  outline: none;
  cursor: pointer;
}
#balls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, .6);
}
#balls-msg {
  margin: 0;
  padding: 10px 24px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: #ffffff;
  font-size: 18px;
  text-align: center;
}
.balls-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}
.balls-chain img { border-radius: 50%; border: 1px solid #222222; }
.balls-chain .crusty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #222222;
  background: #ffffff;
  color: #000000;
  font: 10px "Comic Sans MS", "Comic Sans", "Comic Neue", cursive;
}
.balls-score { display: flex; align-items: center; gap: 4px; }
.balls-next { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.balls-next img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #222222; }
/* Jegg Balls high scores */
#lb-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 12px;
  padding: 10px 14px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: #fff6c2;
  font-size: 15px;
}
#lb-form[hidden], #lb-note[hidden], #lb[hidden] { display: none; }
#lb-name {
  width: 11em;
  max-width: 100%;
  padding: 4px 6px;
  border: 2px solid #b38a00;
  border-radius: 4px;
  font: bold 17px Arial, Helvetica, sans-serif;
}
#lb-note { margin: 0; font-size: 14px; background: #ffffff; padding: 2px 8px; border-radius: 4px; }
#lb { margin-top: 18px; text-align: center; }
#lb h3 { margin: 0 0 6px; font-size: 18px; }
.lb-tabs { margin: 0 0 8px; }
#lb-list {
  list-style: none;
  max-width: 340px;
  margin: 0 auto;
  padding: 6px 12px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: #fffdf2;
  font: bold 16px "Courier New", Courier, monospace;
  text-align: left;
}
#lb-list li { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px; }
#lb-list li.me { background: #ffe14d; border-radius: 3px; }
#lb-list li.lb-empty { justify-content: center; font: 14px Arial, Helvetica, sans-serif; color: #555555; }
.lb-rank { width: 2em; text-align: right; color: #8a6a00; }
.lb-who { white-space: pre; }
.lb-dots { flex: 1; border-bottom: 2px dotted #d9b200; margin: 0 2px 4px; }
/* Comic Neue (free, SIL Open Font License) - used for Crusty when Comic Sans isn't installed */
@font-face {
  font-family: "Comic Neue";
  src: url("game/jegg-balls/comic-neue.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Jegga Jegga page */
@font-face {
  font-family: "Nunito";
  src: url("game/jegga-jegga/nunito-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
#jj-wrap { max-width: 600px; margin: 0 auto; }
#jj-box {
  position: relative;
  border: 3px solid #f5c400;
  border-radius: 6px;
  overflow: hidden;
  background: #fffdf2;
}
#jj {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  touch-action: none;
  outline: none;
  cursor: crosshair;
}
#jj-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-bottom: 30px;
}
#jj-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  cursor: pointer;
}
#jj-msg {
  margin: 0;
  padding: 10px 24px;
  border: 1px solid #b38a00;
  border-radius: 6px;
  background: #ffffff;
  font: 900 22px Nunito, Arial, sans-serif;
}
#jj-levels { margin: 12px 0 0; }
#jj-levels .btn:disabled { opacity: .45; cursor: default; }

/* Bungus Quest page */
#bq-wrap { max-width: 640px; margin: 0 auto; }
#bq-box {
  position: relative;
  border: 3px solid #f5c400;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background: #000000;
}
#bq { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
#bq-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 26px;
}
#bq-panel {
  min-height: 132px;
  padding: 12px 14px 14px;
  border: 3px solid #f5c400;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
  cursor: default;
}
#bq-text { margin: 0 0 12px; min-height: 48px; font-size: 18px; font-weight: bold; line-height: 1.4; }
#bq-choices { display: flex; flex-wrap: wrap; gap: 8px; }
#bq-choices .btn { cursor: pointer; font-family: inherit; }

/* Jeggle page */
#jeggle { max-width: 520px; margin: 0 auto; }
.jeggle-title { margin: 0 0 8px; font-weight: bold; color: #555555; }
.jeggle-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jeggle-step {
  padding: 3px 10px;
  border: 1px solid #d9b300;
  border-radius: 12px;
  background: #ffffff;
  color: #8a7000;
  font-size: 13px;
  font-weight: bold;
}
.jeggle-step.here { background: #f5c400; color: #222222; border-color: #b38a00; }
.jeggle-step.done { background: #fff7c2; }
.jeggle-box {
  padding: 16px;
  border: 3px solid #f5c400;
  border-radius: 6px;
  background: #ffffff;
  text-align: center;
}
.jeggle-box > .btn.big { margin-top: 10px; }
.jeggle-q { margin: 0 0 12px; font-size: 19px; font-weight: bold; }
.jeggle-from { margin: -6px 0 12px; color: #666666; font-size: 13px; }
.jeggle-msg { min-height: 22px; margin: 10px 0 6px; font-weight: bold; }
.jeggle-board {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 52px));
  justify-content: center;
  gap: 5px;
}
.jeggle-tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d6d6d6;
  border-radius: 4px;
  background: #ffffff;
  font: bold 26px Arial, Helvetica, sans-serif;
  text-transform: uppercase;
}
.jeggle-tile.typed { border-color: #888888; }
.jeggle-tile.right, .jeggle-key.right { background: #3f9c35; border-color: #2f7a28; color: #ffffff; }
.jeggle-tile.close, .jeggle-key.close { background: #f5c400; border-color: #b38a00; color: #222222; }
.jeggle-tile.nope, .jeggle-key.nope { background: #8a8a8a; border-color: #6f6f6f; color: #ffffff; }
.jeggle-keys { margin-top: 6px; }
.jeggle-row { display: flex; justify-content: center; gap: 4px; margin-top: 5px; }
.jeggle-key {
  flex: 1 1 0;
  max-width: 42px;
  height: 46px;
  padding: 0;
  border: 1px solid #b38a00;
  border-radius: 5px;
  background: linear-gradient(to bottom, #fff7c2 0%, #ffe34d 45%, #f5c400 55%, #e0a800 100%);
  font: bold 15px Arial, Helvetica, sans-serif;
  color: #222222;
  cursor: pointer;
  touch-action: manipulation;
}
.jeggle-key.wide { max-width: 64px; flex-grow: 1.5; font-size: 13px; }
.jeggle-choices { display: flex; flex-direction: column; gap: 8px; max-width: 380px; margin: 0 auto; }
.jeggle-choice { font-size: 16px; padding: 10px 16px; }
.jeggle-choice:disabled { cursor: default; opacity: .55; }
.jeggle-choice.is-right, .jeggle-choice.is-right:disabled { opacity: 1; background: #3f9c35; border-color: #2f7a28; color: #ffffff; text-shadow: none; }
.jeggle-choice.is-wrong, .jeggle-choice.is-wrong:disabled { opacity: 1; background: #c0392b; border-color: #8e2a1f; color: #ffffff; text-shadow: none; }
.jeggle-big { margin: 0; font-size: 48px; font-weight: bold; }
.jeggle-lines { list-style: none; margin: 8px 0 14px; padding: 0; font-size: 17px; line-height: 1.8; }
.jeggle-fact {
  margin: 0 0 14px;
  padding: 12px;
  border: 2px dashed #d9b300;
  border-radius: 6px;
  background: #fffbe6;
  text-align: left;
}
.jeggle-score .links { justify-content: center; margin: 0 0 8px; }

/* the secret Bungus peeking out from behind the About Us photo */
.about-wrap { position: relative; max-width: 560px; margin-bottom: 24px; }
.about-wrap .about-pic { position: relative; z-index: 1; margin-bottom: 0; }
.bungus-peek {
  position: absolute;
  right: -28px;
  bottom: 34px;
  z-index: 0;
  width: 46px;
  transform: rotate(14deg);
  transition: transform .25s;
}
.bungus-peek img { width: 100%; }
.bungus-peek:hover, .bungus-peek:focus { transform: translateX(16px) rotate(22deg); }
@media (max-width: 640px) {
  .bungus-peek { right: -12px; width: 36px; }
}
