body {
    background: #000;
    color: #b0b8c1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
}

html, body {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* MENU CSS START */
.menu-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background: #2a2a2a;
    color: #3fae5a;
    padding: 20px;
    z-index: 9999;
    -webkit-user-select: none;
    user-select: none;
    box-sizing: border-box;
}

.menu-logo {
    line-height: 0;
    margin: 0 20px;
}

    .menu-logo img {
        max-height: 40px;
        max-width: 100px;
        flex-shrink: 0;
    }

.menu-container a {
    text-decoration: none;
    color: #2a2a2a;
    transition: color 0.3s ease;
}

    .menu-container a:hover {
        color: #aef4e9;
    }

.menu-container input {
    display: block;
    width: 35px;
    height: 25px;
    margin: 0;
    position: absolute;
    cursor: pointer;
    opacity: 0; /* hide this */
    z-index: 2; /* and place it over the hamburger */
    -webkit-touch-callout: none;
}

/* Burger menu */
.menu-container span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    position: relative;
    background: #3fae5a;
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0px;
    transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0), background 0.5s cubic-bezier(0.77,0.2,0.05,1.0), opacity 0.55s ease;
}

    .menu-container span:first-child {
        transform-origin: 0% 0%;
    }

    .menu-container span:nth-child(3) {
        transform-origin: 0% 100%;
    }

.menu-container input:checked ~ span {
    opacity: 1;
    transform: rotate(45deg) translate(3px,-1px);
    background: #2a2a2a;
}

    .menu-container input:checked ~ span:nth-child(4) {
        opacity: 0;
        transform: rotate(0deg) scale(0.2, 0.2);
    }

    .menu-container input:checked ~ span:nth-child(3) {
        transform: rotate(-45deg) translate(-5px,11px);
    }

.menu ul {
    list-style: none;
}

.menu li {
    padding: 10px 0;
    font-size: 22px;
}

/* mobile styles */
@media only screen and (max-width: 767px) {
    .menu-container {
        flex-direction: column;
        align-items: flex-end;
    }

    .menu-logo {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
    }

        .menu-logo img {
            max-height: 30px;
        }

    .menu {
        position: absolute;
        box-sizing: border-box;
        width: 300px;
        right: -300px;
        top: 0;
        margin: -20px;
        padding: 75px 15px 50px;
        background: #3fae5a;
        -webkit-font-smoothing: antialiased;
        /* to stop flickering of text in safari */
        transform-origin: 0% 0%;
        transform: translateX(0%);
        transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    }

    .menu-container input:checked ~ .menu {
        transform: translateX(-100%);
    }
}

/* desktop styles */
@media only screen and (min-width: 768px) {
    .menu-container {
        width: 100%;
    }

        .menu-container a {
            color: #3fae5a;
        }

        .menu-container input {
            display: none;
        }

        /* Burger menu */
        .menu-container span {
            display: none;
        }

    .menu {
        position: relative;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

        .menu ul {
            display: flex;
            padding: 0;
        }

        .menu li {
            padding: 0 20px;
        }
}
/* MENU CSS END */

.leaderboard-top {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
    padding-left: 8px;
    padding-right: 8px;
}

.leaderboard-header {
    width: 100%;
    box-sizing: border-box;
    padding: 1.2em 0 0.7em 0;
    font-size: 2em;
    font-weight: bold;
    color: #3fae5a;
    background: transparent;
    letter-spacing: 0.02em;
    z-index: 10;
    text-align: center;
    margin-bottom: 0.2em;
    margin-left: 0.1em;
}

.search-box {
    display: flex;
    align-items: center;
    border: 2px solid #3fae5a;
    border-radius: 14px;
    padding: 0.5em 1em;
    background: rgba(20, 20, 20, 0.8);
    width: 90vw;
    max-width: 600px;
    margin-bottom: 1em;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #b0b8c1;
    font-size: 1.3em;
    padding: 0.7em 0.5em;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: center;;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    color: #3fae5a;
    font-size: 1.7em;
    padding: 0 0.3em;
    display: flex;
    align-items: center;
    min-width: 0;
    box-sizing: border-box;
}

.credit {
    text-align: center;
    font-size: 0.95em;
    color: #3fae5a;
    margin-top: 0.5em;
}

.credit a {
    color: #3fae5a;
    text-decoration: underline;
    font-weight: bold;
    background: linear-gradient(90deg, #ff5f7b, #f7b42c, #13e6a1, #49b7f6, #b36ff6, #ff5f7b);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text 2.5s linear infinite;
    transition: text-decoration-color 0.2s;
}
@keyframes rainbow-text {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.rainbow-text {
  background: linear-gradient(90deg, #ff5e62, #ff9966, #f9d423, #a1ffce, #3fae5a, #36a2eb, #b16cea, #ff5e62);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-text 3s linear infinite;
  font-weight: bold;
}
@keyframes rainbow-text {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 350px));
    gap: 16px;
    padding: 0 50px;
    box-sizing: border-box;
    margin-top: 2em;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.card {
    background-color: #e0f0ff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: grid;
    grid-template-areas: "header" "scores";
    grid-row-gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.card-header {
    grid-area: header;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 20px;
    border-bottom: 1px solid #a9a6a6;
    font-weight: bold;
    font-size: 0.8rem;
    color: #024a75;
}

.card-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: #024a75;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scores {
    grid-area: scores;
}
.scores table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-bottom: 0;
}
.scores th,
.scores td {
    padding: 6px 8px;
    line-height: 1.5;
}
.scores th {
    text-align: left;
    color: #00a56f;
    font-weight: 700;
    width: 18%;
    letter-spacing: 0.02em;
}
.scores td {
    text-align: right;
    color: #555555;
    width: 41%;
    background: none;
}
.scores td.rank {
    padding-left: 5px;
    text-align: right;
    color: #ff5f7b;
}
.scores tr:not(:last-child) {
    border-bottom: none;
}
.card .scores {
    margin-top: 0;
    margin-bottom: 0;
}

.search-area {
    display: flex;
    flex-direction: column;
    align-items: center; /* 중앙 정렬 */
    justify-content: center;
    transition: all 0.9s cubic-bezier(.4,2,.6,1);
    position: relative;
    z-index: 2;
    margin: 0 auto;
    width: 100%;
    max-width: 700px;
    min-height: 60vh;
}

.search-area--centered {
    min-height: 60vh;
    justify-content: center;
    align-items: center;
}

.search-area--top {
    min-height: 0;
    justify-content: flex-start;
    margin-bottom: 1.5em;
    align-items: center; /* 중앙 정렬로 변경 */
}
.search-area--top input {
    padding: 0 3px;
}

.search-area .search-box {
    transition: all 0.5s cubic-bezier(.4,2,.6,1);
    width: 90vw;
    max-width: 600px;
    font-size: 1.3em;
}

.search-area--top .search-box {
    width: 350px;
    max-width: 90vw;
    font-size: 1em;
}

.leaderboard-top, .search-results, .search-area {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

#searchStatus {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    margin-bottom: 0.5em;
}
.loading-message {
    display: flex;
    align-items: center;
    gap: 0.7em;
    font-size: 1.2em;
    color: #3fae5a;
    text-align: center;
}
.loader-spinner {
    width: 28px;
    height: 28px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #3fae5a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.recent-search-list {
    list-style: none;
    margin: 0.5em 0 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    justify-content: flex-start;
}
.recent-search-item {
    background: #222;
    color: #3fae5a;
    border-radius: 6px;
    padding: 0.3em 0.9em;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.15s, color 0.15s;
    border: 1px solid #3fae5a;
}
.recent-search-item:hover {
    background: #3fae5a;
    color: #111;
}

.recent-search-remove {
    display: inline-block;
    margin-left: 0.5em;
    color: #888;
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.15s;
    vertical-align: middle;
}
.recent-search-remove:hover {
    color: #f77;
}

.kaito-receive-btn {
    display: block;
    padding: 0.5em 1.5em;
    border-radius: 20px;
    background: #222;
    color: #fff;
    border: 1.5px solid #3fae5a;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
    box-shadow: 0 2px 8px rgba(63,174,90,0.08);
}
.kaito-receive-btn:hover:enabled {
    background: #3fae5a;
    color: #111;
    border-color: #3fae5a;
}
.kaito-extra {
    margin-top: 0.7em;
    font-size: 0.95em;
    color: #3fae5a;
    word-break: break-all;
}
.kaito-result {
    background: #181818;
    color: #fff;
    border-radius: 8px;
    padding: 0.7em;
    margin: 0.5em 0 0 0;
    font-size: 0.92em;
    overflow-x: auto;
}

.kaito-receive-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.kaito-receive-btn.loading {
    position: relative;
    color: #3fae5a;
}
.kaito-receive-btn.loading::after {
    content: '';
    display: inline-block;
    margin-left: 0.7em;
    width: 1em;
    height: 1em;
    border: 2.5px solid #e0e0e0;
    border-top: 2.5px solid #3fae5a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}
.kaito-receive-btn:disabled:hover {
    cursor: not-allowed;
}
.kaito-receive-btn.disabled-x:hover {
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .search-results {
        grid-template-columns: 1fr;
        padding: 0 4vw;
        max-width: 90vw !important;
    }
    .card {
        padding: 1em 0.5em;
        border-radius: 10px;
    }
    .scores table {
        font-size: 0.92rem;
    }
    .scores th, .scores td {
        padding: 5px 4px;
    }
    .search-area .search-box,
    .search-area--top .search-box {
        width: 90vw;
        max-width: 99vw;
        min-width: 0;
        box-sizing: border-box;
    }
    .leaderboard-top, .search-area, .search-area--top {
        max-width: 100vw;
        padding: 0 1vw;
    }
    .recent-search-list {
        font-size: 0.97em;
        gap: 0.3em;
    }
    .recent-search-item {
        padding: 0.25em 0.7em;
    }
}

@media (max-width: 1300px) {
    .search-results, .leaderboard-top {
        max-width: 98vw;
        padding-left: 2vw;
        padding-right: 2vw;
    }
}

/* PROJECT STATUS CSS START */
.project-status {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 0 32px 0;
}

.description{
    font-size:1.5em;
    text-align:center;
    margin-bottom:20px;
}

.status-search-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5em;
}
#statusSearchInput {
    width: 350px;
    max-width: 90vw;
    padding: 0.7em 1em;
    border-radius: 10px;
    border: 1.5px solid #3fae5a;
    font-size: 1.1em;
    background: #181818;
    color: #fff;
    outline: none;
    box-sizing: border-box;
    text-align:center;
}

.status-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.status-card {
    background: #18191c;
    color: #e0f0ff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
    padding: 1.2em 1.2em 1em 1.2em;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position:relative;
}

.status-card .status-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 0.7em;
    color: #3fae5a;
    letter-spacing: 0.01em;
}

.status-card .status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
    margin-bottom: 0;
}
.status-card .status-table th,
.status-card .status-table td {
    padding: 4px 8px;
    text-align: left;
}
.status-card .status-table th {
    color: #13e6a1;
    font-weight: 700;
    width: 40%;
}
.status-card .status-table td {
    color: #fff;
    text-align: right;
    width: 60%;
}
/* PROJECT STATUS CSS END */

/* Chart(챠트) 버튼 스타일 */
.chart-icon-btn {
    float: right;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #23272b;
    border: 1.5px solid #3fae5a;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    margin-left: 8px;
    position:absolute;
    top:10px;
    right:10px;
}
.chart-icon-btn:hover {
    background: #2e3a2f;
    box-shadow: 0 2px 8px rgba(63,174,90,0.13);
}
.chart-icon-btn svg {
    display: block;
}

/* Modal 팝업 스타일 */
.project-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.project-modal.active {
    display: flex;
}
.modal-content {
    background: #23272b;
    padding: 2em 2.5em 2em 2.5em;
    border-radius: 16px;
    max-width: 420px;
    width: 90vw;
    height: 80vh !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    position: relative;
    margin: auto;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #3fae5a;
    margin-bottom: 1em;
}
.modal-body {
    color: #e0f0ff;
    min-height: 60px;
    overflow-y: auto;
    flex: 1 1 auto;
    scrollbar-width: none;
}
.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #fff;
    cursor: pointer;
    z-index: 2;
}

.modal-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}
.modal-loading-spinner::after {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  border: 4px solid #3fae5a;
  border-top: 4px solid #23272b;
  border-radius: 50%;
  animation: modal-spin 1s linear infinite;
}
@keyframes modal-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 700px;
    width: 90vw;
    padding: 2.2em 2.5em 2.2em 2.5em;
    max-height: 90% !important;
  }
}

.summary-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  justify-content: center;
}
.summary-tab-btn {
  background: none;
  border: none;
  color: #b0b8c1;
  font-size: 1.08em;
  font-weight: 600;
  padding: 7px 22px;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.summary-tab-btn.active {
  background: linear-gradient(90deg, #3fae5a 0%, #b3e6ff 100%);
  color: #23272b;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 600px) {
  .summary-cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .summary-card {
    padding: 0.4em 0.3em 0.4em 0.3em !important;
    border-radius: 7px !important;
    min-height: 54px !important;
  }
  .summary-card-label {
    font-size: 0.72em !important;
    margin-bottom: 0.1em !important;
    min-height: 1.2em !important;
  }
  .summary-card-value {
    font-size: 1em !important;
    margin-top: 0.05em !important;
  }
  .rank-table-scroll::-webkit-scrollbar {
    width: 7px !important;
    background: #23272b !important;
  }
  .rank-table-scroll::-webkit-scrollbar-thumb {
    background: #3fae5a !important;
    border-radius: 6px !important;
  }
}
.summary-card {
  background: #23272b;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 1.3em 1.2em 1.1em 1.2em;
  border: 2px solid transparent;
  border-image: linear-gradient(90deg, #3fae5a 0%, #b3e6ff 100%);
  border-image-slice: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  /* 카드 높이 통일 */
  min-height: 110px;
  justify-content: center;
}
.summary-card-label {
  color: #b0b8c1;
  font-size: 1.02em;
  font-weight: 600;
  margin-bottom: 0.5em;
  letter-spacing: 0.02em;
  min-height: 2.2em;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.summary-card-value {
  color: #fff;
  font-size: 2em;
  font-weight: bold;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0 auto;
  margin-top: 0.1em;
}

@media (max-width: 600px) {
    .project-modal {
        display: none;
        position: fixed;
        z-index: 9999;
        left: 0; top: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.65);
        align-items: flex-start;
        justify-content: flex-start;
    }
    .project-modal.active {
        display: block;
    }
    .modal-content {
        border-radius: 0;
        max-width: 100vw;
        padding: 2.2em 1.2em 2em 1.2em;
        box-shadow: none;
    }
    .modal-close {
        top: 16px;
        right: 16px;
        font-size: 2em;
    }
}

/* Update Note CSS START */
.update-note {
    max-width: 700px;
    margin: 40px auto 0 auto;
    background: #18191c;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
    padding: 2em 2em 2.5em 2em;
    color: #e0f0ff;
}
.update-note-title {
    text-align: center;
    color: #3fae5a;
    font-size: 2em;
    margin-bottom: 1.5em;
    font-weight: bold;
}
.update-list {
    margin: 0;
    padding: 0;
}
.update-date {
    font-size: 1.15em;
    color: #13e6a1;
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.update-desc {
    margin: 0 0 0.5em 1.2em;
    padding-left: 0;
}
.update-desc li {
    margin-bottom: 0.3em;
    font-size: 1.08em;
    line-height: 1.5;
    list-style: disc;
}
/* Update Note CSS END */

.toast-message {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    background: rgba(30, 32, 36, 0.97);
    color: #ff6f6f;
    padding: 0.9em 2.2em;
    border-radius: 2em;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.toast-message.show {
    opacity: 1;
    pointer-events: auto;
}
.rank-table tr td{
    text-align: center;
}
.rank-table-scroll {
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 12px;
  border: 1px solid #00ff3e
}
@media (max-width: 600px) {
  .rank-table-scroll {
    max-height: 280px !important;
  }
}
.rank-table-scroll::-webkit-scrollbar {
  width: 7px;
  background: #23272b;
}
.rank-table-scroll::-webkit-scrollbar-thumb {
  background: #3fae5a;
  border-radius: 6px;
}