/* Main container */
.game-summary-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0;
}

/* Add a min-height to ensure we have space to center in */
html, body {
    min-height: 80vh;
}

/* Use flexbox for vertical centering */
.game-start-wrapper {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.game-start-wrapper .score-card {
    width: 100%;
    height: auto;
    min-height: 600px;
    max-width: 450px; /* Constrain width for better readability */
    margin: 0 auto; /* Center the card */
}

/* Score card styling */
.score-card {
    position: sticky;
    top: 20px;
    background: rgba(22, 45, 98, 0.4); /* Subtle dark blue background with transparency */
    border-radius: 20px;
    border: 3px solid #4652FA;
    height: 600px; /* Match table height */
    display: flex;
    flex-direction: column;
    padding: 20px 30px 30px;
}

.score-card .quiz-desc,
.score-card .score,
.score-card .quiz-desc p {
    font-size: 1em;
    font-weight: normal;
    color: white;
    text-align: center;
    margin: 20px 0;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

.score-card .quiz-desc a {
  color: white;
  text-decoration: underline;
  cursor: pointer;
}

.game-start-wrapper.with-desc .quiz-desc {
  margin-top: 0
}

.game-start-wrapper.with-desc .logo-wrapper {
  margin-bottom: 0;
}

.score-card .quiz-desc,
.score-card .quiz-desc p {
    font-size: 18px;
    line-height: 1.5;
}

.score-card .score .score-percentage{
    font-size: 3em;
    font-weight: 700;
    color: white;
    text-align: center;
    margin: 40px 0;
    font-family: 'Poppins', sans-serif;
}

.score-card .attempts {
    text-align: center;
    margin: 15px 0;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

/* Score card links styling */
.score-card .links {
    margin-top: auto;  /* Push links to bottom of card */
    padding: 20px 0;   /* Vertical padding */
    display: flex;
    flex-direction: column;
    gap: 15px;         /* Space between links */
}

.start-page .links a,
.score-card .links a {
    display: block;
    margin-top: 10px;
    padding: 14px 24px;  /* Increased padding for better touch targets */
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Primary game link (Start game) */
.score-card .links a.game-link:first-child {
    background: linear-gradient(135deg, #4652FA 0%, #2E5ECB 100%);
    color: white;
    border: 2px solid #4652FA;
    box-shadow: 0 4px 15px rgba(70, 82, 250, 0.4);
}

.score-card .links a.game-link:first-child:hover {
    background: linear-gradient(135deg, #5A66FF 0%, #3D6AE8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(70, 82, 250, 0.6);
}

.score-card .links a.game-link:first-child:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(70, 82, 250, 0.4);
}

/* Secondary game link (Cancel) */
.score-card .links a.game-link:last-child {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.score-card .links a.game-link:last-child:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.score-card .links a.log-in-link {
    color: #2E5ECB;
}

.score-card .links a.log-in-link:hover {
    color: #0d6edb;
}

.score-card .links a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.score-card .login-benefits {
    margin: 10px 0;
    text-align: left;
    padding: 0 10px;
    color: #ffffff;
}

.score-card .login-benefits p {
    font-weight: bold;
    margin-bottom: 15px;
    color: #ffffff;

}

.score-card .login-benefits ul {
    list-style-type: disc;
    padding-left: 20px;
}

.score-card .login-benefits li {
    margin-bottom: 5px;
}

#summary-table-wrapper table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 3px solid #4652FA;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px; /* Set a fixed height for the table */
}

#summary-table-wrapper table thead {
    flex: 0 0 auto;
    width: 100%;
}

#summary-table-wrapper table tbody {
    flex: 1 1 auto;
    display: block;
    overflow-y: auto;
}

#summary-table-wrapper table tr {
    width: 100%;
    display: table;
    table-layout: fixed;
}

/* Ensure smooth scrolling and styled scrollbar */
#summary-table-wrapper table tbody::-webkit-scrollbar {
    width: 8px;
}

#summary-table-wrapper table tbody::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

#summary-table-wrapper table tbody::-webkit-scrollbar-thumb {
    background: rgba(109, 192, 252, 0.5);
    border-radius: 4px;
}

#summary-table-wrapper table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 192, 252, 0.7);
}

#summary-table-wrapper table thead tr {
    background: rgba(0, 0, 0, 0.11);
    border: none;
}

#summary-table-wrapper table thead tr th{
    border: none;
}

#summary-table-wrapper tr {
    background: rgba(0, 0, 0, 0.11);
}

#summary-table-wrapper tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.31);
}

#summary-table-wrapper th {
    padding: 20px;
    text-align: left;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    background: rgba(0, 0, 0, 0.11);
}

#summary-table-wrapper td, .isi-safety-wrapper p {
    padding: 14px;
    border: none;
    color: white;
}

.isi-safety-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 100px;
  overflow-y: auto;
  background: radial-gradient(ellipse at 49% 45%, #193575 0%, #183370 25%, #162D62 54%, #13234B 85%, #121E3D 100%);
  border-top: 3px solid #4652FA;
  padding: 10px;
  box-sizing: border-box;
  z-index: 9999;
}

.isi-safety-wrapper p {
  font-size: 16px;
}

#summary-table-wrapper td a, .isi-safety-wrapper p a {
    text-decoration: underline;
    color: white;
}

.correct:before{
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #28a745;
    margin-right: 5px;
}

.wrong:before {
    content: '\f00d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #dc3545;
    margin-right: 5px;
}

/* Home link styling */
.leaderboard-link-wrapper {
    margin-bottom: 20px;
}

/* Title styling */
.game-summary-title {
    text-align: center;
    color: white;
    font-size: 2.5em;
    font-weight: 700;
    margin: 20px 0 40px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.5em;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-summary-wrapper {
        grid-template-columns: 1fr;
    }
    
    .score-card {
        position: relative;
        top: 0;
        padding: 15px 20px 20px;
        min-height: auto;
        height: auto;
        max-width: 100%;
    }

    .game-start-wrapper .score-card {
        max-width: 100%;
    }

    .score-card .quiz-title {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .score-card .quiz-desc,
    .score-card .quiz-desc p {
        font-size: 16px;
    }

    .score-card .links a {
        padding: 12px 20px;
        font-size: 14px;
    }
}

.score-card .score-image {
    text-align: center;
    margin: 20px 0;
}

.score-card .score-image img {
    max-width: 200px;
    height: auto;
    margin: 0 auto;
}

/* Logo styling */
.score-card .logo-wrapper {
    text-align: center;
    padding: 20px 0 15px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle divider */
}

.game-start-wrapper.with-desc .logo-wrapper {
    border-bottom: none;
    margin-bottom: 10px;
}

.rheumiq-logo {
    height: auto;
}

/* Quiz title styling */
.score-card .quiz-title {
    text-align: center;
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding: 0 10px;
    font-family: 'Poppins', sans-serif;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-start-wrapper.with-desc .quiz-title {
    margin-bottom: 15px;
}