/* 全体スタイル */
body {
    font-family: sans-serif;
    background-color: #000;
    background-image: url("back.jpg");
    background-size: cover;
    background-repeat: no-repeat;  
    background-position: center top; 
    background-attachment: fixed;
    color: #fff;
    padding: 1rem;
    margin: 0;
}
.container {
    max-width: 1100px;
    margin: auto;
    display: flex;
    gap: 2rem;
}
.left, .right { flex: 1; }
form { margin-bottom: 1rem; }
.slider-group { margin-bottom: 1rem; }
.slider-group label { display: flex; justify-content: space-between; font-size: 0.9rem; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.7rem; }

/* 右上メニュー */
.top-menu {
  position: fixed;
  top: 12px;
  right: 20px;
  display: flex;
  gap: 16px;
  z-index: 1000;          /* 背景より必ず上 */
  font-size: 0.9rem;
}

.top-menu a {
  color: #fff;
  text-decoration: none;
  opacity: 0.8;
}

.top-menu a:hover {
  opacity: 1;
  text-decoration: underline;
}


/* スライダートラック */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
}
input[type=range]::-moz-range-track {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
}

/* スライダースライダー（つまみ） */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -12px; /* トラック中央に合わせる */
    width: 32px;
    height: 32px;
    background: url("/static/coffee_thumb.png") no-repeat center center;
    background-size: contain;
    background-color: transparent;
    cursor: pointer;
    box-shadow: none;
    border: none;
}
input[type=range]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: url("/static/coffee_thumb.png") no-repeat center center;
    background-size: contain;
    cursor: pointer;
    border: none;
}

/* ボタンなどその他 */
button {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    background-color: #000;
    color: white;
    border-radius: 8px;
}

button.secondary {
  margin-left: 0.5rem;
  background-color: #888;
}
button.secondary:hover {
  filter: brightness(0.95);
}

canvas {
    max-width: 100%;
    height: 300px !important;
}
.result h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.table-container {
    max-width: 1000px;
    margin: 2rem auto;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    padding: 1rem;
}
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1rem; 
}
th, td {
    border: 1px solid #aaa;
    padding: 0.5rem;
    text-align: center;
}
/* 最大(高い)味覚＝赤、最小(低い)味覚＝青 */
.taste-max { color: #ffdddd !important; } /* やさしい赤 */
.taste-min { color: #dde8ff !important; } /* やさしい青 */
.taste-max, .taste-min { font-weight: 600; } 

/* レーダーチャートのサイズ・位置調整 */
#radarChart {
    display: block;
    width: 400px !important;
    height: 400px !important;
    margin-left: auto;   /* コンテナ内で右寄せ */
    margin-right: 0;
}
/* タイトルエリア */
.title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}
.title-icon {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}
/* --- シングルカード用スタイル --- */
.single-card {
    /* カード背景を画像に */
    background-image: url("/static/card.jpg");
    background-size: cover;       /* カード全体を覆うように拡大縮小 */
    background-position: center;  /* 画像の中央を表示 */
    background-repeat: no-repeat; /* 繰り返しなし */
    background-color: transparent;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  }  
  
  /* ヘッダー（タイトル＋アイコン） */
  .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .card-icon {
    width: 40px;
    height: 40px;
  }
  .card-title {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
  }
  
  /* レーダーチャートをカード幅にフィット */
  .card-chart {
    width: 100%;
    height: 300px;
  }
  .card-chart canvas {
    width: 100% !important;
    height: 100% !important;
  }
  
  /* 味の数値表示 */
  .card-body p {
    margin: 0.25rem 0;
    font-size: 1rem;
    color: #555;
  }

.btn-mini {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  background: #000;
  cursor: pointer;
}
.btn-mini:hover { filter: brightness(0.95); }

body{
  background: none;
}
body{
  position: relative;
  margin: 0;
  padding: 1rem;
  color: #fff;
  background-color: #000; /* 上余白と自然につながる */
}

/* 固定背景（スマホ対応・最重要） */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;

  background-image: url("back.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;

  /* iOS Safari安定化セット */
  transform: translateZ(0);
  will-change: transform;
}

/* ===== モーダル背景 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;              /* 初期は非表示 */
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* ===== モーダル本体 ===== */
.modal-content {
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  width: min(90%, 420px);
  color: #fff;
  position: relative;
  text-align: center;

  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* 閉じるボタン */
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* メール */
.contact-mail a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

/* ===== モーダル共通 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);

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

  opacity: 0;
  pointer-events: none;   /* 触れなくする */
  transition: opacity 0.25s ease;
  z-index: 2000;
}

/* 表示中 */
.modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== 中身（ふわっと出る） ===== */
.modal-content {
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  width: min(90%, 420px);
  color: #fff;
  position: relative;
  text-align: center;

  transform: translateY(10px) scale(0.96);
  transition: transform 0.25s ease;
}

/* 表示中の中身 */
.modal.active .modal-content {
  transform: translateY(0) scale(1);
}



@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0 1rem;
    }

    .left, .right {
        width: 100%;
    }

    .single-card {
        margin: 1rem 0;
        padding: 1rem;
    }

    .slider-group label {
        font-size: 1rem;
    }

    .slider-labels {
        font-size: 0.8rem;
    }

    table {
        font-size: 0.8rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-icon {
        width: 32px;
        height: 32px;
    }

    #radarChart {
        width: 100% !important;
        height: auto !important;
    }

}