/* 共通スタイル */
body {
    margin: 0;
    padding: 20px 10px;
    background: #111;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.thumb-left img {
    max-width: 700px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: -10px;
}

.sub-thumb img {
    margin-top: -20px;
    margin-bottom: -15px;
}

.image-title {
    text-align: center;
    margin: 0;
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 6px #ffa500;
}

.x-link {
    text-align: center;
    margin: 0;
    font-size: 16px;
    color: #ffa500;
    text-shadow: 0 0 6px #ffa500;
}

.x-link a {
    color: #00ffe7;
    text-decoration: underline;
}

/* カードエリア */
#cardContainer {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 400px;
    margin-top: 20px;
}

/* カードベース */
.card {
  position: absolute;
  width: 60px;
  height: 85px;
  background-color: transparent;
  border-radius: 8px;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* カード内部（表裏を含む） */
.card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
  position: relative;
}

/* 裏返し時のアニメーション */
.card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* カードの表と裏 */
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  box-shadow: 0 0 8px rgba(0, 255, 231, 0.6);
}

/* 表面（数字表示） */
.card-front {
  background: linear-gradient(145deg, #fefefe, #dddddd);
  color: #222;
  transform: rotateY(180deg);
  text-shadow: 0 0 1px #fff;
}

/* 裏面（文字 "Card"） */
.card-back {
  background: linear-gradient(145deg, #333, #111);
  color: #aaa;
  backface-visibility: hidden;
}

.card.correct {
    border: 4px solid #ffff33;
    box-shadow: 0 0 18px #ffff33, 0 0 24px #ffff33;
}

.card.wrong {
    border: 4px solid #ff4444;
    box-shadow: 0 0 18px #ff4444, 0 0 24px #ff4444;
}

@keyframes shake-absolute {
    0% {
        left: 0px;
        top: 0px;
    }

    20% {
        left: -3px;
        top: 0px;
    }

    40% {
        left: 3px;
        top: 0px;
    }

    60% {
        left: -2px;
        top: 0px;
    }

    80% {
        left: 2px;
        top: 0px;
    }

    100% {
        left: 0px;
        top: 0px;
    }
}

.card.shake {
    animation: shake-absolute 0.3s;
}

/* カードの表裏 */
.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.card-front {
    background-color: #00ffe7;
    color: #000;
    transform: rotateY(180deg);
    font-weight: bold;
    font-size: 36px;
    box-shadow: inset 0 0 8px #00ffe7;
}

.card-back {
    background-color: #333;
    font-size: 16px;
}

/* ボタン群 */
.button-group {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    background-color: #00ffe7;
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 0 12px #00ffe7, 0 0 24px #00ffe7;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 16px #00ffe7, 0 0 32px #00ffe7;
}

/* タイマー表示 */
#timer {
    margin-top: 15px;
    font-size: 20px;
    color: #00ffe7;
    text-shadow: 0 0 6px #00ffe7;
}

/* モーダル表示 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #111;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #00ffe7;
    box-shadow: 0 0 20px #00ffe7;
}

.modal-content h2 {
    font-size: 28px;
    color: #ffff33;
    text-shadow: 0 0 6px #ffff33;
    margin-bottom: 10px;
}

.modal-content p {
    color: #00ffe7;
    font-size: 18px;
    margin-bottom: 20px;
}

.modal-content button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #00ffe7;
    color: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 12px #00ffe7;
    cursor: pointer;
}

.logo-footer {
    text-align: center;
    margin-top: 30px;
}

.logo-footer a {
    display: inline-block;
}

.logo-footer img {
    max-width: 75px;
    width: 100%;
    height: auto;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.logo-footer img:hover {
    opacity: 1;
}
