/*Main Font*/

@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,100..900;1,100..900&family=Cinzel:wght@400..900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/*Title / H1 Font*/

@font-face {
    font-family: 'Mantinia';
    src: url('../fonts/Mantinia.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/*Main Body & Header Styling*/

html, body {
    min-height: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cinzel', serif;
    background-color: #111;
    color: #eee;
    margin: 0;
    padding: 0px;
    background-image: url('../images/areas/bonfire.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    min-height: 100%;
    height:auto;
}

/* Override for class selector page to use video */
body.home-page {
    background: none; /* Remove static background */
    overflow: auto;       /* allow scroll */
}

/* Video fills viewport responsively */
body.home-page #bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;   /* Full viewport width */
    height: 100vh;  /* Full viewport height */
    object-fit: cover; /* Crop while keeping aspect ratio */
    z-index: -1;    /* Behind all content */
    pointer-events: none;  /* don’t block scrolling/taps */
}

/* Keep your content readable */
body.home-page .content {
    position: relative;
    z-index: 1;
}

/* Rest override */
body.rest-bg {
  background-image: url('../images/areas/firelink.jpg'); /* the rest image */
}

h1, h2 {
    text-shadow: 2px 2px 4px #000;
}

h1 {
    font-family: 'Mantinia', 'Cinzel', serif;
    font-size: 5rem;
}

h2 {
    font-size: 2rem;
}

/*CSS for battle info & image background*/

span {
    text-transform: uppercase;
    font-weight: bold;
}

.battle-info {
    text-shadow: 0 0 6px #000, 2px 2px 10px #000;
    color: #f8f8f8;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0.2rem;
}

.bonfire-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.icon-shadow {
    width: 100px;
    height: 100px;
    vertical-align: middle;
    margin-right: 1px;
    filter: drop-shadow(4px 4px 10px grey);
}

.icon-shadow:hover {
    transform: scale(1.1);
    transition: 0.2s ease;
}

/*CSS for buttons & progress bar*/

button {
    margin: 5px;
    padding: 10px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    background-image: url(../images/icons/menu.PNG);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

button:hover {
    background-color: crimson;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
    cursor: pointer;
}

progress {
    width: 50%;
    height: 20px;
}

/*CSS  for rest flash in game.html*/

.flash-container {
    position: relative;
    margin: 20px auto;
    max-width: 800px;
    text-align: center;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: fadeOut 5s forwards;
}

.flash-message.info {
    background-color: #222;
    color: #ffc107; /* bonfire-like gold */
    border: 1px solid #555;
    box-shadow: 0 0 8px #ffa50088;
}

@keyframes fadeOut {
    0%   { opacity: 1; }
    90%  { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Bonfire Flicker Overlay */
.bonfire-pulse {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(255, 180, 50, 0.3), rgba(255, 90, 0, 0.15), transparent);
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    animation: none;
}

.bonfire-pulse.active {
    animation: fireFlicker 2.2s ease-out forwards;
}

@keyframes fireFlicker {
    0% {
        opacity: 0.7;
        transform: scale(1);
        filter: brightness(1.4) blur(2px);
    }
    15% {
        opacity: 0.5;
        transform: scale(1.02);
        filter: brightness(1.6) blur(3px);
    }
    30% {
        opacity: 0.65;
        transform: scale(1.01);
        filter: brightness(1.3) blur(1px);
    }
    45% {
        opacity: 0.4;
        transform: scale(1.03);
        filter: brightness(1.7) blur(4px);
    }
    60% {
        opacity: 0.6;
        transform: scale(1.015);
        filter: brightness(1.5) blur(2px);
    }
    75% {
        opacity: 0.3;
        transform: scale(1.025);
        filter: brightness(1.2) blur(3px);
    }
    90% {
        opacity: 0.45;
        transform: scale(1.01);
        filter: brightness(1.4) blur(1.5px);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
        filter: brightness(1) blur(0px);
    }
}

/* Bonfire flicker with image overlay */
.bonfire-pulse::after {
  content: "";
  position: absolute;
  inset: 0;             /* center in viewport (because parent is fixed) */
  margin: auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background: url("../images/icons/flame.png") no-repeat center / contain;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  filter: drop-shadow(0 0 12px rgba(255,140,0,0.35));
}

/* Pulse the image in sync with the overlay */
.bonfire-pulse.active::after {
  animation: sigilPulse 4s ease-out forwards;
}

/* Gentle opacity/scale pulse to match fireFlicker timing beats */
@keyframes sigilPulse {
  0%   { opacity: 0.6; transform: scale(1.00); }
  25%  { opacity: 0.4; transform: scale(1.03); }
  50%  { opacity: 0.2; transform: scale(1.06); }
  75%  { opacity: 0.1; transform: scale(1.08); }
  100% { opacity: 0;    transform: scale(1.10); }
}


/*CSS for Lore Box*/

.lore-box {
    background-color: rgba(0,0,0,0.8);
    padding: 10px 10px;
    margin: 10px 0px;
    border: 2px solid #444;
    border-radius: 10px;
    width: 50%;
}

/* For class image in game.html*/

.class-image {
  width: 160px;
  height: auto;
  filter: drop-shadow(2px 2px 6px whitesmoke);
}

/* Save/Load/Return css*/

a {
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

.center-links,
.menu {
    text-align: center;
    margin-top: 20px;
}

/*Enemy Img/Lore CSS*/

.enemy-img {
  max-width: 400px;
  height: auto;
  border: 2px solid #444;
  border-radius: 12px;
  box-shadow: 0 0 10px black;
  margin-bottom: 0.5rem;
}

.enemy-lore {
  max-width: 600px;
  font-style: italic;
  margin: 0 auto;
  color: whitesmoke;
  text-shadow: 4px 4px 8px #000;
  background-image: url('../images/icons/menu.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  padding: 10px 10px;
}

/* Play/Pause Controls*/

.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* CSS Class Selector Styling */

.class-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 20px;
}

.class-options-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.begin-journey {
    font-size: 1.2rem;
    font-family: 'Mantinia', 'Cinzel', serif;
}

.class-lore {
    font-style: italic;
    font-size: 0.9rem;
}

.class-option {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border: 2px solid #444;
    border-radius: 8px;
    text-align: center;
    width: 200px;
    transition: border 0.3s, transform 0.3s;
    box-shadow: 2px 2px 10px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
}

.class-option:hover {
    border-color: gold;
    transform: scale(1.05);
}

.class-option input[type="radio"] {
    display: none;
}

.class-option img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem;
    filter: drop-shadow(0 0 5px #000);
}

.class-option span {
    display: block;
    margin-top: 0.5rem;
    color: #eee;
}

/*Check specificity here*/

.class-stats {
    font-size: 0.8rem;
    margin: 1rem 0;
    line-height: 1.4;
}

/* CSS highlighting selected class visually */

.class-option input[type="radio"]:checked ~ img,
.class-option input[type="radio"]:checked ~ span,
.class-option input[type="radio"]:checked ~ .class-stats span,
.class-option input[type="radio"]:checked ~ .class-lore {
    filter: drop-shadow(0 0 12px gold);
    color: gold;
    font-weight: bold;
}

/* Death Screen */

.you-died {
    width: 100vw; /* Full viewport width */
    display: block;
    padding: 1rem;
    margin: 2rem 0 0 0;
    color: #fff;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,         /* fully transparent at far left */
        rgba(0, 0, 0, 0.6) 20%,      /* more solid towards center */
        rgba(0, 0, 0, 0.6) 80%,      /* stays solid */
        rgba(0, 0, 0, 0) 100%        /* fully transparent at far right */
  );
}

@media (max-width: 768px) {
    .class-selector {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .class-selector p {
        text-align: center;
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .class-option {
        width: 100%;
        max-width: 150px;
    }

    .class-option img {
        width: 100%;
        height: 120px;
    }

    .class-selector button {
        margin-top: 1.5rem;
        align-self: center;
    }

    h1 {
    font-size: 4rem;
    }

    .enemy-img {
    max-width: 200px;
    }

    .class-image {
    width: 80px;
    }

    .class-lore {
    display: none !important;
    }

    .lore-box {
    padding: 0px;
    margin: 5px 0;
    width: 80%;
    }

    .battle-info {
    font-size: 1rem;
    }

    /*Media Query for class selector page, static image fall-back*/

     /* Don’t render the video on small screens */
  #bg-video {
    display: none;
  }

  /* Use a static image as the page background */
  body.home-page {
    background: url("../images/areas/video_placeholder.jpg") center / cover no-repeat;
    background-attachment: scroll;  /* explicit mobile-safe */
    min-height: 100dvh;
    height: auto;
  }
  /* extra safety for mobile*/ 
  html.home-page, body.home-page {
    background: url("../images/areas/video_placeholder.jpg") center / cover no-repeat;
    background-attachment: scroll;
  }

}

/* Battle backgrounds for normal & boss enemy*/

body.battle-mode,
body.boss-mode {
  background-image: var(--battle-bg, none);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
}

/* Flurry Pulse Animation (unchanged timing) */
@keyframes flurryPulse {
  0%, 100% { opacity: 0; }
  25%     { opacity: 0.6; }
  50%     { opacity: 0; }
  75%     { opacity: 0.6; }
}

/* PNG burst/scale animation */
@keyframes flurryBurst {
  0%   { transform: scale(0.6); opacity: 0; }
  15%  { opacity: 1; }
  45%  { transform: scale(1.2); opacity: 1; }
  70%  { transform: scale(1.0); opacity: 0.85; }
  100% { transform: scale(1.4); opacity: 0; }
}

#flurry-flash {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100vw;

  /* Use semi-transparent red so the PNG shows through */
  background-color: rgba(255, 0, 0, 0.55);

  opacity: 0;                /* this drives your flash fade */
  pointer-events: none;
  z-index: 9999;

  /* perf */
  will-change: opacity;
}

/* Pseudo-element for the PNG burst */
#flurry-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../images/icons/flurry.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  opacity: 0;               /* independent fade for the PNG */
  transform: scale(0.6);
  will-change: transform, opacity;
  pointer-events: none;
}

/* Trigger both animations together */
.flurry-animate {
  animation: flurryPulse 1s ease-in-out;
}
.flurry-animate::after {
  animation: flurryBurst 1s ease-out;
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flurry-animate,
  .flurry-animate::after {
    animation: none;
    opacity: 0; /* or set to a small static value if desired */
  }
}


/* Estus healing green flash */

#healing-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 120, 0.2);
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

#healing-flash.active {
    opacity: 1;
}

/* Bubble container */
#bubble-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

/* Estus-triggered bubble */
.bubble {
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 120, 0.6), rgba(0, 150, 80, 0.2));
    box-shadow: 0 0 8px rgba(0, 255, 120, 0.5);
    opacity: 0;
    animation: estusBubbleRise 3s ease-in forwards;
}

/* Animation for Estus bubbles */
@keyframes estusBubbleRise {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0.1;
    }
    20% {
        transform: translateY(-20vh) scale(0.95);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-40vh) scale(1.1);
        opacity: 0.9;
    }
    60% {
        transform: translateY(-60vh) scale(1.3);
        opacity: 0.7;
    }
    80% {
        transform: translateY(-80vh) scale(1.4);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) scale(1.5);
        opacity: 0;
    }
}

