/* 全体のスタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f7f7;
    padding: 20px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    text-align: center;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
}

.primary-btn {
    background-color: #2ecc71;
}

.btn:hover {
    opacity: 0.9;
}

/* アラートとメッセージ */
.alert {
    padding: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message-box {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

.message-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-box.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message-box.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 登録成功ボックス */
.success-box {
    background-color: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.note {
    font-size: 14px;
    color: #6c757d;
    margin: 10px 0;
    font-style: italic;
}

/* リンク */
.links {
    margin-top: 20px;
    text-align: center;
}

.links a {
    color: #3498db;
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

/* プレイヤー部分とボタンを上揃えに */
.player-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: stretch;      /* ← 子要素を高さいっぱいに伸ばす */
}

/* ① 動画ラッパーにだけアスペクト比を適用 */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;  /* 16:9 */
}

.video-wrapper > #player {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

/* （既存の .video-container は .video-wrapper とステータスを包むだけ） */
.video-container {
  /* flex:1 など必要なら残してOK */
  flex: 1;
}

.buttons-container {
  flex: none;                /* 幅固定のまま伸縮オフ */
  width: 200px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  align-self: stretch;       /* ← 親に合わせて高さを伸ばす */
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 0px;                 /* ← ギャップは固定 */
  height: 100%;              /* ← 高さを親 .buttons-container に合わせる */
}

.vote-btn {
    flex: 1;                   /* ← ボタン本体を残りのスペースでストレッチ */
    padding: 15px;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.1s;
    animation: pulse 10s infinite;
}

@keyframes pulse {
  0%, 20%, 100% { transform: scale(1); }
  10% { transform: scale(1.05); }
}

/* 最後の要素以外にだけマージンを設定 */
.vote-btn.green:not(:last-child) {
  margin-bottom: 15px;       /* green→red 間を狭く */
}

.vote-btn.red:not(:last-child) {
  margin-bottom: 5px;      /* red→green 間を広く */
}

.vote-btn.red {
    background-color: #565655;
    border-radius: 8px 8px 0 0;
}

.vote-btn.green {
    background-color: #565655;
    border-radius: 0 0 8px 8px;
}

.vote-btn.red:hover {
    background-color: #219a52;
}

.vote-btn.green:hover {
    background-color: #c0392b;
}

.vote-btn:active {
    transform: scale(0.98);
}

/* ログ表示ページ */
.video-info {
    margin-bottom: 30px;
}

.chart-container {
    margin-bottom: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
}

.chart-wrapper {
    height: 400px;
    position: relative;
    margin-top: 15px;
}

.chart-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.feedback-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.player-status {
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 5px;
    color: #6c757d;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

@media screen and (max-width: 950px) {
  .player-container {
    flex-direction: column;
    align-items: stretch;  /* ← 幅を子要素いっぱいに広げる */
  }

  /* 動画コンテナは flex 無効化＆幅100% */
  .video-container {
    flex: none;
    width: 100%;
  }

  /* 動画アスペクト比はそのまま */
  .video-wrapper {
    /* position, padding-top は元の通り */
  }

  /* ボタンは全幅に、上下マージンで間隔を */
  .buttons-container {
    flex: none;
    width: 100%;
    margin: 20px 0 0;  /* 上に20px空ける */
  }
}
