html {
  height: 100%;
}
body {
  background-color: #e7e6e6;
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

#header-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: linear-gradient(45deg, #0798ab99, transparent);
}

#header-wrapper h1 {
  margin: 5px 0;
}
#header-wrapper h2 {
  margin: 5px 0;
}
#header-info {
  flex: 1;
}

#my-picture {
  padding: 5px;
  width: 108px;
  height: 108px;
}
#my-picture img {
  border-radius: 50%;
  border: 4px solid #fff;
}

#content {
  flex: 1;
  display: flex;
  flex-direction: row;
}

#side-menu {
  flex: 1;
  padding: 10px 5px 5px 10px;
}
#side-menu > section {
  margin-bottom: 10px;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.15),
    0 2px 3px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}
#side-menu > section h2 {
  margin: 0 0 10px 0;
}

#skills li span {
  color: #057988;
}

#main {
  flex: 2;
  padding: 10px 10px 10px 5px;
}

footer {
  padding: 10px 10px 8px 10px;
  text-align: center;
  background-color: #057988;
  color: #f5f5f5;
}
footer a {
  color: #f5f5f5;
}

.page {
  display: none;
  padding: 24px;
  background: #fff;
  margin-bottom: 10px;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 15%),
    0 2px 3px rgb(0 0 0 / 20%);
  border-radius: 2px;
}
.page h2 {
  margin: 0;
}

.favorite {
  color: red;
}

.wow {
  color: blue;
  font-weight: bold;
}

#top-menu-bar {
  margin: 0;
  padding: 0;
  text-align: center;
  background-color: #0798ab;
  color: #fff;
}
#top-menu-bar li {
  display: inline;
  padding: 0;
  margin: 0;
}
#top-menu-bar a {
  text-decoration: none;
  padding: 0 15px 0 15px;
  margin: 4px 0;
  color: #fff;
  display: inline-block;
  border-radius: 0.2em;
  transition: 0.5s;
}
#top-menu-bar a:visited {
  color: #fff;
}
#top-menu-bar a:hover,
#top-menu-bar a.active {
  background-color: #057988;
  color: #fff;
}

.rubick-face {
  background-color: #0d0d0d;
  display: grid;
  grid-template-columns: auto auto auto;
  max-width: 200px;
  padding: 4px;
  grid-gap: 4px;
}
.rubick-face > div {
  border: 1px solid #0d0d0d33;
  padding-top: 100%;
  background-color: white;
  border-radius: 0.3em;
}

@media (max-width: 600px) {
  #content {
    flex-direction: column-reverse;
  }
}

/* Snake game styles */
#snake-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#snake-controls {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}
#snake-score {
  font-weight: bold;
}
#snake-canvas {
  background: #0b3b0b;
  border: 2px solid #074d07;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  height: auto;
}

#snake-canvas {
  border-radius: 8px;
  image-rendering: pixelated; /* keeps squares crisp if scaled */
  overflow: hidden;
}

/* disable default touch-based scrolling when interacting with the canvas */
#snake-canvas {
  touch-action: none;
  -ms-touch-action: none;
  -webkit-user-drag: none;
}

/* Orar (schedule) day label to the right */
#orar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
#orar {
  /* keep space for the circle-slices widget */
  width: 360px;
  height: 360px;
}
#orar-day {
  min-width: 90px;
  padding: 12px 14px;
  background: #f5f5f5;
  color: #073b5a;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  text-align: center;
  font-size: 1.15rem;
}
.muted {
  color: #666;
  font-size: 0.9em;
}

/* Mobile controls for snake (visible on small screens) */
#snake-mobile-controls {
  display: none; /* default hidden on desktop */
  margin-top: 10px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#snake-mobile-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999; /* ensure controls sit above other elements on mobile */
  padding-bottom: env(safe-area-inset-bottom, 12px);
}
#snake-mobile-controls .mobile-row {
  /* arrange the three buttons like keyboard arrows: left - down - right */
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 12px;
  margin-top: 8px;
  justify-content: center;
  align-items: center;
}
.mobile-dir {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  background: #39d13b;
  color: #003200;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.mobile-dir {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.mobile-dir:active {
  transform: scale(0.96);
}

@media (max-width: 800px) {
  #snake-canvas {
    width: 320px;
    height: 320px;
  }
  #snake-mobile-controls {
    display: flex;
  }
}

@media (max-width: 420px) {
  #snake-canvas {
    width: 260px;
    height: 260px;
  }
  .mobile-dir {
    width: 52px;
    height: 52px;
    font-size: 1rem;
  }
  #snake-mobile-controls .mobile-row {
    grid-template-columns: 48px 48px 48px;
    gap: 8px;
  }
}
