* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(120deg, #fdfbfb, #ebedee);
    margin: 0;
    padding: 0;
    color: #333;
    height: 100%;
    width: 100%;
    min-height: 100vh;
}

.container,
.subjects,
.table-wrapper,
.welcome-text,
table,
td,
th,
a,
p,
h1,
h2,
h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.welcome-text {
    max-width: 640px;
    width: min(640px, 92%);
    min-height: 112px;
    margin: 10px auto 10px auto;
    padding-top: 0;
    padding: 10px 14px;
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #2980b9;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.4;
    color: #2c3e50;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    white-space: pre-wrap;
    border-right: 2px solid #2980b9;
    position: relative;
    animation: welcomeCardIn 520ms ease-out both;
}

.welcome-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    color: #12344d;
    position: relative;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: welcomeLineIn 520ms ease-out 120ms both;
}

.welcome-copy {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    color: #2c3e50;
    opacity: 0;
    transform: translateY(6px);
    animation: welcomeLineIn 620ms ease-out 240ms both;
}

@keyframes welcomeCardIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes welcomeLineIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-text,
    .welcome-title,
    .welcome-copy {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.table-wrapper {
    width: 90%;
    max-width: 900px;
    margin: 30px auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.table-wrapper h2 {
    text-align: center;
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

table thead {
    background: linear-gradient(105deg, #b31919 20%, #06ad49 80%);
    color: white;
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s ease;
}

table td {
    padding: 12px 15px;
}

table td:last-child {
    text-align: center;
    font-weight: bold;
    color: #1a6e3c;
}

.domain-row {
    background: #2c3e50;
    font-weight: bold;
    color: #ffffff;
}

.total-row {
    background: #1a252f;
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
}

.container {
    width: 90%;
    max-width: 900px;
    margin: 40px auto 20px auto;
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

h1 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 15px;
}

h2 {
    font-size: 28px;
    color: #34495e;
    margin-bottom: 20px;
}

p {
    color: rgb(9, 84, 70);
    font-size: 26px;
    margin-bottom: 30px;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

li {
    margin: 0;
}

.subjects {
    width: 90%;
    max-width: 900px;
    margin: 40px auto 60px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.subjects h2,
.subjects h3 {
    color: #34495e;
    margin-bottom: 15px;
}

.subjects p {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 20px;
}

.subjects .total-question-count {
    display: inline-block;
    margin: 0 0 24px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #1d5f8c;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.btn {
    display: inline-block;
    padding: 18px 28px;
    background: #1a5276;
    color: #ffffff;
    font-weight: bold;
    border-radius: 10px;
    text-decoration: none;
    min-width: 140px;
    transition: all 0.3s ease;
    text-align: center;
    margin: 5px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.btn:hover {
    background: #154360;
    transform: translateY(-4px) scale(1.03);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

#site-footer {
    background: #1a237e;
    color: #fff;
    padding: 40px 15px;
    margin-top: 50px;
}

#site-footer .footer-container {
    width: 90%;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

#site-footer h2 {
    margin-bottom: 8px;
    font-size: 28px;
    color: #ffd700;
}

#site-footer h3 {
    margin: 0 0 14px;
    font-size: 20px;
    color: #ffffff;
}

#site-footer p {
    margin: 0 0 16px;
    font-size: 16px;
    color: #d7dbff;
    line-height: 1.5;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.footer-section {
    margin: 0;
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-links-section {
    background-color: #2b378f;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 6px;
}

.footer-links a {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-weight: 600;
}

.footer-links a:hover {
    background: #ffd700;
    color: #1a237e;
    transform: translateY(-2px);
}

.footer-nav-section {
    background-color: #1f2b7a;
}

.footer-nav {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.footer-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e9ecff;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 600;
}

.footer-nav a:hover {
    background: #ffd700;
    color: #1a237e;
    transform: translateY(-2px);
}

img,
video,
iframe,
table {
    max-width: 100%;
}

#site-footer .copyright {
    margin-top: 22px;
    font-size: 14px;
    color: #b7c0ff;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .welcome-text {
        max-width: 95%;
        font-size: 14px;
        padding: 10px 12px;
        min-height: 104px;
    }

    .welcome-title {
        font-size: 15px;
    }

    .welcome-copy {
        font-size: 12px;
    }

    .container,
    .subjects,
    .table-wrapper {
        width: calc(100% - 16px);
        padding-left: 12px;
        padding-right: 12px;
    }

    .btn,
    .footer-links a,
    .footer-nav a {
        width: 100%;
    }

    .btn:hover,
    .footer-links a:hover,
    .footer-nav a:hover {
        transform: none;
        box-shadow: none;
    }
}