/* Modern Game Instance Page Styling */

/* Main background - black like about page, only outside content container */
body.game-instance-page,
html body.game-instance-page {
  background-color: #000000 !important;
  color: #ffffff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  background-color: #000000 !important;
}

/* Container styling */
.game-instance-container {
  background-color: #ffffff;
  color: #333333;
  padding: 0;
  margin: 30px auto;
  max-width: 95%;
  width: 95%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
}

@media (min-width: 1600px) {
  .game-instance-container {
    max-width: 98%;
    width: 98%;
  }
}

/* Marquee Image - Centered under title */
.game-marquee-container {
  width: 100%;
  text-align: center;
  padding: 20px 0;
  margin: 20px 0;
}

.game-marquee-link {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.game-marquee-link:hover {
  transform: scale(1.02);
}

.game-marquee-img {
  max-height: 200px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: block;
  margin: 0 auto;
}

/* Header Section */
.game-instance-header {
  text-align: center;
  padding: 30px 40px;
  background-color: #ffffff;
  border-bottom: 3px solid #e0e0e0;
}

.game-instance-header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #121d1f;
  font-family: 'Orbitron', sans-serif;
  line-height: 1.2;
}

.game-instance-header .game-year {
  font-size: 0.7em;
  color: #666;
  font-weight: 400;
}

.game-instance-header .game-manufacturer {
  font-size: 1.4rem;
  color: #666;
  margin-top: 8px;
  font-weight: 400;
  margin-bottom: 20px;
}

/* Admin/Owner tools */
.admin-tools, .owner-tools {
  margin: 25px auto 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  border-left: 5px solid #00d9ff;
  max-width: 600px;
}

.admin-tools h4, .owner-tools h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #121d1f;
  font-size: 1.3rem;
  font-weight: 600;
}

.admin-tools-links, .owner-tools-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-tools a, .owner-tools a {
  color: #00d9ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 1rem;
}

.admin-tools a:hover, .owner-tools a:hover {
  color: #0099cc;
  text-decoration: underline;
}

/* Main Content Area */
.game-content {
  padding: 40px;
  background-color: #ffffff;
}

.game-content-layout {
  display: grid;
  grid-template-columns: 450px 1fr 500px;
  gap: 50px;
  align-items: start;
}

/* Left Column: Image */
.game-left-column {
  display: flex;
  flex-direction: column;
}

.game-image-section {
  text-align: center;
  position: sticky;
  top: 100px;
}

.game-image-link {
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.game-image-link:hover {
  transform: scale(1.02);
}

.game-cabinet-img {
  max-width: 450px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: block;
  margin: 0 auto;
}

/* Middle Column: Content */
.game-middle-column {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.game-info-section h3 {
  font-size: 1.5rem;
  color: #121d1f;
  margin-bottom: 15px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #00d9ff;
}

/* Info table - clean modern styling */
.game-info-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.game-info-table,
.game-info-table * {
  text-shadow: none !important;
}

.game-info-table tr {
  border-bottom: 1px solid #e8e8e8;
  transition: background-color 0.2s ease;
}

.game-info-table tr:last-child {
  border-bottom: none;
}

.game-info-table tr:hover {
  background-color: #f8f9fa;
}

.game-info-table td {
  padding: 14px 18px;
  font-size: 1rem;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: normal;
  vertical-align: middle;
}

.game-info-table td:first-child {
  font-weight: 600;
  color: #121d1f;
  width: 45%;
  padding-right: 20px;
  background-color: #f8f9fa;
}

.game-info-table td:last-child {
  color: #444;
  width: 55%;
  padding-left: 20px;
  font-weight: 400;
}

/* Right Column: High Scores */
.game-right-column {
  position: sticky;
  top: 100px;
  align-self: start;
}

.game-intro {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 10px;
}

/* Section headings */
.game-section {
  margin: 0;
}

.game-section h3 {
  font-size: 2rem;
  color: #121d1f;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 3px solid #00d9ff;
  font-weight: 600;
}

.game-section-content {
  line-height: 1.9;
  color: #444;
  font-size: 1.1rem;
  white-space: pre-line;
}

/* High score section - Use same format as live display */
.high-score-section {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  margin-top: 0;
  border: none;
}

.high-score-section h3 {
  display: none; /* Hide the h3, let the hstable header show instead */
}

/* Ensure high score tables use the same styling as live display */
.game-instance-page .hstable {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0;
  padding: 1rem;
}

.game-instance-page .hstablebox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}

.no-scores-message {
  text-align: center;
  padding: 20px;
  color: #666;
}

.no-scores-message p {
  margin: 10px 0;
  font-size: 1.1rem;
}

.submit-score-button {
  margin-top: 30px;
  text-align: center;
}

.submit-score-button a {
  display: inline-block;
  background-color: #00d9ff;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.4rem;
  padding: 16px 40px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 217, 255, 0.3);
  border: 2px solid #00d9ff;
  min-width: 200px;
}

.submit-score-button a:hover {
  background-color: #0099cc;
  border-color: #0099cc;
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 6px 12px rgba(0, 153, 204, 0.4);
  transform: translateY(-2px);
}

/* Override high score table styles for game instance page */
.game-instance-page .hs_entry {
  margin-bottom: 20px;
}

/* Ensure high score tables render properly */
.game-instance-page .highscore-column-left,
.game-instance-page .highscore-column-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-instance-page .hs_table {
  width: 100%;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 1600px) {
  .game-content-layout {
    grid-template-columns: 400px 1fr 450px;
    gap: 40px;
  }
  
  .game-cabinet-img {
    max-height: 550px;
  }
}

@media (max-width: 1400px) {
  .game-content-layout {
    grid-template-columns: 350px 1fr 400px;
    gap: 35px;
  }
  
  .game-cabinet-img {
    max-height: 500px;
  }
}

@media (max-width: 1200px) {
  .game-content-layout {
    grid-template-columns: 300px 1fr 350px;
    gap: 30px;
  }
  
  .game-cabinet-img {
    max-height: 450px;
  }
  
  .game-instance-container {
    width: 98%;
  }
}

@media (max-width: 992px) {
  .game-content-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .game-image-section {
    position: static;
    order: 1;
  }
  
  .game-middle-column {
    order: 2;
  }
  
  .game-right-column {
    position: static;
    order: 3;
  }
  
  .game-cabinet-img {
    max-height: 400px;
  }
  
  .game-instance-header h1 {
    font-size: 2.2rem;
  }
  
  .game-instance-header .game-manufacturer {
    font-size: 1.2rem;
  }
}

/* Responsive table - keep side-by-side layout, just narrow columns */
@media (max-width: 770px) {
  .game-info-table {
    font-size: 0.9rem;
    table-layout: fixed;
  }

  .game-info-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .game-info-table td:first-child {
    width: 40%;
    padding-right: 12px;
    font-size: 0.85rem;
  }

  .game-info-table td:last-child {
    width: 60%;
    padding-left: 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .game-instance-container {
    margin: 15px;
    width: calc(100% - 30px);
    border-radius: 8px;
  }

  .game-marquee-container {
    padding: 30px 20px 0 20px;
  }

  .game-instance-header {
    padding: 25px 20px;
  }

  .game-content {
    padding: 25px 20px;
  }

  .game-instance-header h1 {
    font-size: 1.8rem;
  }

  .game-instance-header .game-manufacturer {
    font-size: 1.1rem;
  }

  .game-section h3 {
    font-size: 1.5rem;
  }

  .game-section-content {
    font-size: 1rem;
  }

  .admin-tools, .owner-tools {
    margin: 20px 0;
    padding: 15px;
  }
  
  .high-score-section {
    margin-top: 20px;
    padding: 20px;
  }
  
  .game-intro {
    font-size: 1.1rem;
  }

  .game-info-section h3 {
    font-size: 1.3rem;
  }

  .high-score-section h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .game-instance-container {
    margin: 10px;
    width: calc(100% - 20px);
  }

  .game-marquee-container {
    padding: 20px 15px 0 15px;
  }

  .game-instance-header {
    padding: 20px 15px;
  }

  .game-content {
    padding: 20px 15px;
  }

  .game-instance-header h1 {
    font-size: 1.5rem;
  }

  .game-instance-header .game-year {
    font-size: 0.65em;
  }

  .game-instance-header .game-manufacturer {
    font-size: 1rem;
  }
  
  .admin-tools h4, .owner-tools h4 {
    font-size: 1.1rem;
  }
  
  .admin-tools a, .owner-tools a {
    font-size: 0.95rem;
  }
  
  .game-section h3 {
    font-size: 1.3rem;
  }

  .game-section-content {
    font-size: 0.95rem;
  }

  .game-info-table {
    font-size: 0.85rem;
  }

  .game-info-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .game-info-table td:first-child {
    width: 38%;
    padding-right: 10px;
    font-size: 0.8rem;
  }

  .game-info-table td:last-child {
    width: 62%;
    padding-left: 10px;
    font-size: 0.85rem;
  }

  .submit-score-button a {
    font-size: 1.2rem;
    padding: 14px 30px;
  }
}
