/* Font Face Declaration */
@font-face {
    font-family: 'Impact';
    src: url('Impact-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, "Helvetica Neue", Arial, "Roboto", sans-serif;
    background: url("tbbt.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #2c3e50, #34495e);
    border: 3px solid #f39c12;
    border-radius: 20px;
    padding: 15px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.game-header::before {
    content: '';
    display: none;
}

.game-title {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 48px;
    font-weight: normal;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-tb {
    color: #000000; /* Black */
}

.title-b {
    color: #e74c3c; /* Red */
}

.title-t {
    color: #e74c3c; /* Red */
}

.title-dle {
    color: #f1c40f; /* Yellow */
}

/* Navigation Bar */
.game-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    padding: 0 20px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 100px;
}

.nav-btn:hover {
    background: linear-gradient(45deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rules-btn {
    background: linear-gradient(45deg, #27ae60, #229954);
}

.rules-btn:hover {
    background: linear-gradient(45deg, #229954, #1e8449);
}

.changelog-nav-btn {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.changelog-nav-btn:hover {
    background: linear-gradient(45deg, #e67e22, #d35400);
}

.game-board {
    background: linear-gradient(135deg, rgba(236, 240, 241, 0.95), rgba(189, 195, 199, 0.95));
    border: 4px solid #2c3e50;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    margin-top: 20px;
}

.game-board::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background: #2c3e50;
    border-radius: 10px;
}

.instruction-box {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 25px;
    border: 3px solid #2c3e50;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.instruction-box h2 {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.character-input {
    width: 100%;
    padding: 15px;
    border: 3px solid #34495e;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    outline: none;
    transition: border-color 0.3s ease;
}

.character-input:focus {
    border-color: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 3px solid #34495e;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #2c3e50;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #2c3e50;
}

.submit-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #2c3e50;
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.guess-counter {
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #2c3e50;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}

.guess-counter #guess-count {
    color: #e74c3c;
    font-size: 18px;
}

.hint-text {
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.hint-count {
    color: #e74c3c;
    font-size: 18px;
}

.category-headers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
}

.category {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    padding: 12px 8px;
    border-radius: 8px;
    border: 3px solid #f39c12;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.guesses-container {
    margin-bottom: 25px;
}

.guess-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}

.guess-cell {
    padding: 15px 8px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border: 3px solid #2c3e50;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.guess-cell.correct {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.guess-cell.partial {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
}

.guess-cell.incorrect {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.guess-cell.higher {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
    color: white;
}

.guess-cell.lower {
    background: linear-gradient(45deg, #c0392b, #a93226);
    color: white;
}

.color-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #2c3e50;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #2c3e50;
}

.color-box.correct {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

.color-box.partial {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.color-box.incorrect {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.color-box.higher {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
}

.color-box.lower {
    background: linear-gradient(45deg, #c0392b, #a93226);
}

.yesterday-answer {
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #2c3e50;
}

.answer-highlight {
    color: #e74c3c;
    font-size: 16px;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #f39c12;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    min-width: 300px;
    z-index: 1000;
    font-family: Helvetica, "Helvetica Neue", Arial, "Roboto", sans-serif;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

.notification.show {
    display: flex;
}

.notification.success {
    border-color: #27ae60;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
}

.notification.error {
    border-color: #e74c3c;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.notification.warning {
    border-color: #f39c12;
    background: linear-gradient(45deg, #e67e22, #f39c12);
}

.notification-message {
    flex: 1;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.hide {
    animation: slideOut 0.3s ease-in forwards;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title {
        font-size: 32px;
    }
    
    .category-headers {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .category {
        font-size: 11px;
        padding: 10px 6px;
        border: 2px solid #f39c12;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .category-headers, .guess-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .guess-cell {
        font-size: 11px;
        padding: 10px 6px;
        border: 2px solid #2c3e50;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .color-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .input-wrapper {
        max-width: 100%;
    }
    
    .character-input, .submit-btn {
        width: 100%;
    }
    
    .category-headers {
        gap: 4px;
        margin-bottom: 12px;
    }
    
    .category {
        font-size: 10px;
        padding: 8px 4px;
        min-height: 40px;
        letter-spacing: 0.3px;
        line-height: 1.2;
    }
    
    .category-headers, .guess-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .guess-cell {
        font-size: 10px;
        padding: 8px 4px;
        min-height: 40px;
        line-height: 1.2;
    }
    
    .color-legend {
        gap: 8px;
        padding: 10px;
    }
    
    .legend-item {
        font-size: 10px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .category {
        font-size: 9px;
        padding: 6px 2px;
        min-height: 35px;
    }
    
    .guess-cell {
        font-size: 9px;
        padding: 6px 2px;
        min-height: 35px;
    }
    
    .category-headers, .guess-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    
    .category, .guess-cell {
        text-align: left;
        padding-left: 8px;
    }
    
    .category::before, .guess-cell::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 8px;
        color: #f39c12;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    border: 4px solid #2c3e50;
    border-radius: 20px;
    max-width: 700px;
    max-height: 80vh;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #f39c12;
}

.modal-header h2 {
    font-family: Helvetica, "Helvetica Neue", Arial, "Roboto", sans-serif;
    font-size: 24px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.changelog-entry {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border-left: 5px solid #f39c12;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.changelog-entry:last-child {
    margin-bottom: 0;
}

.changelog-entry h3 {
    color: #2c3e50;
    font-family: Helvetica, "Helvetica Neue", Arial, "Roboto", sans-serif;
    font-size: 20px;
    margin-bottom: 8px;
}

.changelog-date {
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 15px;
}

.changelog-entry ul {
    margin-left: 20px;
}

.changelog-entry li {
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.5;
}

.changelog-entry li strong {
    color: #e74c3c;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .changelog-entry {
        padding: 15px;
    }
    
    .changelog-entry h3 {
        font-size: 18px;
    }
}

/* Rules Modal Specific Styles */
.rules-section {
    margin-bottom: 25px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border-left: 5px solid #27ae60;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rules-section:last-child {
    margin-bottom: 0;
}

.rules-section h3 {
    color: #2c3e50;
    font-family: Helvetica, "Helvetica Neue", Arial, "Roboto", sans-serif;
    font-size: 18px;
    margin-bottom: 12px;
}

.rules-section p {
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 10px;
}

.rules-section ul {
    margin-left: 20px;
    color: #2c3e50;
}

.rules-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.color-examples {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-example {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-example .color-box {
    width: 25px;
    height: 25px;
    border-radius: 5px;
    flex-shrink: 0;
}

.color-example span {
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .game-nav {
        gap: 15px;
        margin: 10px 0;
    }
    
    .nav-btn {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-text {
        font-size: 10px;
    }
    
    .rules-section {
        padding: 15px;
    }
    
    .rules-section h3 {
        font-size: 16px;
    }
    
    .color-examples {
        gap: 8px;
    }
}
