body {
  margin: 0;
  font-family: sans-serif;
  background: #1f2937;
  color: white;
  text-align: center;
}

.game {
  max-width: 950px;
  margin: 0 auto;
  padding: 24px;
}

.status{
    width: 760px;
    height: 340px;
    max-width: 100%;

    margin: 0 auto -50px;

    background: url("images/panel-status.png") center/100% 100% no-repeat;

    padding: 85px 110px;
    box-sizing: border-box;

    border: none;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    text-align: left;
}

.status-left,
.status-right{
    width: 42%;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status p{
    margin: 0;
    color: #f5f1e6;
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 30px 0;
}

.card {
  width: 150px;
  height: 210px;
  border-radius: 14px;
  background: #374151;
  border: 2px solid #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  font-size: 22px;
}

.card:hover {
  transform: translateY(-6px);
}

.card.back {
    background: url("images/card-back.png") center center;
    background-size: cover;
    background-repeat: no-repeat;

    border: none;
    border-radius: 14px;

    color: transparent;
    font-size: 0;
}

.card.open {
    background-color: white;
    background-image: none !important;
    color: #111827;
    flex-direction: column;
    padding: 10px;
}

.card.disabled {
  pointer-events: none;
  opacity: 0.5;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: 900px;
    height: 650px;

    background: url("images/panel-howto.png") center center;
    background-size: contain;
    background-repeat: no-repeat;

    background-color: transparent;

    border: none;

    padding: 90px 100px;
    box-sizing: border-box;

    color: #fff5d6;
    text-align: center;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 34px;
    color: #fff5d6;
}

.modal-content button {
    margin: 0;
}

/* タイトル画面 */
#titleScreen {
    width: 100%;
    height: 100vh;

    background-image: url("images/title-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    color: white;
}

/* 背景を少し暗くして文字を見やすくする */
#titleScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}

#titleScreen h1,
#titleScreen p,
#titleScreen button {
    position: relative;
    z-index: 1;
}

#titleLogo {
    width: 650px;
    max-width: 90%;
    margin-bottom: -80px;
}

#titleScreen p {
    margin: 6px 0;
}

#newGameButton,
#howToButton,
#continueButton {
    width: 500px;
    height: 120px;

    border: none;
    background-color: transparent;
    cursor: pointer;

    font-size: 0;
    color: transparent;

    margin: -34px 0;

    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;

    transition: transform .2s ease;
}

#newGameButton {
    background-image: url("images/btn-new-game (1).png");
}

#howToButton {
    background-image: url("images/btn-howto.png");
}

#continueButton {
    background-image: url("images/btn-continue.png");
}

#newGameButton:hover,
#howToButton:hover,
#continueButton:hover {
    transform: scale(1.05);
}

#newGameButton:active,
#howToButton:active,
#continueButton:active {
    transform: scale(0.96);
}

/* =========================
   ゲーム画面背景
========================= */

#gameScreen {
    min-height: 100vh;

    background-image: url("images/game-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    position: relative;
}

/* 背景を少し暗くする */
#gameScreen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
    pointer-events: none;
}

/* UIを背景より前に表示 */
#gameScreen .game {
    position: relative;
    z-index: 1;
}

#closeHowToButton{
    width: 380px;
    height: 105px;

    background: url("images/btn-close.png") center center;
    background-repeat: no-repeat;
    background-size: contain;

    border: none;
    cursor: pointer;

    color: transparent;
    font-size: 0;

    display: block;
    margin: 40px auto 0;
}

#closeHowToButton:hover{
    transform: scale(1.05);
}

#closeHowToButton:active{
    transform: scale(0.97);
}

#gameScreen .game,
#gameScreen button,
#cards,
.card {
    position: relative;
    z-index: 2;
}


.game-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

    margin: 20px auto 0;
    clear: both;
}

#nextButton{
    width: 220px;
    height: 60px;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

#menuButton{
    width: 240px;
    height: 60px;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}
#nextButton{
    background-image: url("images/btn-next.png");
    margin-right: -0px;
}

#menuButton{
    background-image: url("images/btn-menu.png");
    margin-left: 15px;
}

#nextButton{
    background-image: url("images/btn-next.png");
}

#menuButton{
    background-image: url("images/btn-menu.png");
}

#menuModal #closeButton {
    margin-top: 60px !important;
}

#nextButton:disabled{
    opacity: 0.35;              /* 暗くする */
    filter: grayscale(100%);    /* 少し白黒っぽく */
    cursor: not-allowed;
    pointer-events: none;
    transition: 0.3s;
}

#nextButton:not(:disabled){
    opacity: 1;
    filter: none;
    cursor: pointer;
}

#titleButton{
    width: 230px;
    height: 130px;

    background: url("images/btn-title.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;
}

#saveButton{
    width: 230px;
    height: 130px;

    background: url("images/btn-save.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;
}

#closeButton{
    width: 550px;
    height: 160px;

    background: url("images/btn-close.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;

    
}

#saveOkButton{
    margin-top: 230px;
}

#saveCloseButton{
    width: 550px;
    height: 160px;

    background: url("images/btn-close.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;

    display: block;
    margin: 200px auto 0;
}

#moneyCloseButton{
    width: 550px;
    height: 160px;

    background: url("images/btn-close.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;

    display: block;
    margin: 200px auto 0;
}

#dropoutCloseButton{
    width: 420px;
    height: 110px;

    background: url("images/btn-close.png") center center / contain no-repeat;

    border: none;
    background-color: transparent;

    color: transparent;
    font-size: 0;

    cursor: pointer;

    display: block;
    margin: 50px auto 0;
}

#creditButton{
    width: 150px;
    height: 120px;
    background: url("images/btn-credit.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    margin: -34px 0;
}

#creditCloseButton{
    width: 560px;
    height: 140px;
    background: url("images/btn-close.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    display: block;
    margin: 120px auto 0;
}

#confirmStartButton{
    width: 550px;
    height: 160px;
    background: url("images/btn-new-game.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    display: block;
    margin: 40px auto 0;
}

#newGameConfirmCloseButton{
    width: 420px;
    height: 90px;
    background: url("images/btn-close.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    display: block;
    margin: -20px auto 0;
}

#loadStartButton{
    width: 600px;
    height: 160px;
    background: url("images/btn-continue.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    display: block;
    margin: 40px auto 0;
}

#loadCloseButton{
    width: 480px;
    height: 140px;
    background: url("images/btn-close.png") center/contain no-repeat;
    border: none;
    background-color: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    display: block;
    margin: 80px auto 0;
}

#loadText{
    text-align: center;
    margin-top: 120px;
    margin-bottom: 40px;
    font-size: 28px;
    line-height: 1.8;
}

#moneyModalText {
    font-size: 38px;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    transform: translateY(60px);
}

#moneyCloseButton {
    transform: translateY(-90px);
}

#dropoutText {
    font-size: 34px;      /* 32～40pxで好みに調整 */
    font-weight: bold;
    text-align: center;
    line-height: 1.6;
    transform: translateY(20px);
}



#dropoutCloseButton {
    font-size: 24px;      /* 文字を大きく */
    width: 700px;         /* ボタンを横に大きく */
    height: 180px;         /* ボタンを縦に大きく */
    transform: translateY(110px); /* 下へ移動 */
}

#jobOfferModal .modal-content {
    text-align: center;
}

#acceptJobButton,
#declineJobButton {
    width: 260px;
    height: 70px;
    margin: 0;
}

#gameOverModal button {
    margin-top: 10px !important;
}

#studyWarningModal button{
    margin-top: 60px;
}

#studyWarningCloseButton{
    width: 260px;
    height: 70px;

    border: none;
    background: transparent;
    background-image: url("images/btn-close.png"); /* ボタン画像 */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    margin-top: 60px;
}

#studyWarningCloseButton {
    width: 520px;
    height: 160px;
    border: none;
    background-color: transparent;
    background-image: url("images/btn-close.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    margin-top: 50px;
}

#acceptJobButton{
    width: 260px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-accept.png");

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

#declineJobButton{
    width: 260px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-decline.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

.job-offer-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 25px;
}

#warningCloseButton{
    width: 260px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-close.png");

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    display: block;
    margin: 70px auto 0;
}

/* 健康警告モーダル */
#healthWarningModal .modal-content{
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 500px;
}

/* 健康警告 閉じるボタン */
#healthWarningCloseButton{
    width: 560px;
    height: 150px;

    border: none;
    background: url("images/btn-close.png") center/contain no-repeat;
    background-color: transparent;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    margin-top: auto;
    margin-bottom: 30px;
}

/* 精神警告モーダル */
#mentalWarningModal .modal-content{
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 500px;
}

/* 精神警告 閉じるボタン */
#mentalWarningCloseButton{
    width: 560px;
    height: 150px;

    border: none;
    background: url("images/btn-close.png") center/contain no-repeat;
    background-color: transparent;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    margin-top: auto;
    margin-bottom: 30px;
}

/* ゲームオーバー画面のボタン */
#gameOverRestartButton{
    width: 360px;
    height: 90px;

    border: none;
    background: url("images/btn-restart.png") center/contain no-repeat;
    background-color: transparent;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    display: block;
    margin: 80px auto 30px;
}

#purchaseModal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#purchaseText {
    margin-bottom: 40px;
}

/* 購入確認ボタン */
#purchaseAcceptButton,
#purchaseDeclineButton {
    display: block;
    width: 260px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

#purchaseAcceptButton {
    background-image: url("images/btn-buy.png");

    /* ← ここで下に下げる */
    margin: 60px auto 25px auto;
}

#purchaseDeclineButton {
    background-image: url("images/btn-not-buy.png");

    /* ← 承諾との間隔 */
    margin: 25px auto 0 auto;
}

/* 社会人生活モーダルの閉じるボタン */
#livingCostCloseButton {
    width: 580px;
    height: 170px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-close.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    display: block;

    /* ボタンを下に下げる */
    margin: 150px auto 20px;
}

#changeJobYesButton{
    width:220px;
    height:70px;
    background:url("images/change_job.png") no-repeat center;
    background-size:contain;
    border:none;
    cursor:pointer;
    color:transparent;
    display:block;
    margin:25px auto 15px;
}

#changeJobNoButton{
    width:220px;
    height:70px;
    background:url("images/not_change_job.png") no-repeat center;
    background-size:contain;
    border:none;
    cursor:pointer;
    color:transparent;
    display:block;
    margin:15px auto;
}

#promotionCloseButton {
    width: 660px;
    height: 170px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-close.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    display: block;
    margin: 150px auto 20px;
}

#saleModal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#saleText {
    margin-bottom: 70px;
}

#saleAcceptButton,
#saleDeclineButton {
    display: block;

    width: 260px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

#saleAcceptButton {
    background-image: url("images/sell.png");
    margin-bottom: 60px;
}

#saleDeclineButton {
    background-image: url("images/not_sell.png");
}

.card.normal-back{
    background-image: url("images/card-back.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.card.event-back{
    background-image: url("images/card_back_event_red.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}


.job-offer-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
}

.job-offer-buttons button {
    flex: none;
    width: 260px;
    height: 70px;
    margin: 0 !important;
}

.change-job-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

#changeJobYesButton,
#changeJobNoButton {
    width: 220px;
    height: 70px;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;

    margin: 0;
    flex: none;
}

#changeJobYesButton {
    background-image: url("images/btn-yes.png");
}

#changeJobNoButton {
    background-image: url("images/btn-no.png");
}

/* ===== 転職確認モーダル ===== */


.change-job-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
    margin: 0;
}

#changeJobYesButton,
#changeJobNoButton {
    flex: 0 0 220px;

    width: 220px;
    height: 70px;
    margin: 0 !important;

    border: none;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    color: transparent;
    font-size: 0;
    cursor: pointer;
}

#changeJobYesButton {
    background-image: url("images/change_job.png");
}

#changeJobNoButton {
    background-image: url("images/not_change_job.png");
}

#replenishButton {
    width: 260px;
    height: 90px;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-replenish.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    position: relative;
    cursor: pointer;

    color: white;
    font-size: 18px;
    font-weight: bold;
}

#lifeReserveCount {
    position: absolute;

    left: 50%;
    bottom: 25px;
    transform: translateX(-50%);

    width: 100%;
    text-align: center;

    color: white;
    font-size: 17px;
    font-weight: bold;

    text-shadow:
        2px 2px 3px black,
        -1px -1px 2px black;
}

/* ===== 補充ボタンと料金表示 ===== */

.replenish-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 2px;
}

#replenishButton {
    width: 280px;
    height: 95px;

    position: relative;

    border: none;
    background-color: transparent;
    background-image: url("images/btn-replenish.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    cursor: pointer;
}

#lifeReserveCount {
    position: absolute;

    left: 50%;
    bottom: 14px;

    transform: translateX(-50%);

    width: 100%;
    text-align: center;

    color: white;
    font-size: 17px;
    font-weight: bold;

    text-shadow:
        2px 2px 3px black,
        -1px -1px 2px black;
}

#replenishCostPanel {
    width: 240px;
    height: 44px;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: transparent;
    background-image: url("images/panel-replenish-cost.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

#replenishCostText {
    color: white;
    font-size: 14px;
    font-weight: bold;

    text-align: center;

    text-shadow:
        2px 2px 3px black,
        -1px -1px 2px black;
}

/* =========================
   ステータス増減アニメーション
========================= */

.status-change-area {
    position: relative;
    overflow: visible;
}

.status-change {
    position: absolute;

    left: 105%;
    top: 50%;

    min-width: 80px;

    font-size: 24px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;

    pointer-events: none;
    z-index: 100;

    text-shadow:
        2px 2px 3px black,
        -1px -1px 2px black;
}

/* 増加：下から上へ */
.status-change.increase {
    color: #66ff99;
    animation: statusIncrease 1.2s ease-out forwards;
}

/* 減少：上から下へ */
.status-change.decrease {
    color: #ff6666;
    animation: statusDecrease 1.2s ease-out forwards;
}

@keyframes statusIncrease {
    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateY(12px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-35px) scale(1);
    }
}

@keyframes statusDecrease {
    0% {
        opacity: 0;
        transform: translateY(-25px) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateY(-12px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(35px) scale(1);
    }
}