/* ==== GLOBAL STYLES ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  color: #333333;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.screen.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ==== CASH BANNER ==== */
#cashBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #dc3545;
  color: white;
  padding: 15px 20px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cash-amount {
  font-size: 28px;
}

/* ==== MAIN SCREEN ==== */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.logo-container img {
  max-width: 150px;
  height: auto;
}

.hero-section {
  text-align: center;
  margin-bottom: 30px;
}

.hero-section h1 {
  font-size: 48px;
  color: #333333;
  margin-bottom: 10px;
}

.tagline {
  font-size: 20px;
  color: #dc3545;
  font-weight: bold;
}

/* ==== INFO BOXES ==== */
.info-box {
  background: white;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-box h3 {
  color: #333333;
  margin-bottom: 15px;
  margin-top: 5px;
  font-size: 22px;
}

/* Triangle Bullets */
.triangle-bullets {
  list-style: none;
  padding-left: 0;
}

.triangle-bullets li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.triangle-bullets li:before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 0;
  height: 0;
  border-left: 8px solid #dc3545;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ==== HOW TO PLAY ==== */
.how-to-play {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.play-step {
  flex: 1;
  min-width: 120px;
  background: #f8f9fa;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 15px 10px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
}

.arrow {
  font-size: 24px;
  color: #dc3545;
  font-weight: bold;
}

/* ==== BUSINESS OPTIONS ==== */
.business-note {
  color: #dc3545;
  font-weight: bold;
  margin-bottom: 15px;
}

.business-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

@media (max-width: 1000px) {
  .business-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .business-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.business-option {
    background: #f8f9fa;
    border: 2px solid #999999;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.business-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(153, 153, 153, 0.3);
}

.business-option.selected {
  background: #dc3545;
  color: white;
}

.business-option.locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #999999;
}

.business-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.business-option h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.startup-cost {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.locked-text {
  color: #dc3545;
  font-weight: bold;
  font-size: 12px;
  margin-top: 5px;
}

/* ==== RECORDS TABLE ==== */
.records-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.records-table thead {
  background: #333333;
  color: white;
}

.records-table th,
.records-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.records-table tbody tr:hover {
  background: #f8f9fa;
}

.records-table tbody tr:nth-child(1) td:first-child {
  color: #FFD700;
  font-weight: bold;
}

.records-table tbody tr:nth-child(2) td:first-child {
  color: #C0C0C0;
  font-weight: bold;
}

.records-table tbody tr:nth-child(3) td:first-child {
  color: #CD7F32;
  font-weight: bold;
}

/* ==== START SECTION ==== */
.start-section {
  text-align: center;
  margin-top: 30px;
}

.name-input {
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid #999999;
  border-radius: 8px;
  width: 300px;
  max-width: 100%;
  margin-right: 10px;
}

.start-button {
  padding: 12px 40px;
  font-size: 18px;
  font-weight: bold;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.start-button:hover {
  background: #c82333;
}

/* ==== GAME SCREEN ==== */
.game-layout {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 80px 20px 20px 20px; /* ← Reduced from 120px to 80px */
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

@media (max-width: 1200px) {
  .game-layout {
    flex-direction: column;
  }
}

.main-content {
  flex: 1;
  min-width: 0;
  display: block !important;
}

.info-bar {
  display: flex;
  justify-content: space-between; /* This pushes the 3 items to Left, Center, and Right */
  align-items: center;
  background: #f8f9fa;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.info-bar div {
  font-size: 16px;
  font-weight: bold;
}

/* ==== PANELS ==== */
.panel {
  display: block !important;
  background: white;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  min-height: 100px;
}

.panel h3 {
  margin-top: 5px;
  margin-bottom: 15px;
  color: #333333;
}

.decision-panel {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.business-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.business-info h4 {
  margin-top: 5px;
  margin-bottom: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
}

.info-label {
  font-weight: bold;
}

.info-value {
  color: #dc3545;
}

.advice-box {
  background: #fffbea;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

/* ==== DECISION LAYOUT ==== */
.decision-section {
  margin-bottom: 20px;
}

.decision-section h4 {
  color: #333333;
  margin-bottom: 15px;
  margin-top: 5px;
  font-size: 18px;
  font-weight: bold;
}

.decision-layout {
  display: flex;
  gap: 20px;
}

.decision-left {
  flex: 1;
}

.decision-right {
  flex: 1;
}

@media (max-width: 768px) {
  .decision-layout {
    flex-direction: column;
  }
}

.advice-box h4 {
  margin-top: 5px;
  margin-bottom: 10px;
}

.advice-box ul {
  margin-left: 20px;
}

.advice-box li {
  margin-bottom: 8px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 10px;
  border: 2px solid #999999;
  border-radius: 5px;
  font-size: 14px;
}

.submit-btn {
  width: 100%;
  padding: 15px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: #c82333;
}

/* ==== DASHBOARD ==== */
.dashboard-section {
  display: block !important;
  background: white;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.dashboard-section h3 {
  margin-top: 5px;
  margin-bottom: 15px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* ==== HISTORY ==== */
.history-section {
  display: block !important;
  background: white;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}
#historyContent {
  overflow-x: auto;
  width: 100%;
}

.history-section h3 {
  margin-top: 5px;
  margin-bottom: 15px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px; /* Reduced from 13px */
    table-layout: fixed; /* Forces it to stay within the 100% width */
    word-wrap: break-word; /* Allows text to wrap inside cells */
}

.history-table th,
.history-table td {
    padding: 6px 4px; /* Reduced from 10px */
    text-align: left;
    border-bottom: 1px solid #ddd;
    overflow: hidden; /* Keeps content inside */
}

.history-table thead {
  background: #333333;
  color: white;
}

.history-table tbody tr:hover {
  background: #f8f9fa;
}

/* ==== RIGHT SIDEBAR ==== */
.right-sidebar {
  width: 350px;
  flex-shrink: 0;
  display: block !important;
}

@media (max-width: 1200px) {
  .right-sidebar {
    width: 100%;
  }
}

.sidebar-panel {
  display: block !important;
  background: white;
  border: 2px solid #999999;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-panel h4 {
  margin-top: 5px;
  margin-bottom: 15px;
  color: #333333;
  font-size: 18px;
}

.financial-widget {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.financial-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.financial-widget h5 {
  margin-top: 5px;
  margin-bottom: 10px;
  color: #dc3545;
}

.investment-option {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.action-btn {
  width: 100%;
  padding: 10px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s ease;
}

.action-btn:hover {
  background: #c82333;
}

.action-btn-small {
  padding: 8px 15px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
  margin-top: 5px;
  transition: background 0.3s ease;
}

.action-btn-small:hover:not(:disabled) {
  background: #5a6268;
}

.action-btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==== ASSISTANT BOT ==== */
.assistant-chat {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 15px;
  height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.user-message {
  background: #dc3545;
  color: white;
  padding: 8px 12px;
  border-radius: 15px;
  margin-bottom: 10px;
  max-width: 80%;
  margin-left: auto;
  text-align: right;
}

.assistant-message {
  background: white;
  border: 1px solid #ddd;
  padding: 8px 12px;
  border-radius: 15px;
  margin-bottom: 10px;
  max-width: 80%;
}

.assistant-input {
  display: flex;
  gap: 5px;
}

.assistant-input input {
  flex: 1;
  padding: 8px;
  border: 2px solid #999999;
  border-radius: 5px;
}

.ask-btn {
  padding: 8px 15px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ask-btn:hover {
  background: #c82333;
}

/* ==== MODAL ==== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 10px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.switch-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .switch-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.switch-option {
  background: white;
  border: 3px solid #dc3545;
  border-radius: 10px;
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.switch-option:hover:not(.disabled):not(.current) {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.switch-option.current {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.switch-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #999999;
}

.switch-option h4 {
  font-size: 16px;
  margin: 10px 0 5px 0;
}

.switch-option .cost {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.switch-option .need-money {
  color: #dc3545;
  font-weight: bold;
  font-size: 12px;
  margin-top: 5px;
}

.close-modal-btn {
  width: 100%;
  padding: 12px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.close-modal-btn:hover {
  background: #5a6268;
}

/* ==== DECISION PANEL IMPROVEMENTS ==== */
.compact-box {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.inline-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.inline-input label {
  font-weight: bold;
  font-size: 14px;
  flex: 1;
}

.inline-input input {
  width: 130px;
  padding: 6px 8px;
  font-size: 14px;
}

/* ==== UNIFY FONTS BETWEEN INFO + INPUT ROWS ==== */
.info-label,
.inline-input label {
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  color: #333333;
}

.info-value {
  font-family: inherit;
  font-size: 14px;
  font-weight: bold
