/* ===== 漁夫の利ゲーム スタイル ===== */

.gyofu-wrapper * {
  box-sizing: border-box;
}

.gyofu-wrapper {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #222 !important;
  min-height: 100vh;
}

.gyofu-wrapper h1,
.gyofu-wrapper h2 {
  margin: 0.5em 0 !important;
  text-align: center !important;
  color: #fff !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3) !important;
}

.gyofu-wrapper button {
  font-size: 1.1em !important;
  padding: 12px 20px !important;
  margin: 6px !important;
  cursor: pointer !important;
  border: none !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
  font-weight: bold !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2) !important;
}

.gyofu-wrapper button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
}

.gyofu-wrapper button:active {
  transform: translateY(0) !important;
}

.gyofu-hidden {
  display: none !important;
}

/* ===== 設定画面 ===== */
#gyofu-setupWrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  overflow: hidden;
}

#gyofu-setup {
  width: 100%;
  max-width: 550px;
  padding: 30px 35px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#gyofu-setup h1 {
  color: #667eea !important;
  font-size: 2.2em !important;
  margin: 0 0 25px 0 !important;
  text-shadow: none !important;
}

.gyofu-setup-group {
  margin: 20px 0;
  text-align: center;
}

.gyofu-setup-group label {
  display: block;
  font-size: 1.2em !important;
  font-weight: bold !important;
  color: #555 !important;
  margin-bottom: 10px;
}

.gyofu-number-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.gyofu-number-control button {
  width: 50px !important;
  height: 50px !important;
  font-size: 1.5em !important;
  padding: 0 !important;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  border-radius: 50% !important;
}

.gyofu-number-control .gyofu-value {
  font-size: 2.2em;
  font-weight: bold;
  color: #667eea;
  min-width: 70px;
  text-align: center;
}

.gyofu-start-button {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  font-size: 1.3em !important;
  padding: 15px 45px !important;
  margin-top: 25px !important;
}

.gyofu-note {
  text-align: center;
  color: #888 !important;
  margin-top: 15px;
  font-size: 0.85em;
  line-height: 1.5;
}

/* ===== ゲーム画面レイアウト ===== */
#gyofu-gameWrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#gyofu-mainArea {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#gyofu-sidebar {
  width: 280px;
  background: rgba(255,255,255,0.95);
  padding: 20px;
  box-shadow: -4px 0 10px rgba(0,0,0,0.2);
  overflow-y: auto;
}

#gyofu-sidebar h3 {
  color: #667eea !important;
  margin: 0 0 15px 0 !important;
  font-size: 1.3em !important;
  text-align: center !important;
  text-shadow: none !important;
}

.gyofu-score-item {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gyofu-score-item.gyofu-leader {
  background: linear-gradient(135deg, #fff9c4 0%, #fdd835 100%);
  border: 2px solid #f57f17;
}

.gyofu-score-name {
  font-weight: bold;
  color: #2c3e50;
  font-size: 1.1em;
}

.gyofu-score-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #e74c3c;
}

.gyofu-animation-toggle {
  margin-top: 20px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border: 2px solid #667eea;
}

.gyofu-animation-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold !important;
  color: #667eea !important;
  font-size: 0.95em !important;
}

.gyofu-animation-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  cursor: pointer;
}

.gyofu-big {
  font-size: 2em;
  text-align: center;
  margin: 15px 0;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  font-weight: bold;
}

.gyofu-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-width: 600px;
  width: 100%;
  margin: 20px auto;
}

.gyofu-numbers button {
  font-size: 1.8em !important;
  padding: 20px 0 !important;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  border-radius: 12px !important;
}

.gyofu-controls {
  text-align: center;
  margin-top: 20px;
}

.gyofu-controls button {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
  font-size: 1.2em !important;
  padding: 15px 30px !important;
}

/* ===== ポップアップ ===== */
#gyofu-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

#gyofu-popupContent {
  background: white;
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

#gyofu-popupContent h2 {
  color: #667eea !important;
  font-size: 2em !important;
  margin: 0 0 20px 0 !important;
  text-shadow: none !important;
}

.gyofu-result-container {
  flex: 1;
  overflow-y: auto;
}

/* ===== 入力確認テーブル ===== */
.gyofu-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.gyofu-confirm-table th,
.gyofu-confirm-table td {
  border: 2px solid #ddd;
  padding: 15px;
  text-align: center;
  font-size: 1.2em;
}

.gyofu-confirm-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  font-weight: bold;
}

.gyofu-confirm-table td {
  background: white;
}

.gyofu-confirm-table .gyofu-duplicate-cell {
  background: #ffcccc;
  font-weight: bold;
  animation: gyofu-shake 0.5s;
}

.gyofu-confirm-table .gyofu-unique-cell {
  background: #d4edda;
}

/* ===== ランキング表示 ===== */
.gyofu-ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gyofu-ranking-item {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 15px 20px;
  margin: 10px 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.5s ease, background 0.3s ease;
}

.gyofu-ranking-item.gyofu-rank-1 {
  background: linear-gradient(135deg, #fff9c4 0%, #fdd835 100%);
  border: 3px solid #f57f17;
}

.gyofu-ranking-item.gyofu-rank-2 {
  background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
  border: 2px solid #999;
}

.gyofu-ranking-item.gyofu-rank-3 {
  background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
  border: 2px solid #fb8c00;
}

.gyofu-rank-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.gyofu-rank-number {
  font-size: 2em;
  font-weight: bold;
  color: #667eea;
  min-width: 50px;
}

.gyofu-rank-1 .gyofu-rank-number {
  color: #f57f17;
}

.gyofu-team-name {
  font-size: 1.3em;
  font-weight: bold;
  color: #2c3e50;
}

.gyofu-score-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gyofu-current-score {
  font-size: 1.8em;
  font-weight: bold;
  color: #e74c3c;
}

.gyofu-score-add {
  font-size: 1.3em;
  color: #27ae60;
  font-weight: bold;
  opacity: 0;
  animation: gyofu-fadeInAdd 0.5s ease forwards;
}

.gyofu-score-add.gyofu-zero {
  color: #95a5a6;
}

@keyframes gyofu-fadeInAdd {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gyofu-slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gyofu-scaleUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gyofu-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes gyofu-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gyofu-animate-item {
  animation: gyofu-slideIn 0.4s ease-out;
}

.gyofu-animate-winner {
  animation: gyofu-pulse 0.8s ease-out;
}

#gyofu-popupContent {
  animation: gyofu-scaleUp 0.3s ease-out;
}

.gyofu-popup-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  font-size: 1.2em !important;
  padding: 12px 35px !important;
  margin-top: 20px !important;
}

.gyofu-button-container {
  text-align: center;
  margin-top: 15px;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
  #gyofu-gameWrapper {
    flex-direction: column-reverse;
  }
  
  #gyofu-sidebar {
    width: 100%;
    max-height: 150px;
  }

  .gyofu-numbers {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .gyofu-numbers button {
    font-size: 1.5em !important;
    padding: 15px 0 !important;
  }

  .gyofu-big {
    font-size: 1.5em;
    margin: 10px 0;
  }

  .gyofu-ranking-item {
    padding: 12px 15px;
  }

  .gyofu-team-name {
    font-size: 1.1em;
  }

  .gyofu-current-score {
    font-size: 1.5em;
  }
}

@media (max-height: 700px) {
  #gyofu-setup h1 {
    font-size: 1.8em !important;
    margin-bottom: 15px !important;
  }
  
  .gyofu-setup-group {
    margin: 15px 0;
  }
  
  .gyofu-setup-group label {
    font-size: 1.1em !important;
    margin-bottom: 8px;
  }
  
  .gyofu-number-control .gyofu-value {
    font-size: 2em;
  }
  
  .gyofu-start-button {
    font-size: 1.2em !important;
    padding: 12px 35px !important;
    margin-top: 15px !important;
  }
  
  .gyofu-note {
    font-size: 0.8em;
    margin-top: 10px;
  }

  #gyofu-popupContent {
    padding: 20px;
  }

  #gyofu-popupContent h2 {
    font-size: 1.6em !important;
    margin-bottom: 15px !important;
  }

  .gyofu-ranking-item {
    padding: 10px 15px;
    margin: 8px 0;
  }
}
