/* ========================
   Fonts
======================== */

@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap");

@font-face {
    font-family: 'Rajdhani';
    src: url('assets/fonts/Rajhani-Medium') format('ttf');
}

.rajdhani-light {
  font-family: "Rajdhani", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.rajdhani-regular {
  font-family: "Rajdhani", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.rajdhani-medium {
  font-family: "Rajdhani", sans-serif;
  font-weight: 500;
  font-style: normal;
}

.rajdhani-semibold {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  font-style: normal;
}

.rajdhani-bold {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-style: normal;
}

/* ========================
   General Styles
======================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #d8d8d8;
    color: rgb(228, 4, 4);
    font-family: 'Rajdhani', sans-serif !important;
    text-shadow: 2.3px 2.3px rgba(0, 0, 0, 0.5);
}

/* ========================
   Typography
======================== */
h1 {
    margin-bottom: 1px;
    padding: 0px;
    color: rgb(218, 253, 21);
    font-size: xxxx-large;
    font-weight: 700;
}

h3 {
    font-size: x-large;
}

h4 {
    font-size: large;
}

p, a {
    color: white;
    font-size: x-large;
    line-height: 1.5;
}

p {
    margin-bottom: 30px;
}

a {
    text-decoration: none;
}

a:hover, .here {
    text-decoration: underline;
    text-shadow: 0 0 1px #d3d3d3, 0 0 9px #acacac, 0 0 15px #a7a7a7;
}

.p-intro {
    font-size: 19px;
    margin: 8px auto;
    width: 60%;
    text-align: left;
}

.not-found {
    padding-top: 30px;
    font-size: xxx-large;
}

/* ========================
   Layout
======================== */
.section {
    margin-top: 50px;
}

.content {
    flex: 1;
    padding: 123px 0;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* ========================
   Background
======================== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* prefer explicit background-image when not using theme variables */
    background-image: url('assets/image/background/lake-jungle-bamboo-shader.jpeg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: blur(0.7px);
    transition: opacity 5s ease-in-out, background 800ms ease-in-out;
    opacity: 1;
}

.background-a {
  z-index: -2;
}

.background-b {
  z-index: -3;
}

/* theme helper classes for background + container + question */
.theme-sumo { /* warm orange theme */
    --quiz-bg: linear-gradient(135deg, #f5af19, #f12711);
    --quiz-foreground: rgba(0,0,0,0.45);
    --text-color: #ffffff;
}
.theme-bath { /* darker, fiery theme */
    --quiz-bg: linear-gradient(135deg, #1f1e1c, #f12711);
    --quiz-foreground: rgba(0,0,0,0.5);
    --text-color: #fffaf0;
}
.theme-karaoke { /* moody dark */
    --quiz-bg: linear-gradient(135deg, #1b1b2f, #3a3a6a);
    --quiz-foreground: rgba(0,0,0,0.65);
    --text-color: #e6eefc;
}

/* Start / End / Error unique themes */
.theme-start { --quiz-bg: linear-gradient(135deg, #2bffb0, #22c1c3); --text-color: rgb(255, 255, 255); }
.theme-end   { --quiz-bg: linear-gradient(135deg, #6a11cb, #2575fc); --text-color: #fff; }
.theme-error { --quiz-bg: repeating-linear-gradient(45deg,#ffb3b3 0 4px,#ffd9d9 4px 8px); --text-color: #5a0000; }

/* Apply theme to the big background */
.background.theme-sumo { background: url('assets/image/background/lake-jungle-bamboo-shader.jpeg') center/cover no-repeat, var(--quiz-bg); }
.background.theme-bath { background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.06), transparent 20%), var(--quiz-bg); }
.background.theme-karaoke { background: url('assets/image/background/night-sky.jpeg') center/cover no-repeat, var(--quiz-bg); }
.background.theme-start { background: linear-gradient(135deg,#4ef3c1,#22c1c3); }
.background.theme-end { background: linear-gradient(135deg,#6a11cb,#2575fc); }
.background.theme-error { background: var(--quiz-bg); }

/* ========================
   Nice container
======================== */
.nice-container {
    width: 60%;
    margin: 8px auto;
    padding: 22px;
    background-color: rgba(106, 102, 102, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 600ms ease-in-out, color 400ms ease-in-out, box-shadow 300ms;
    box-sizing: border-box;
    border-radius: 1px;
}

.nice-container-header {
    margin: 0 0 8px 0;
    text-align: left;
    font-size: x-large;
    line-height: 1.5;
    font-weight: 700;
    text-decoration: underline;
}

.nice-container-content {
    display: flex;
    align-items: flex-start;
}

.nice-container-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: x-large;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.nice-container-info p {
    margin: 2px 0;
    font-size: large;
    line-height: 1.5;
}

.mobile-not-available {
    display: none;
}

/* When theme classes are applied to the container, use the CSS variables */
.nice-container.theme-sumo,
.nice-container.theme-bath,
.nice-container.theme-karaoke,
.nice-container.theme-start,
.nice-container.theme-end,
.nice-container.theme-error {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12));
    border: 1px solid rgba(0,0,0,0.18);
    color: var(--text-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

/* ========================
   Screen & elements used by JS
======================== */
.screen { text-align: center; }

/* question area */
.question {
  font-size: 1.2em;
  margin-bottom: 15px;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  padding: 18px;
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
  transition: background 400ms ease-in-out, color 300ms;
  color: var(--text-color, #fff);
}

/* answers */
.answer {
  padding: 30px;
  margin: 8px 0;
  margin-top: 30px;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.18s, transform 0.12s;
  text-shadow: 1.3px 1.3px rgba(0, 0, 0, 0.5);
  color: var(--text-color, #fff);
  background: rgba(255,255,255,0.02);
}
.answer:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); }


.button, .next-btn {
  padding: 30px 20px;
  margin: 8px 0;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  transition: background-color 0.18s, transform 0.12s;
  text-shadow: 1.3px 1.3px rgba(0, 0, 0, 0.5);
  color: var(--text-color, azure);
  background: rgba(255,255,255,0.02);
  display: inline-block;
  text-decoration: none;
}

.button:hover, .next-btn:hover {
  background-color: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

/* Optional smaller / simple variants */
.button.small, .button--simple {
  padding: 10px 16px;
  margin-top: 12px;
  border: 1px solid #888;
  border-radius: 6px;
  display: inline-block;
}



 /*feedback & buttons 
.next-btn {
  margin-top: 20px;
  padding: 10px 20px;
  cursor: pointer;
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.button {
padding: 12px;
  margin: 8px 0;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.18s, transform 0.12s;
  text-shadow: 1.3px 1.3px rgba(0, 0, 0, 0.5);
  color: var(--text-color, azure);
  background: rgba(255,255,255,0.02);
}

 smaller general button style retained for places where original used it 
.button.small,
.button--simple {
  padding: 12px 20px;
  margin-top: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  cursor: pointer;
  display: inline-block;
}

.button:hover {
    background-color: rgba(51, 51, 51, 0.7);
    text-decoration: underline;
    text-shadow: 0 0 10px #fff, 0 0 20px #fff;
}

.button:hover, .next-btn:hover {
  background-color: rgba(255,255,255,0.06);
  text-decoration: none;
}*/

/* feedback styles */
.feedback.correct { color: #0a7b0a; }
.feedback.wrong { color: #9b0a0a; }

/* start / end / error screen cosmetics */
.screen--start .question { font-size: 1.3rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(0,0,0,0.15); }
.screen--end .question   { font-size: 1.25rem; background: rgba(0,0,0,0.12); color: #fff; }
.screen--error .question { font-size: 1.1rem; background: rgba(255,255,255,0.02); color: var(--text-color); border: 2px dashed rgba(0,0,0,0.1); }

/* ========================
   Top Bar
======================== */
.top-bar {
    background-color: #333;
    color: white;
    padding: 1px 11px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 3.9rem;
    font-size: 1.3rem;
    z-index: 9999;
    box-sizing: border-box;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

.left-content,
.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-bar a {
    color: white;
    padding: 0 15px;
}

.top-bar a:hover {
    border-radius: 4px;
}

/* ========================
   Bottom Bar
======================== */
footer {
    width: 100vw;
    background-color: #333;
    color: white;
    padding: 15px;
    text-align: left;
    font-size: 2vh;
    box-sizing: border-box;
    box-shadow: 0 -3px 5px rgba(0, 0, 0, 0.2);
}
footer p {
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    margin-left: 16px;
    padding-left: 16px;
}

/* ========================
   Buttons container
======================== */
.button-container {
    padding: 30px;
}

/* ========================
   Images
======================== */
.img-logo {
    width: auto;
    height: 150px;
    margin: 1px auto;
    max-width: 100%;
    image-rendering: pixelated;
}

.server-icon {
    width: auto;
    height: 100px;
    flex-shrink: 0;
    border-radius: 0;
    box-shadow: none;
    image-rendering: crisp-edges;
}

.img-media {
    width: 20vh;
}

.logo {
    height: 50px;
    margin-right: 11px;
    margin-top: 11px;
    image-rendering: pixelated;
}

/* ========================
   Hamburger Menu
======================== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 1px 11px;
    cursor: pointer;
    text-shadow: 0 5px 5px rgba(0, 0, 0, 0.4);
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.4);
}

.hamburger:hover div {
    box-shadow: 0 0 10px #fff, 0 0 20px #fff;
}

/* ========================
   Mobile Styles
======================== */
@media (max-width: 768px) {
    .top-bar {
        justify-content: space-between;
        height: 4.125rem;
    }

    .p-intro {
        width: 80%;
        text-align: justify;
        text-justify: initial;
        hyphens: auto;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        background-color: #333;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100vw;
        padding: 10px 0;
    }

    .nav-links a {
        padding: 10px 20px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links.open {
        display: flex;
    }

    .divider {
        display: none;
    }

    .img-logo {
        width: 90%;
        height: auto;
        margin: 1px auto;
        max-width: 100%;
        image-rendering: pixelated;
    }

    .nice-container {
        width: 80%;
        padding: 16px;
    }

    .nice-container-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nice-container-header {
        margin: 0 0 8px 0;
        text-align: center;
        text-decoration: underline;
        margin-bottom: 24px;
    }

    .server-icon {
        margin-bottom: 10px;
    }

    .nice-container-info {
        margin-left: 0;
        border-left: none;
        align-items: left;
    }

    .nice-container-content a {
        margin-left: 0 !important;
        margin-top: 24px;
        align-self: center;
    }

    /* Re-use earlier mobile tweaks from original first file */
    .img-logo { height: auto; }
}


/* ========================
Memory Game Specific
======================== */

.mg-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px 40px;
  width: 90%;
  box-sizing: border-box;
}

.mg-hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  width: 80%;
  max-width: 680px;
  padding: 14px 24px !important;
}

.mg-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mg-hud-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  color: var(--text-color, #e0e0e0);
}

.mg-hud-value {
  font-size: 1.55rem;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  color: rgb(218,253,21);
  text-shadow: 0 0 8px rgba(218,253,21,0.5);
  line-height: 1;
}

.mg-restart-btn {
  margin-left: auto;
  font-size: 0.95rem !important;
  padding: 10px 18px !important;
}

.mg-reveal-btn {
  font-size: 0.95rem !important;
  padding: 10px 18px !important;
  opacity: 0.6;
  border-color: rgba(255,255,255,0.15) !important;
}

.mg-reveal-btn:hover:not(:disabled) { opacity: 1; }

.mg-reveal-btn:disabled {
  cursor: default;
  opacity: 0.9;
  color: rgb(218,253,21) !important;
  border-color: rgba(218,253,21,0.4) !important;
  transform: none !important;
}

.mg-revealing .mg-card:not(.mg-matched) .mg-card-inner {
  transform: rotateY(180deg);
}

.mg-grid {
  display: grid;
  gap: 5px;
  width: 80%;
  max-width: 80%;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 1;
}

.mg-card {
  all: unset;
  display: block;
  box-sizing: border-box;
  aspect-ratio: 1;
  perspective: 800px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mg-card:hover:not(.mg-matched) {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

.mg-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.46s cubic-bezier(0.4, 0, 0.2, 1);
}

.mg-flipped .mg-card-inner,
.mg-matched .mg-card-inner {
  transform: rotateY(180deg);
}

.mg-card-back,
.mg-card-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mg-card-back {
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.12);
}

.mg-card--name .mg-card-back { border-color: rgba(218,253,21,0.2); }
.mg-card--image .mg-card-back { border-color: rgba(255,255,255,0.1); }

.mg-card-back-icon {
  font-size: 2rem;
  font-weight: 900;
  font-family: 'Rajdhani', sans-serif;
  color: rgba(255,255,255,0.3);
  user-select: none;
}

.mg-card-front {
  transform: rotateY(180deg);
  border: 2px solid rgba(255,255,255,0.22);
}

.mg-card-front--name {
  padding: 12px;
}

.mg-name-label {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.2vw, 1.25rem);
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
  word-break: break-word;
}

.mg-card-front--image {
  padding: 0;
  overflow: hidden;
}

.mg-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.mg-flipped .mg-card-img,
.mg-matched .mg-card-img {
  transform: scale(1.04);
}

.mg-img-error {
  background: rgba(255,255,255,0.06) !important;
  font-size: 2rem;
  color: rgba(255,255,255,0.5);
}

.mg-matched .mg-card-front {
  border-color: rgba(218,253,21,0.6);
  box-shadow: 0 0 18px rgba(218,253,21,0.35);
}

.mg-matched .mg-card-front--name {
  background-color: rgba(218,253,21,0.2) !important;
}

.mg-win-banner {
  width: 90%;
  max-width: 480px;
  justify-content: center !important;
  padding: 32px 24px !important;
  animation: mg-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.mg-win-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mg-win-trophy {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.mg-win-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: rgb(218,253,21);
  text-shadow: 0 0 12px rgba(218,253,21,0.6);
}

.mg-win-stats {
  margin: 0 !important;
  font-size: 1rem;
  opacity: 0.85;
  color: rgba(255,255,255,0.9) !important;
}

@keyframes mg-pop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .mg-grid {
    gap: 4px;
    width: 96%;
    max-width: 96%;
  }
  .mg-hud { width: 96%; gap: 16px; padding: 12px 14px !important; }
  .mg-restart-btn { margin-left: 0; width: 100%; text-align: center; }
}