
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7f9; 
    color: #333;
    margin: 20px;
    padding: 0;
}


h1 {
    text-align: center;
    color: #333; 
    font-size: clamp(2em, 4vw, 3.5em); 
    font-weight: bold; 
    margin-bottom: 10px; 
    border-bottom: 3px solid #007BFF; 
    padding-bottom: 5px; 
    letter-spacing: 1px; 
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2); 
    font-family: 'Poppins', 'Arial', sans-serif; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: clip; 
    display: inline-block; 
    max-width: 100%; 
    transform-origin: center; 
    position: relative;
    z-index: 1;
}


h1 {
    font-size: clamp(1.5em, 3vw, 3em); 
    display: block; 
}



#update-time {
    text-align: center;
    font-size: 1.5em; 
    color: #666;
    margin-bottom: 5px; 
}


#notice {
    background-color: #f9f9f9;
    border-left: 5px solid #007BFF;
    padding: 10px;
    margin: 10px auto;
    width: 60%;
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    position: relative;
    text-align: center; 
}


#notice strong {
    font-size: 1.8em;
    color: #007BFF;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0px;
    text-decoration: underline;
    display: block;
}


#notice span.sub-text {
    font-size: 0.9em;
    display: block;
    text-align: center;
    color: #666;
    margin-bottom: 10px; 
}


#notice .important {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    padding: 5px 5px;
    line-height: 1.6;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

#notice .important span {
    display: block;
    font-size: 1.2em; 
    font-weight: bold;
    color: #333;
    margin-bottom: 5px; 
}

#notice .important small {
    display: block;
    font-size: 0.9em; 
    color: #666;
}


#notice .hidden-content {
    max-height: 3.5em;
    overflow: hidden;
    transition: max-height 0.5s ease;
    text-align: left;
    margin-top: 0px;
    padding: 0 5px;
}

#notice.expanded .hidden-content {
    max-height: 1000px; 
}


#notice button.toggle-btn {
    background-color: #007BFF;
    color: white;
    font-size: 0.9em;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 15px auto 0;
    display: block;
    transition: background-color 0.3s ease;
}

#notice button.toggle-btn:hover {
    background-color: #0056b3;
}


@media (max-width: 768px) {
    #notice {
        width: 90%; 
        font-size: 0.8em; 
    }

    #notice .important span {
        font-size: 1em; 
    }

    #notice .important small {
        font-size: 0.85em; 
    }

    #notice button.toggle-btn {
        font-size: 0.8em; 
        padding: 4px 8px;
    }
}



#content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}


.card-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ddd;
    padding: 5px;
    width: 155px;
    box-sizing: border-box;
    background-color: #FFFFFF;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    padding-bottom: 40px; 
}

.card-box .lazy-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
    display: block;
}

.card-box .card-name {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2px;
    color: #333;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-word;
    width: 100%;
}

.card-box .card-rarity {
    font-size: 0.8em;
    font-weight: bold;
    color: #666;
    line-height: 1.2;
    margin-bottom: 8px;
    width: 100%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    text-align: center; 
    word-break: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.card-box .card-number,
.card-box .card-expansion {
    font-size: 0.7em;
    color: #888;
    margin-bottom: 1px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-word;
    width: 100%;
}

.card-box .card-price {
    font-size: 1.7em;
    font-weight: bold;
    color: red;
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
    max-width: 90%;
    display: block;
    line-height: 1.1;
}

.card-box .card-price span {
    font-size: 0.6em;
    color: black;
}


.conditional-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #ddd;
    padding: 10px;
    width: 320px;
    background-color: #f9f9f9;
    color: #333;
    position: relative;
    box-sizing: border-box;
    transition: transform 0.3s, box-shadow 0.3s;
}


.conditional-box img {
    width: auto;
    height: 180px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 5px;
    display: block;
}

.conditional-box .details {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 50px;
}

.conditional-box .card-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
}

.conditional-box .rarity-price-wrapper {
    display: flex; 
    justify-content: center; 
    align-items: flex-end; 
    gap: 5px; 
    width: 100%; 
    position: absolute;
    bottom: 5px; 
    left: 50%;
    transform: translateX(-50%);
}

.conditional-box .rarity {
    font-size: 2em; 
    font-weight: bold;
    color: black;
    white-space: nowrap; 
    display: inline-block; 
    margin: 0; 
    line-height: 1; 
    align-self: flex-end; 
}

.conditional-box .price {
    font-size: 2.2em; 
    font-weight: bold;
    color: red; 
    text-align: center;
    white-space: nowrap; 
    display: inline-block; 
    margin: 0; 
    line-height: 1; 
}

.conditional-box button {
    display: block;
    margin: 10px auto 0;
    padding: 10px 20px;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}


.conditional-box .rarity-price-wrapper {
    padding-bottom: 5px; 
}

.conditional-box .price span {
    font-size: 0.8em; 
    font-weight: bold;
    color: black;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    text-align: left;
    max-width: 400px;
    border-radius: 5px;
}

.popup h2 {
    margin: 0 0 10px;
    text-align: center;
}

.popup ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.popup button {
    display: block;
    margin: 10px auto 0;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.popup button:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .popup {
        width: 70vw;
        max-width: none; 
        border-radius: 8px;
        font-size: 0.9em;
        text-align: center;
    }

    .popup h2 {
        font-size: 1.2em;
        margin-bottom: 8px;
    }

    .popup ul {
        margin: 10px 0;
        padding-left: 15px;
        font-size: 0.9em;
    }

    .popup button {
        font-size: 0.8em;
        padding: 8px 15px;
    }
}



.conditional-box button.notice-button {
    background: #007bff; 
    color: white;
}


.highlighted-box {
    border: 4px solid red;
    background: linear-gradient(to bottom, #fffacd, #ffd700);
    box-shadow: 0 4px 10px rgba(255, 165, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.highlighted-box .price {
    color: #d00000;
    font-weight: bold;
    text-shadow: 
        -2px -2px 0 #fff,
         2px -2px 0 #fff,
        -2px  2px 0 #fff,
         2px  2px 0 #fff;
}

.highlighted-box .price span {
    color: #333;
    font-weight: bold;
    text-shadow: 
        -2px -2px 0 #fff,
         2px -2px 0 #fff,
        -2px  2px 0 #fff,
         2px  2px 0 #fff;
}


.notice-hint {
    font-size: 1em;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 4px;
    line-height: 1.2;
}


.controls-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;  
  margin: 20px 0;
}


.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95em;
  align-items: center; 
}

.filter-block {
  display: flex;
  flex-direction: column;
  font-weight: bold;
  min-width: 300px;
}

.filter-block select {
  width: 360px;
  padding: 6px 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-top: 4px;
}

#sheetSelector {
  width: 400px;
  height: 50px;
  font-size: 1.2em; 
  padding: 6px 10px;
  box-sizing: border-box;
}

.filter-inline {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center; 
}

.filter-inline label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

#sortOrder,
#minPrice {
  padding: 6px 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#minPrice {
  width: 80px;
}

.search-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 15px;
  font-size: 1.05em;
  margin-top: 15px;
  font-weight: bold;
  justify-content: center; 
}

.search-group input[type="text"] {
  width: 300px;
  padding: 10px 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.search-group button {
  padding: 7px 14px;
  font-size: 1em;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.search-group button:hover {
  background-color: #0056b3;
}

@media screen and (max-width: 768px) {
  .search-group label {
    align-items: center;
    text-align: center;
  }
}



.table-view {
  width: 90%;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.95em;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table-view thead {
  background-color: #444;
  color: white;
}

.table-view th,
.table-view td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
}

.table-view tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}


.table-view th.col-expansion,
.table-view td.col-expansion {
    width: 10%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


@media (max-width: 768px) {
  .table-view {
    font-size: 12px;
  }

  .table-view th,
  .table-view td {
    padding: 4px 6px;
    font-size: clamp(9px, 2.4vw, 12px);
  }

  .table-view td:nth-child(1) {
    font-size: clamp(9px, 2.2vw, 12px);
    white-space: normal;
    word-break: break-word;
  }

  .table-view {
    overflow-x: auto;
    display: block;
  }
}
#card-boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px auto;
  max-width: 1500px; 
}


.expansion-effect    { background-color: #a0522d; color: white; }
.expansion-normal    { background-color: #deb887; }
.expansion-synchro   { background-color: #ffffff; }
.expansion-xyz       { background-color: #000000; color: white; }
.expansion-link      { background-color: #4169e1; color: white; }
.expansion-pendulum {
  background: linear-gradient(to right, #a0522d 50%, #228b22 50%);
  color: white;
}
.expansion-ritual    { background-color: #add8e6; }
.expansion-fusion    { background-color: #800080; color: white; }
.expansion-trap      { background-color: #b22222; color: white; }
.expansion-spell     { background-color: #228b22; color: white; }
