/* Main Body */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding-bottom: 200px;
    text-align: center;
    background-image: url('../images/assets/Battle Cats Background.PNG');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
}

@font-face {
    font-family: 'Humato Heavy';
    src: url('../fonts/Humato-Hv-FFP.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Header + Title Logo */
header {
    margin-bottom: 20px;
    text-align: center;
    padding: 10px 0;
}

.logo-container {
    display: inline-block;
    margin: 0 auto;
}

.game-logo {
    max-width: 50%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Mode Toggle Button*/
.game-mode-container {
    display: flex;
    justify-content: center;
    margin: 20px auto 30px;
    width: 200px;
}

#mode-toggle {
    width: 200px;
    height: 60px;
    border-radius: 10px;
    border: 2px solid #000;
    background: linear-gradient(180deg, #FEC200 0%, #C99102 100%);
    color: #E4E3E3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Impact', sans-serif;
    font-size: 32px;
    line-height: normal;
    -webkit-text-stroke-width: 1.8px;
    text-shadow: 0px 0px 3px black;
    -webkit-text-stroke-color: #000;
    text-align: center;
    transition: background 0.2s ease;
}

#mode-toggle:hover {
    background: linear-gradient(180deg, #E0A800 0%, #A57A00 100%);
}

#mode-toggle::before {
    content: 'Daily Mode';
}

body.infinite-mode #mode-toggle::before {
    content: 'Endless Mode';
}

body.infinite-mode .victory-timer-row {
    display: none;
}

body.infinite-mode .play-again-button {
    display: block;
}

/* Play Again Button */
.play-again-button {
    display: none;
    margin: 20px auto;
    width: 180px;
    height: 50px;
    border-radius: 15px;
    border: 3px solid #000;
    background: linear-gradient(180deg, #FEC200 0%, #C99102 100%);
    color: #E4E3E3;
    cursor: pointer;
    font-family: 'Impact', sans-serif;
    font-size: 32px;
    line-height: normal;
    -webkit-text-stroke-width: 2px;
    text-shadow: 0px 0px 3px black;
    -webkit-text-stroke-color: #000;
    text-align: center;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.play-again-button:hover {
    background: linear-gradient(180deg, #E0A800 0%, #A57A00 100%);
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Game content */
#game-container {
    margin: 0 auto;
    width: 95%;
    max-width: 917px;
    min-height: 420px;
    background: linear-gradient(180deg, #253131 0%, #4E6764 100%);
    border-radius: 45px;
    border: 4px solid #E6E6E6;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.game-instruction {
    color: #e6e6e6;
    font-size: 36px;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
    text-align: center;
}

#menu-cat {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px;
    height: auto;
    border-radius: 40px;
}

/* Search bar */
.search-area-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    width: 100%;
    z-index: 10;
}

.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.search-bar-outer {
    position: relative;
    background-color: #e6e6e6;
    border-radius: 15px;
    padding: 5px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 580px;
    height: 60px;
    border: 3px solid #000;
    z-index: 1001;
}

#search-bar {
    width: 430px;
    height: 20px;
    border-radius: 10px;
    border: 2px solid #000;
    background: #d9d9d9;
    padding: 10px;
    font-size: 16px;
    outline: none;
    margin-left: 16px;
}

#search-button {
    position: absolute;
    right: 10px;
    width: 84px;
    height: 46px;
    border-radius: 10px;
    border: 2px solid #000;
    background: linear-gradient(180deg, #FEC200 0%, #C99102 100%);
    color: #E4E3E3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Impact;
    font-size: 34px;
    line-height: normal;
    -webkit-text-stroke-width: 2px;
    text-shadow: 0px 0px 3px black;
    -webkit-text-stroke-color: #000;
    text-align: center;
    transition: background 0.2s ease;
}

#search-button:hover {
    background: linear-gradient(180deg, #E0A800 0%, #A57A00 100%);
}

/* Search Results */
#results-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid #000;
    border-radius: 10px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    width: 580px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cat-result {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
}

.cat-result:hover {
    background: #f0f0f0;
}

.search-cat-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Display for results */
#cat-details-container {
    padding: 5px;
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
}

#headers {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 5px;
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
    box-sizing: border-box;
    text-align: center;
}

.header-item {
    width: 120px;
    height: 100px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin: 0 3px;
    padding: 10px;
    font-family: 'Humato Heavy';
    font-size: 24px;
    color: black;
    -webkit-text-stroke: .3px white;
}

.cat-details-element {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    gap: 20px;
}

/* Boxes */
.cat-detail {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    text-align: center;
    border: 3px solid #000000;
    padding: 10px;
    margin: 0 3px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 16px;
    color: white;
    height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    white-space: normal;
}

.cat-img-container {
    width: 135px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.cat-img-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.cat-img {
    width: 110px;
    height: 110px;
    border: none;
}

.cat-details p {
    margin: 0;
}

/* Box styling */
.green-box {
    background-color: #3AC224;
    color: white;
    padding: 10px;
    border-radius: 30px;
    font-family: 'Impact';
    font-size: 24px;
    max-height: 110px;
    max-width: 110px;
}

.red-box {
    background-color: #B21E1E;
    color: white;
    padding: 5px;
    border-radius: 10px;
    font-family: 'Impact';
    font-size: 14px;
}

.yellow-box {
    background-color: #E09E1E;
    color: white;
    padding: 5px;
    border-radius: 10px;
    font-family: 'Impact';
    font-size: 14px;
}

.cat-details-element .red-box,
.cat-details-element .green-box,
.cat-details-element .yellow-box {
    width: 110px;
    max-width: 110px;
    height: 110px;
    max-height: 110px;
    padding: 10px;
    border-radius: 30px;
    font-family: 'Impact';
    font-size: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    word-wrap: break-word;
    white-space: normal;
}

/* Icons (abilities, traits, attack) */
.cat-detail .traits-container,
.cat-detail .abilities-container,
.cat-detail .attack-type-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 2px;
    gap: 5px;
}

.cat-detail img:not(.cat-img) {
    width: 30px;
    height: 30px;
}

/* Overflow traits (future proof sort of, adjust if traits get added to game) */
.cat-detail[data-trait-count="10"] img:not(.cat-img),
.cat-detail[data-trait-count="11"] img:not(.cat-img),
.cat-detail[data-trait-count="12"] img:not(.cat-img) {
    width: 25px;
    height: 25px;
}

.cat-detail.small-font {
    width: 25px;
    height: 25px;
}

/* Arrows */
.single-up,
.single-down,
.double-up,
.double-down {
    flex: 1;
    text-align: center;
    border: 3px solid #000000;
    padding: 10px;
    margin: 0 3px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: 'Impact';
    font-size: 24px;
    color: white;
    width: 110px;
    max-width: 110px;
    height: 110px;
    max-height: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    white-space: normal;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.single-up {
    background-image: url('../images/assets/UpArrow.png');
}

.single-down {
    background-image: url('../images/assets/DownArrow.png');
}

.double-up {
    background-image: url('../images/assets/DoubleUpArrow.png');
}

.double-down {
    background-image: url('../images/assets/DoubleDownArrow.png');
}

/* Header Bar */
.header-bar {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 0 auto 40px auto;
    padding: 10px;
    background: linear-gradient(180deg, #253131 0%, #4E6764 100%);
    border-radius: 20px;
    border: 4px solid #E6E6E6;
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.header-button {
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: transparent;
    border: none;
}

.header-button:hover {
    transform: scale(1.1);
}

.header-icon {
    width: 60px;
    height: 60px;
}

.header-button::after {
    content: attr(aria-label);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #e6e6e6;
    color: #333;
    padding: 6px 10px;
    border: 2px solid #000;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-button:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Hint */
.hint-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.hint-box {
    width: 210px;
    height: 100px;
    background-color: #e6e6e6;
    border: 3px solid #000;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    cursor: default;
    transition: background-color 0.3s;
}

.hint-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.hint-icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.hint-text {
    font-family: 'Impact', sans-serif;
    font-size: 18px;
    color: #333;
    text-align: center;
    padding: 0 10px;
}

.hint-reveal-box {
    width: 180px;
    background-color: #f0f0f0;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 12px;
    display: none;
    text-align: center;
    margin-top: 10px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #333;
}

.hint-reveal-text {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Modal Boxes */
.info-box,
.changelog-box,
.about-box {
    text-align: left;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(180deg, #253131 0%, #4E6764 100%);
    border-radius: 20px;
    border: 4px solid #E6E6E6;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-height: 70vh;
    width: 80%;
    max-width: 750px;
    overflow-y: auto;
    padding: 0px 25px 25px;
}

.info-box.active,
.changelog-box.active,
.about-box.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.info-box h3,
.changelog-section h3,
.about-section h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #E4E3E3;
    font-family: 'Helvetica', sans-serif;
    text-align: left;
}

.changelog-section h3 {
    color: #ffbe0a;
}

.info-box p,
.info-box li,
.about-section p,
.changelog-section li {
    line-height: 1.6;
    color: #E4E3E3;
}

.info-box ul,
.changelog-section ul {
    padding-left: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.info-separator {
    border: 0;
    height: 3px;
    background: #E4E3E3;
    margin: 10px 0 20px 0;
    width: 100%;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

body.overlay-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Version section */
.version-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 2px solid #FEC200;
}

.version-text {
    color: #FEC200;
    font-family: 'Helvetica', sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Info box content styles */
.category-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.category-box {
    background: #FFA824;
    color: #000;
    width: 111px;
    height: 111px;
    border-radius: 10px;
    border: 2px solid #E67300;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    position: relative;
}

.category-box img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 15px;
}

.category-box span {
    font-size: 14px;
}

.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 75px;
    justify-content: center;
    margin-top: 15px;
}

.form-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.form-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 10px;
    border: 3px solid #E6E6E6;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

.form-label {
    margin-top: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #E6E6E6;
    text-align: center;
    font-family: 'Helvetica', sans-serif;
}

.roles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.role-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
}

.role-name {
    margin-top: 5px;
    font-size: 18px;
    font-weight: bold;
    color: #ffbe0a;
    text-align: center;
    font-family: 'Helvetica', sans-serif;
}

.role-class {
    margin-top: 4px;
    font-size: 16px;
    color: #FFF;
    text-align: center;
    font-style: italic;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.info-box .traits-container,
.info-box .attack-types-container,
.info-box .abilities-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.info-box .trait-item,
.info-box .attack-type-item,
.info-box .ability-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.info-box .trait-icon,
.info-box .attack-type-icon,
.info-box .ability-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    padding: 5px;
}

.info-box .trait-label,
.info-box .attack-type-label,
.info-box .ability-label {
    margin-top: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #FFF;
    text-align: center;
    font-family: 'Helvetica', sans-serif;
}

.info-box .ability-icon[src*="x.png"] {
    filter: brightness(1.5);
    padding: 3px;
}

.info-box .attack-type-item {
    width: 90px;
}

.cost-examples-container,
.version-examples-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    height: 170px;
}

.cost-example,
.version-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.example-cat-detail {
    width: 110px;
    height: 110px;
    border: 3px solid #000000;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Impact';
    font-size: 24px;
}

.example-label {
    font-size: 14px;
    color: #E6E6E6;
    text-align: center;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
}

.example-description {
    font-size: 14px;
    color: #E6E6E6;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

/* Scrollbars */
#results-container::-webkit-scrollbar,
.info-box::-webkit-scrollbar,
.changelog-box::-webkit-scrollbar {
    width: 10px;
}

#results-container::-webkit-scrollbar-track {
    background: #e6e6e6;
    border-radius: 10px;
}

.info-box::-webkit-scrollbar-track,
.changelog-box::-webkit-scrollbar-track {
    background: transparent;
    margin: 15px 0;
    border-radius: 10px;
}

#results-container::-webkit-scrollbar-thumb {
    background-color: #c0c0c0;
    border-radius: 10px;
    border: 2px solid #e6e6e6;
}

.info-box::-webkit-scrollbar-thumb,
.changelog-box::-webkit-scrollbar-thumb {
    background: #FEC200;
    border-radius: 10px;
    border: 2px solid #253131;
    background-clip: padding-box;
}

#results-container::-webkit-scrollbar-thumb:hover {
    background-color: #a0a0a0;
}

/* Victory screen */
.victory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.victory-screen.active {
    display: flex;
    opacity: 1;
}

.victory-content {
    background: linear-gradient(180deg, #253131 0%, #4E6764 100%);
    border: 4px solid #E6E6E6;
    border-radius: 25px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: victoryPopIn 0.5s ease-out;
}

@keyframes victoryPopIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.victory-header h2 {
    color: #FEC200;
    font-family: 'Humato Heavy', 'Arial Black', sans-serif;
    font-size: 42px;
    margin-bottom: 25px;
    text-align: center;
}

.victory-cat-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
}

.victory-cat-image img {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    object-fit: cover;
    flex-shrink: 0;
}

.victory-cat-text {
    text-align: left;
    flex: 1;
}

.cat-unit-label {
    color: #E6E6E6;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 14px;
    font-family: 'Helvetica', sans-serif;
}

.victory-cat-text h3 {
    color: #FEC200;
    font-family: 'Humato Heavy', sans-serif;
    font-size: 28px;
    margin: 0;
    line-height: 1.2;
}

.victory-guesses-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.guesses-label {
    color: #E6E6E6;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Helvetica', sans-serif;
}

.guesses-count {
    color: #FEC200;
    font-family: 'Helvetica', sans-serif;
    font-size: 24px;
}

.victory-timer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.timer-label {
    color: #E6E6E6;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Helvetica', sans-serif;
}

.timer-value {
    color: #FEC200;
    font-family: 'Helvetica', sans-serif;
    font-size: 24px;
}

.wordlecats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.wordlecats-text {
    color: #E6E6E6;
    font-family: 'Helvetica', sans-serif;
    font-size: 18px;
    font-weight: bold;
}

.wordlecats-link {
    display: block;
    transition: transform 0.2s ease;
}

.wordlecats-link:hover {
    transform: scale(1.05);
}

.wordlecats-logo {
    width: 200px;
    height: auto;
    border-radius: 10px;
}

/* Yesterdays Answer */
.yesterdays-answer {
    text-align: center;
    margin: 10px 0;
}

.yesterday-text {
    color: #E6E6E6;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.yesterday-text span {
    color: #FEC200;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
}

.yesterday-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* Hide yesterdays answer in infinite mode */
body.infinite-mode .yesterdays-answer {
    display: none;
}