/*
Author: Antonio Corona
Date: 2026-03-30

Stylesheet

Defines styling for the web games.
*/

/* =========================================================
   GLOBAL PAGE STYLES
   ---------------------------------------------------------
   These rules apply across the overall site unless a more
   specific game section overrides them.
   ========================================================= */

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

/* Navigation buttons such as Home Page / Rules */
.nav-buttons {
  /* Places buttons on one row */
  display: flex;

  /* Centers the group horizontally */
  justify-content: center;

  /* Adds spacing between buttons */
  gap: 15px;

  /* Adds space above the button group */
  margin-top: 20px;
}


/* =========================================================
   HOMEPAGE / LANDING PAGE
   ---------------------------------------------------------
   Styles for the redesigned project homepage. These rules
   create a cleaner portfolio-style first impression and
   organize the project into clear sections.
   ========================================================= */

.site-header {
  padding: 80px 20px 48px;
}

.site-header__content {
  max-width: 900px;
  margin: 0 auto;
}

.site-header__eyebrow {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4338ca;
  margin-bottom: 16px;
}

.site-header__title {
  font-size: 3rem;
  margin-bottom: 16px;
}

.site-header__subtitle {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-link-button,
.secondary-link-button,
.card-link-button {
  display: inline-block;
  text-decoration: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-link-button,
.card-link-button {
  background-color: #2563eb;
  color: #ffffff;
}

.secondary-link-button {
  background-color: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.primary-link-button:hover,
.secondary-link-button:hover,
.card-link-button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

button:focus-visible,
.primary-link-button:focus-visible,
.secondary-link-button:focus-visible,
.card-link-button:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.highlights-section,
.homepage-main,
.site-footer {
  padding-left: 20px;
  padding-right: 20px;
}

.highlights-grid,
.games-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.highlights-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 48px;
}

.highlight-card,
.game-card,
.tech-section {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.highlight-card {
  padding: 24px;
  text-align: left;
}

.homepage-main {
  padding-bottom: 48px;
}

.games-section {
  max-width: 1100px;
  margin: 0 auto 48px;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 28px;
}

.section-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4338ca;
  margin-bottom: 12px;
}

.games-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.game-card__content {
  padding: 28px;
}

.game-card__tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.game-card__features {
  padding-left: 18px;
  margin-bottom: 20px;
  color: #374151;
}

.tech-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px;
}

.tech-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tech-pill {
  background: #e0e7ff;
  color: #312e81;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.site-footer {
  padding-bottom: 32px;
  color: #4b5563;
}

@media (max-width: 768px) {
  .site-header__title {
    font-size: 2.2rem;
  }

  .site-header__subtitle {
    font-size: 1rem;
  }
}


/* =========================================================
   HOMEPAGE GAME CARD THUMBNAILS
   ---------------------------------------------------------
   These styles define the visual presentation of preview
   images displayed at the top of each homepage game card.
   The thumbnails help the landing page feel more polished
   and product-like for portfolio viewers.
   ========================================================= */

.game-card__thumbnail {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: #e5e7eb;
}


/* =========================================================
   CLICKABLE HOMEPAGE GAME CARDS
   ---------------------------------------------------------
   These styles allow each homepage game card to function as
   a full clickable link while preserving the visual card
   design. Hover and focus states provide stronger visual
   feedback and a more polished portfolio presentation.
   ========================================================= */

.game-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
}

.game-card {
  text-align: left;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/*
  Lift and shadow effect on hover
  -------------------------------
  Mirrors the polished hover behavior used in more refined
  portfolio card layouts. The card subtly rises and casts
  a stronger shadow to reinforce interactivity.
*/
.game-card-link:hover .game-card,
.game-card-link:focus-visible .game-card {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

/*
  Slight image zoom on hover
  --------------------------
  Adds motion to the preview thumbnail while keeping the
  card layout stable. The overflow-hidden thumbnail wrapper
  prevents the zoomed image from spilling outside the card.
*/
.game-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.game-card-link:hover .game-card__image,
.game-card-link:focus-visible .game-card__image {
  transform: scale(1.05);
}

/*
  Visible keyboard-focus state for accessibility
  ----------------------------------------------
  Ensures keyboard users can clearly identify which card is
  currently focused.
*/
.game-card-link:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 4px;
}


/* =========================================================
   SHARED INTERIOR PAGE LAYOUT
   ---------------------------------------------------------
   These styles define the common shell used across the game
   pages so the project feels like one cohesive web app
   instead of separate standalone pages.
   ========================================================= */

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-shell--morris {
  background: #D2C7A7;
  color: #ffffff;
}

.site-subheader {
  padding: 24px 20px 12px;
  border-bottom: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.site-subheader__content {
  max-width: 1100px;
  margin: 0 auto;
}

.site-subheader__eyebrow {
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4338ca;
}

.site-subheader__title {
  margin-bottom: 8px;
  font-size: 2rem;
}

.site-subheader__description {
  max-width: 760px;
  margin: 0 auto;
  color: #4b5563;
  line-height: 1.6;
}

.page-main {
  flex: 1;
  padding: 32px 20px 32px;
}

.page-main__content {
  max-width: 1100px;
  margin: 0 auto;
}

.page-footer {
  padding: 20px;
  text-align: center;
  color: #6b7280;
}

.page-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}


/* =========================================================
   DOCUMENT / PDF VIEWER PAGE
   ---------------------------------------------------------
   These styles support pages that embed reference documents
   such as rules PDFs within the shared project layout.
   ========================================================= */

.document-viewer-section {
  max-width: 1100px;
  margin: 0 auto;
}

.document-viewer-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  padding: 24px;
}

.document-viewer-description {
  color: #4b5563;
  margin-bottom: 16px;
}

.document-viewer-frame {
  width: 100%;
  min-height: 780px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
}


/* =========================================================
   MORRIS HEADER THEME (EARTH-TONED DESIGN)
   ---------------------------------------------------------
   Overrides the default header styling to match the warm,
   neutral color palette used by the Nine Men's Morris board.
   This creates a cohesive visual identity across the page.
   ========================================================= */

.page-shell--morris .site-subheader {
  /* Match board background for visual consistency */
  background: #E6DFC8;

  /* Subtle border to separate header from game area */
  border-bottom: 1px solid #C8BFA6;
}

.page-shell--morris .site-subheader__title {
  /* Strong readable heading using board line color */
  color: #2b1b12;
}

.page-shell--morris .site-subheader__eyebrow {
  /* Muted accent tone instead of bright blue */
  color: #7A6A58;
}

.page-shell--morris .site-subheader__description {
  /* Softer supporting text color */
  color: #5C4B3B;
}

.page-shell--morris .site-subheader {
  background: #E6DFC8;
  border-bottom: 1px solid #C8BFA6;

  /* Subtle depth effect */
  box-shadow: 0 2px 8px rgba(43, 27, 18, 0.08);
}


/* =========================================================
   MORRIS FOOTER THEME
   ---------------------------------------------------------
   Aligns the footer styling with the warm, neutral palette
   used throughout the Nine Men's Morris page.
   ========================================================= */

.page-shell--morris .page-footer {
  /* Match header + board for full-page consistency */
  background: #E6DFC8;

  /* Soft readable text color */
  color: #5C4B3B;

  /* Subtle separation from main content */
  border-top: 1px solid #C8BFA6;

  /* Adds breathing room */
  padding: 20px;

  /* Optional: slight depth for polish */
  box-shadow: 0 -2px 8px rgba(43, 27, 18, 0.06);
}


/* =========================================================
   PERSISTENT STATS PANEL
   ---------------------------------------------------------
   Shared card-like panel used to display saved performance
   or match-history statistics across game pages.
   ========================================================= */

.stats-panel {
  margin: 20px 0;
  padding: 18px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  display: inline-block;
  min-width: 220px;
}

.stats-panel h2 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}


/* =========================================================
   MEMORY GAME
   ---------------------------------------------------------
   Styles for the memory card game layout, card appearance,
   and overall board/container alignment.
   ========================================================= */

/* Main board that holds all memory cards */
.game-board {
  /* Uses CSS Grid to arrange cards in rows and columns */
  display: grid;

  /* Creates 4 fixed-width columns for the card layout */
  grid-template-columns: repeat(4, 120px);

  /* Adds spacing between rows and columns */
  gap: 12px;
}

/* Individual memory card container */
.card {
  /* Fixed card width */
  width: 120px;

  /* Fixed card height */
  height: 160px;

  /* Rounds card corners */
  border-radius: 10px;

  /* Shows pointer cursor to indicate interactivity */
  cursor: pointer;

  /* Prevents accidental text/image selection while clicking */
  user-select: none;

  /* Hides anything that extends outside the rounded edges */
  overflow: hidden;

  /* Adds a subtle shadow for depth */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* States for cards that should no longer appear clickable */
.card.revealed,
.card.matched {
  /* Returns cursor to default once interaction is no longer needed */
  cursor: default;
}

/* Image inside each memory card */
.card img {
  /* Makes image fill the full card width */
  width: 100%;

  /* Makes image fill the full card height */
  height: 100%;

  /* Ensures image covers the card without distortion */
  object-fit: cover;

  /* Removes inline spacing issues from images */
  display: block;

  /* Prevents the image itself from intercepting click events */
  pointer-events: none;

  /* Matches image corners to card rounding */
  border-radius: 10px;
}

/* Wrapper that centers the memory game on the page */
.game-container {
  /* Uses flexbox for vertical layout */
  display: flex;

  /* Stacks child elements vertically */
  flex-direction: column;

  /* Centers children horizontally */
  align-items: center;

  /* Centers children vertically */
  justify-content: center;

  /* Gives the container enough height to center content nicely */
  min-height: 80vh;
}


/* =========================================================
   MEMORY GAME CARD FLIP ANIMATION
   ---------------------------------------------------------
   These styles convert each memory card into a two-sided
   flipping element. The revealed state rotates the inner
   wrapper to show the card face instead of the card back.
   ========================================================= */

.card {
  width: 120px;
  height: 160px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  perspective: 1000px;
  padding: 0;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s ease;
  transform-style: preserve-3d;
}

.card.revealed .card__inner,
.card.matched .card__inner {
  transform: rotateY(180deg);
}

.card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.card__face--front {
  transform: rotateY(180deg);
}

.card__face--back {
  transform: rotateY(0deg);
}

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


/* =========================================================
   MEMORY GAME WIN MODAL
   ---------------------------------------------------------
   Displays a centered overlay when the user completes the
   game, replacing the browser alert with a more polished UI.
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}


/* =========================================================
   NINE MEN'S MORRIS
   ---------------------------------------------------------
   Styles for the Nine Men's Morris game board, board lines,
   points, pieces, and game status text.
   ========================================================= */

/* Main page wrapper for the Nine Men's Morris game */
.nine-man-morris {
  /* Dark background specific to this game page */
  background: transparent;

  /* White text for contrast */
  color: #2f241b; /*#fff;*/

  /* Uses flexbox for page alignment */
  display: flex;

  /* Stacks content vertically */
  flex-direction: column;

  /* Centers content horizontally */
  align-items: center;

  /* Centers content vertically */
  justify-content: flex-start;

  /* Makes the game take up the full viewport height */
  min-height: auto;

  /* Sets font for this section */
  font-family: sans-serif;
}

/* Heading spacing for the Nine Men's Morris page */
.nine-man-morris h1 {
  /* Space below the title before the board begins */
  margin-bottom: 20px;
}

/* Main board container */
.nineBoard {
  /* Dark background specific to this game page */
  background: #E6DFC8; /*transparent;*/

  /* Allows child elements to be absolutely positioned relative to the board */
  position: relative;

  /* Fixed board width */
  width: 500px;

  /* Fixed board height */
  height: 500px;

  /* Outer border of the board */
  border: 2px solid transparent; /*#2b1b12;*/

  border-radius: 12px;
}

.nine-man-morris .nineBoard {
  margin-top: 12px;
}

/* Nested board squares */
.square {
  /* Allows each square to be placed exactly on the board */
  position: absolute;

  /* White square outlines */
  border: 2px solid #2b1b12;

  /* Centers each square based on its top/left coordinates */
  transform: translate(-50%, -50%);
}

/* Outer square */
.outer {
  width: 90%;
  height: 90%;
  top: 50%;
  left: 50%;
}

/* Middle square */
.middle {
  width: 60%;
  height: 60%;
  top: 50%;
  left: 50%;
}

/* Inner square */
.inner {
  width: 30%;
  height: 30%;
  top: 50%;
  left: 50%;
}

/* Board connector lines */
.line {
  /* Positioned relative to the board */
  position: absolute;

  /* White line color */
  background: #2b1b12;
}

/* Horizontal connector line */
.horizontal {
  height: 2px;
  width: 90%;
  top: 50%;
  left: 5%;
}

/* Vertical connector line */
.vertical {
  width: 2px;
  height: 90%;
  top: 5%;
  left: 50%;
}

/* Interactive board points where pieces can be placed */
.point {
  /* Removes default button styling completely */
  all: unset;

  /* Allows exact placement on the board */
  position: absolute;

  /* Point width */
  width: 16px;

  /* Point height */
  height: 16px;

  /* Default empty-point color */
  background: #937b6d;

  /* Makes the point circular */
  border-radius: 50%;

  /* Centers point on its coordinates */
  transform: translate(-50%, -50%);

  /* Indicates the point can be clicked */
  cursor: pointer;
}

/* Hover state for available board points */
.point:hover {
  /* Highlights the point when hovered */
  background: #0f0;
}

/* White player's pieces */
.point.white {
  background: #fff;
}

/* Black player's pieces */
.point.black {
  background: #000;
}

/* Game status text below the board */
#status {
  margin-top: 20px;
  font-size: 1.2em;
  font-weight: 600;

  color: #2b1b12;

  /* Subtle background badge effect */
  background: #E6DFC8;
  padding: 8px 16px;
  border-radius: 10px;

  /* Soft border for separation */
  border: 1px solid #C8BFA6;

  display: inline-block;
}

/* =========================================================
   ROCK PAPER SCISSORS LIZARD SPOCK
   ---------------------------------------------------------
   Styles for the RPSLS game layout, controls, scoreboard,
   and navigation buttons.
   ========================================================= */

/* Main wrapper for the RPSLS page */
.spock {
  /* Uses Arial for this specific game section */
  font-family: Arial, sans-serif;

  /* Uses flexbox to center the game container */
  display: flex;

  /* Centers horizontally */
  justify-content: center;

  /* Centers vertically */
  align-items: flex-start;

  /* Full viewport height */
  min-height: 100vh;

  padding: 100px 20px 40px;
  box-sizing: border-box;
}

/* Central content box for the RPSLS game */
.container {
  /* Centers text inside the container */
  text-align: center;

  /* White card-style background */
  background-color: #fff;

  /* Inner spacing */
  padding: 2rem;

  /* Rounded container corners */
  border-radius: 10px;

  /* Soft shadow around the container */
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);

  width: min(900px, 100%);
}

/* General button styling */
button {
  /* Vertical and horizontal padding */
  padding: 0.5rem 1rem;

  /* Space around each button */
  margin: 0.5rem;

  /* Standard readable font size */
  font-size: 1rem;

  /* Pointer cursor on hover */
  cursor: pointer;

  /* Removes default border */
  border: none;

  /* Slight rounding for a modern look */
  border-radius: 5px;

  /* Primary blue background */
  background-color: #007bff;

  /* White text for contrast */
  color: #fff;

  /* Smooth hover transition */
  transition: background-color 0.2s;
}

/* General button hover state */
button:hover {
  /* Darker blue on hover */
  background-color: #0056b3;
}

/* Displays round-by-round result text */
#round-result {
  /* Space above the result text */
  margin-top: 1rem;

  /* Makes the result more prominent */
  font-size: 1.2rem;

  /* Boldens the result text */
  font-weight: bold;
}

/* Basic spacing for the scoreboard section */
#scoreboard {
  margin-top: 0.5rem;
}

/* Outer scoreboard wrapper */
.scoreboard {
  /* Uses flexbox for alignment */
  display: flex;

  /* Centers scoreboard content horizontally */
  justify-content: center;

  /* Adds space above the scoreboard */
  margin-top: 20px;
}

/* Main scoreboard panel */
.scoreboard .scoreboard_container {
  /* Uses flexbox to align score sections */
  display: flex;

  /* Evenly distributes scoreboard items */
  justify-content: space-evenly;

  /* Vertically aligns items in the panel */
  align-items: center;

  /* Responsive width */
  width: 80%;

  /* Prevents scoreboard from growing too wide */
  max-width: 700px;

  /* Inner spacing */
  padding: 1.5rem;

  /* Thick outer border */
  border: 5px solid black;

  /* Rounded corners */
  border-radius: 12px;

  /* Background color for the scoreboard panel */
  background: #4354ac;

  /* Centers the panel */
  margin: 0 auto;
}

/* Scoreboard labels/headings */
.scoreboard h3 {
  /* Centers heading text */
  text-align: center;

  /* White text for visibility */
  color: white;
}

/* Score numbers/title styling */
.scoreboard h2 {
  /* Uses custom digital-style font if available */
  font-family: "Cursed Timer ULiL";
}

/* Numeric score display box */
.scoreboard .scoreboard_score {
  /* Dark background for scoreboard number box */
  background: #0a0001;

  /* Large score text */
  font-size: 90px;

  /* Bright score color for contrast */
  color: #f94f6d;

  /* Fixed width for consistent alignment */
  width: 120px;

  /* Outer spacing */
  margin: 20px;

  /* Inner spacing */
  padding: 15px;

  /* Centers the score number text */
  text-align: center;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

/* Circular image-based choice buttons */
.choice-button {
  /* Fixed width */
  width: 100px;

  /* Fixed height */
  height: 100px;

  /* Makes the button circular */
  border-radius: 50%;

  /* Indicates interactivity */
  cursor: pointer;

  /* Space around each choice button */
  margin: 0.5rem;

  /* Blue border around each choice */
  border: 3px solid #007bff;

  /* Smooth hover effects */
  transition: transform 0.2s, border-color 0.2s;
}

/* Hover effect for choice buttons */
.choice-button:hover {
  /* Slightly enlarges the button */
  transform: scale(1.1);

  /* Darkens the border on hover */
  border-color: #0056b3;
}
