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

*,
*::before,
*::after {
    box-sizing: border-box;
    scroll-behavior: smooth;
    outline: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: #e7e7e7;
}

img, canvas, video {
    max-width: 100%;
    height: auto;
}

body {
    padding: 30px 10px 0 10px;
    font-family: 'Quicksand', sans-serif;
}

/* Responsive Screen */
.screen {
    display: none !important;
    padding: 50px;
    text-align: center;
    overflow-y: auto;
    max-height: 100vh;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}


#start-screen {
    background-color: #ffffff;
    border-radius: 10px;
    margin: 50px auto;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

#start-screen h1 {
    font-size: 2rem;
    color: #333;
    font-family: 'Anton', sans-serif;
}

#start-screen p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
}

#start-screen button {
    background: white;
    color: #333 !important;
    border: 2px solid #555;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 25px;
    margin: 10px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

#start-screen button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

/* Responsive Layout Blocks */
.game,
.top,
.events,
.buttons,
.stats,
#leave,
#prisonLeave,
#prisonButtons {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.game {
    background: linear-gradient(rgb(121, 214, 238), rgb(38, 130, 216));
    border: 2px solid rgb(73, 73, 226);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    height: 95vh;
    overflow-y: auto;   /* Enables scroll if content overflows */
    box-sizing: border-box;
}

.top p {
    margin: 0;
    font-size: 1rem;
}

/* Container for the row of buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    background: white;
    border-radius: 10px;
    padding: 10px;
}

/* Style for each individual button */
.button {
    background: white;
    border: 2px solid #555;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 10px 20px;
    margin: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 100px;
    min-height: 44px;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
}

.age-button-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.button.big {
  width: 80%;
  max-width: 300px;
  font-size: 1.1rem;
  padding: 12px 20px;
  background-color: #fff;
  border: 3px solid #555;
  border-radius: 30px;
  font-weight: bold;
}

.button.big:hover {
  background-color: #f9f9f9;
  transform: scale(1.04);
  transition: all 0.2s ease-in-out;
}

.button:hover {
  background: #e6f0ff;
  transform: scale(1.05);
}

/* Add back a styled scrollbar if desired */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

#events {
    height: 40vh;              /* adjust as needed */
    max-width: 90vw;           /* prevent overflow on small screens */
    min-height: 150px;
    height: 50%;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.85);
    color: #111;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}


@media (min-width: 768px) {
  #events {
  }

  .buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* instead of 5 */
    gap: 0.5rem;
  }
}

.events {
    margin-bottom: 1rem;
    padding: 10px;
    font-size: 1rem;
    border-radius: 10px;
}

.event, .ageSpot, .inf {
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

.stats {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: auto;
    margin-bottom: 20px; /* optional: spacing from bottom edge */ 
}

.stat-container {
  display: flex;
  align-items: center;
  margin: 6px 0;
  font-size: 0.85rem;
}

.stat-label {
  width: 90px;
  text-align: left;
}

.stat-bar {
  flex-grow: 1;
  background: #444;
  border-radius: 5px;
  margin: 0 10px;
  height: 12px;
  position: relative;
}

.stat-fill {
  height: 100%;
  background: limegreen;
  border-radius: 5px;
  transition: width 0.3s ease-in-out;
}

.stat-percent {
  width: 40px;
  text-align: right;
}


.inf {
    font-size: 0.9rem;
    margin: 0.3rem 0 0.2rem;
    text-align: center;
}

.healthMiddle {
    height: 100%;
    width: 0%; /* This will be updated via JS */
    background-color: green; /* Default color, will be overridden by ID */
    border-radius: 10px;
    transition: width 0.4s ease-in-out;
}

#happy {
    background-color: gold;
}

#smarts {
    background-color: blueviolet;
}

#looks {
    background-color: hotpink;
}

#comedy {
    background-color: orange;
}

#fameBar {
    background-color: deeppink;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* semi-transparent black */
    display: none;
    z-index: 9;
}

.popup {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -30%);
    padding: 20px;
    background-color: rgba(0, 0, 0, 0); /* fully transparent */
    border-radius: 10px;
    z-index: 10;
    transition: opacity 0.3s ease-in-out;
    background: none;
    padding: 0;
    border: none;
    box-shadow: none;
}

#popup h1, #popup p {
    text-align: center;
}

.event-on-dark {
    color: white !important;
}

.poper {
  width: 80%;
  max-width: 500px;
  margin: 40px auto;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  max-height: 60vh;
  overflow-y: auto;
  background: inherit; /* use the background set via .css('background', ...) */
}

.poper button {
  margin-top: 20px;
}

.relationship-card {
  background: white;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 15px auto;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.relationship-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: #111;
  padding: 10px;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 99;
}

.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: #00e5ff;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-button img {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.healthBar{
    width: 100px;
    background: rgb(185, 185, 185);
    height: 10px;
    text-align: left;
    transition: 0.5s ease all;
    border-radius: 2px;
}

.italic{
    color: rgb(68, 68, 68);
    font-style: italic;
}

#game-screen {
    height: 90vh;
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.healthMiddle{
    height: 10px;
    background: linear-gradient(rgb(61, 192, 22), rgb(13, 129, 13));
    border-radius: 2px;
    transition: 0.2s ease all;
}

.bottom-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding: 8px 18px;
  font-size: 0.85rem;
}

#top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 600px; /* Ensures it matches .events and .game */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  font-weight: bold;
}

#top-bar p {
  margin: 0;
  font-size: 1rem;
}

#top-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#leaveButton {
  margin-bottom: 15px;
  font-size: 14px;
  padding: 6px 12px;
  display: none;
}

.activity-section {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin: 20px auto;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(2px);
  text-align: center;
}

.activity-section h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 5px;
}

.activity-section .button {
  display: block;
  width: 90%;
  margin: 8px auto;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 30px;
  transition: all 0.2s ease;
}

.activity-section .button small {
  font-size: 0.8rem;
  display: block;
  margin-top: 3px;
  color: green;
}

.finance-section {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin: 20px auto;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(2px);
  text-align: center;
}

.finance-section h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 5px;
}

.finance-section h3 {
  font-size: 1rem;
  margin: 0;
}

.finance-section .button {
  display: block;
  width: 90%;
  margin: 10px auto;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 30px;
  transition: all 0.2s ease;
}

#careers {
  background: transparent;
}

.button.actionButton {
    display: block;
    width: 75%;
    margin: 14px auto 0 auto;
    padding: 14px 0 11px 0;
    border-radius: 20px;
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.09);
    color: #262626;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.button.actionButton + .button.actionButton {
    margin-top: 10px;
}
.button.actionButton:hover {
    background: #eaf6ff;
    color: #0f3e76;
    box-shadow: 0 4px 12px 0 rgba(44,138,192,0.17);
}

/* Finance asset "card" panel styling */
.item {
    background: rgba(255,255,255,0.35);
    border-radius: 20px;
    box-shadow: 0 4px 18px 0 rgba(0,0,0,0.07);
    padding: 30px 18px 28px 18px;
    margin: 0 auto 18px auto;
    max-width: 350px;
}

/* Center and style the asset name */
.item h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 24px;
    letter-spacing: 0.02em;
    color: #23395d;
    text-align: center;
}

/* Value styling */
.item p {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: #555;
    text-align: center;
}
.item p span {
    font-size: 1.15rem;
    font-weight: 600;
    color: #20a450;   /* bright green for value */
    letter-spacing: 0.01em;
}

/* Section subtitle (like "Your Houses") */
#finance small.italic {
    display: block;
    margin-bottom: 6px;
    font-size: 1.04rem;
    color: #888;
    font-style: italic;
    text-align: center;
    margin-top: 10px;
}

/* Action buttons: Sell, Fix Up, Throw a Party */
.button.actionButton {
    display: block;
    width: 75%;
    margin: 14px auto 0 auto;
    padding: 14px 0 11px 0;
    border-radius: 20px;
    background: #fff;
    font-size: 1.12rem;
    font-weight: 700;
    border: none;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.09);
    color: #262626;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    letter-spacing: 0.01em;
}
.button.actionButton + .button.actionButton {
    margin-top: 10px;
}

/* Responsive for mobile */
@media (max-width: 600px) {
    .item {
        max-width: 98%;
        padding: 18px 2px 18px 2px;
    }
    .button.actionButton {
        width: 95%;
        font-size: 1rem;
        padding: 13px 0 10px 0;
    }
}

.button.actionButton.sell {
    background: #fff5f5;
    color: #b50000;
}
.button.actionButton.sell:hover {
    background: #ffeaea;
    color: #d80000;
}

.optionCard {
    background: rgba(255,255,255,0.90);
    border-radius: 24px;
    box-shadow: 0 4px 18px 0 rgba(0,0,0,0.11);
    margin: 18px auto;
    padding: 18px 10px 12px 10px;
    max-width: 320px;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.18s, background 0.2s;
    cursor: pointer;
    border: 2px solid #e0e0e0;
}
.optionCard:hover, .optionCard:focus {
    transform: scale(1.04);
    box-shadow: 0 8px 28px 0 rgba(46,139,192,0.18);
    background: #eaf6ff;
    border-color: #89c3eb;
    outline: none;
}

.collegeOption {
    border-left: 6px solid #4dc2c2;
}
.careerOption {
    border-left: 6px solid #7db6f5;
}

.optionTitle {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}
.optionSub {
    font-size: 1.05rem;
    color: #555;
    margin-top: 2px;
}
.optionMoney {
    color: #20a450;
    font-weight: 700;
    font-size: 1.07rem;
}


