/* ===== 漁夫の利ゲーム QRコード版 スタイル ===== */

.gyofu-qr-wrapper {
  all: initial;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif !important;
  line-height: 1.6;
}

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

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

/* ===== 警告表示 ===== */
.gyofu-qr-notice {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 10px;
  padding: 15px 20px;
  margin: 20px;
  color: #856404;
  font-size: 1em;
  text-align: center;
  font-weight: bold;
}

/* ===== 共通ボタン ===== */
.gyofu-qr-wrapper button {
  font-family: inherit !important;
  cursor: pointer !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: bold !important;
  transition: all 0.2s !important;
  outline: none !important;
}

.gyofu-qr-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  padding: 15px 40px !important;
  font-size: 1.2em !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

.gyofu-qr-btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
}

.gyofu-qr-btn-secondary {
  background: #95a5a6 !important;
  color: white !important;
  padding: 12px 30px !important;
  font-size: 1em !important;
}

.gyofu-qr-btn-secondary:hover {
  background: #7f8c8d !important;
}

/* ===== 設定画面 ===== */
#gyofu-qr-setup {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.gyofu-qr-setup-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.gyofu-qr-setup-card h1 {
  color: #667eea !important;
  font-size: 2.5em !important;
  margin: 0 0 10px 0 !important;
  text-align: center !important;
}

.gyofu-qr-subtitle {
  text-align: center;
  color: #95a5a6;
  font-size: 1.1em;
  margin: 0 0 30px 0 !important;
}

.gyofu-qr-setup-group {
  margin: 25px 0;
}

.gyofu-qr-setup-group label {
  display: block;
  font-size: 1.2em !important;
  font-weight: bold !important;
  color: #2c3e50 !important;
  margin-bottom: 10px;
  text-align: center;
}

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

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

.gyofu-qr-value {
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  min-width: 80px;
  text-align: center;
}

/* ===== ロビー画面 ===== */
#gyofu-qr-lobby {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gyofu-qr-lobby-card {
  background: white;
  border-radius: 20px;
  padding: 50px;
  max-width: 1100px;
  width: 98%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.gyofu-qr-lobby-card h2 {
  color: #667eea !important;
  font-size: 2em !important;
  text-align: center !important;
  margin: 0 0 30px 0 !important;
}

/* 3カラムレイアウト */
.gyofu-qr-lobby-content {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  justify-content: center;
}

.gyofu-qr-lobby-left {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
}

.gyofu-qr-lobby-center {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gyofu-qr-lobby-right {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
}

.gyofu-qr-host-key-box {
  background: #fff3cd;
  border: 3px solid #ffc107;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.gyofu-qr-host-key-label {
  font-size: 1.1em;
  font-weight: bold;
  color: #856404;
  margin-bottom: 10px;
}

.gyofu-qr-host-key-value {
  font-size: 2em;
  font-weight: bold;
  font-family: monospace !important;
  color: #667eea;
  letter-spacing: 2px;
  margin: 15px 0;
  padding: 15px;
  background: white;
  border-radius: 10px;
  border: 2px solid #667eea;
}

.gyofu-qr-host-key-hidden {
  display: none;
}

.gyofu-qr-btn-toggle {
  background: #6c757d !important;
  color: white !important;
  border: none !important;
  padding: 8px 20px !important;
  border-radius: 5px !important;
  cursor: pointer !important;
  font-size: 0.9em !important;
  margin-top: 10px !important;
}

.gyofu-qr-btn-toggle:hover {
  background: #5a6268 !important;
}

.gyofu-qr-btn-copy-small {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
  padding: 8px 20px !important;
  font-size: 0.9em !important;
  margin-top: 10px !important;
}

.gyofu-qr-host-key-note {
  margin-top: 15px !important;
  margin-bottom: 0 !important;
  font-size: 0.95em;
  color: #856404;
  font-weight: bold;
}

.gyofu-qr-host-key-desc {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  font-size: 0.85em;
  color: #856404;
  line-height: 1.5;
}

.gyofu-qr-code-container {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 15px;
}

#gyofu-qr-code {
  display: inline-block;
}

.gyofu-qr-url-container {
  margin: 20px 0 0 0;
  text-align: center;
  width: 100%;
  max-width: 256px;
}

.gyofu-qr-url-container p {
  font-size: 0.9em;
  color: #2c3e50;
  margin-bottom: 10px !important;
}

.gyofu-qr-url-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.gyofu-qr-url-box input {
  width: 100%;
  padding: 8px !important;
  font-size: 0.7em !important;
  border: 2px solid #ddd !important;
  border-radius: 8px !important;
  font-family: monospace !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: center !important;
}

.gyofu-qr-url-box button {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
  padding: 10px 20px !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-weight: bold !important;
  font-size: 0.9em !important;
}
  font-size: 1em !important;
}

.gyofu-qr-status {
  margin: 30px 0;
}

.gyofu-qr-status h3 {
  color: #2c3e50 !important;
  font-size: 1.5em !important;
  margin: 0 0 15px 0 !important;
  text-align: center !important;
}

#gyofu-qr-participants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gyofu-qr-participant {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  color: #1976d2;
}

.gyofu-qr-participant.waiting {
  background: #f5f5f5;
  color: #95a5a6;
}

/* ===== ゲーム進行画面 ===== */
#gyofu-qr-game {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.gyofu-qr-game-header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.gyofu-qr-game-header h2 {
  font-size: 2.5em !important;
  margin: 20px 0 !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.gyofu-qr-game-status {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 30px;
}

.gyofu-qr-game-status h3 {
  color: #2c3e50 !important;
  font-size: 1.5em !important;
  margin: 0 0 20px 0 !important;
  text-align: center !important;
}

.gyofu-qr-input-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin: 10px 0;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #95a5a6;
}

.gyofu-qr-input-item.completed {
  background: #d4edda;
  border-left-color: #28a745;
}

.gyofu-qr-input-item.timeout {
  background: #fff3cd;
  border-left-color: #ffc107;
}

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

.gyofu-qr-status-badge {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: bold;
}

.gyofu-qr-status-badge.waiting {
  background: #f8f9fa;
  color: #6c757d;
}

.gyofu-qr-status-badge.completed {
  background: #28a745;
  color: white;
}

.gyofu-qr-status-badge.timeout {
  background: #ffc107;
  color: #333;
}

/* ===== プレイヤー画面 ===== */
.gyofu-qr-player {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.gyofu-qr-player-container {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.gyofu-qr-warning {
  background: #fff3cd;
  color: #856404;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 20px;
  border: 2px solid #ffc107;
}

.gyofu-qr-loading {
  text-align: center;
  padding: 40px;
  font-size: 1.3em;
  color: #667eea;
}

.gyofu-qr-player-info {
  text-align: center;
  margin-bottom: 30px;
}

.gyofu-qr-player-info h2 {
  color: #667eea !important;
  font-size: 2em !important;
  margin: 10px 0 !important;
}

.gyofu-qr-round-info {
  color: #6c757d;
  font-size: 1.1em;
  margin: 5px 0;
}

.gyofu-qr-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.gyofu-qr-number-btn {
  aspect-ratio: 1;
  font-size: 1.8em !important;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
  border-radius: 15px !important;
  padding: 0 !important;
  transition: all 0.2s !important;
}

.gyofu-qr-number-btn:hover {
  transform: scale(1.05) !important;
}

.gyofu-qr-number-btn.selected {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  box-shadow: 0 0 20px rgba(240, 147, 251, 0.6) !important;
}

.gyofu-qr-confirm {
  margin-top: 30px;
  text-align: center;
}

.gyofu-qr-selected-display {
  font-size: 1.5em;
  color: #2c3e50;
  margin-bottom: 20px;
}

.gyofu-qr-selected-number {
  font-size: 3em;
  font-weight: bold;
  color: #667eea;
  margin: 10px 0;
}

.gyofu-qr-confirm-question {
  font-size: 1.2em;
  color: #6c757d;
  margin: 15px 0;
}

.gyofu-qr-confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.gyofu-qr-btn-back {
  background: #6c757d !important;
  color: white !important;
  padding: 12px 30px !important;
  font-size: 1.1em !important;
}

.gyofu-qr-btn-submit {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  color: white !important;
  padding: 12px 40px !important;
  font-size: 1.1em !important;
}

.gyofu-qr-waiting {
  text-align: center;
  padding: 40px 20px;
}

.gyofu-qr-waiting h3 {
  color: #667eea !important;
  font-size: 1.8em !important;
  margin-bottom: 20px !important;
}

.gyofu-qr-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-radius: 50%;
  animation: gyofu-spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes gyofu-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== 結果ポップアップ ===== */
#gyofu-qr-result-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-qr-popup-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: gyofu-popup-appear 0.3s ease-out;
}

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

.gyofu-qr-result-title {
  color: #667eea !important;
  font-size: 2.2em !important;
  text-align: center !important;
  margin: 0 0 30px 0 !important;
}

.gyofu-qr-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

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

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

.gyofu-qr-confirm-table .duplicate {
  background: #ffcccc;
  animation: gyofu-shake 0.5s;
}

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

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

.gyofu-qr-ranking-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.gyofu-qr-ranking-item {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 20px;
  margin: 15px 0;
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: gyofu-slide-in 0.5s ease-out;
}

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

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

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

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

.gyofu-qr-rank-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.gyofu-qr-rank-num {
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  min-width: 60px;
}

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

.gyofu-qr-group-label {
  font-size: 1.5em;
  font-weight: bold;
  color: #2c3e50;
}

.gyofu-qr-score-display {
  display: flex;
  align-items: center;
  gap: 15px;
}

.gyofu-qr-total-score {
  font-size: 2em;
  font-weight: bold;
  color: #e74c3c;
}

.gyofu-qr-add-score {
  font-size: 1.5em;
  color: #28a745;
  font-weight: bold;
}

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

/* 参加状況 */
.gyofu-qr-status-box {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 15px 12px;
  width: 100%;
  box-sizing: border-box;
}

.gyofu-qr-status-box h3 {
  font-size: 1.2em !important;
  color: #2c3e50 !important;
  margin: 0 0 12px 0 !important;
  text-align: center !important;
  padding: 0 !important;
}

.gyofu-qr-status-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.gyofu-qr-status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px !important;
  margin-bottom: 6px !important;
  background: white;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

.gyofu-qr-status-item.submitted {
  border-color: #28a745;
  background: #f0fff4;
}

.gyofu-qr-status-group {
  font-weight: bold;
  font-size: 1em;
  color: #2c3e50;
  flex: 1;
}

.gyofu-qr-status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
  flex-shrink: 0;
}

.gyofu-qr-status-badge.submitted {
  background: #28a745;
  color: white;
}

.gyofu-qr-status-badge.waiting {
  background: #6c757d;
  color: white;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .gyofu-qr-lobby-content {
    flex-direction: column;
    align-items: center;
  }
  
  .gyofu-qr-lobby-left,
  .gyofu-qr-lobby-center,
  .gyofu-qr-lobby-right {
    width: 100%;
    max-width: 500px;
  }
  
  .gyofu-qr-url-container {
    max-width: 100%;
  }
  
  .gyofu-qr-url-box input {
    font-size: 0.8em !important;
  }
}

@media (max-width: 768px) {
  .gyofu-qr-setup-card,
  .gyofu-qr-lobby-card,
  .gyofu-qr-player-container {
    padding: 20px;
  }
  
  .gyofu-qr-numbers {
    gap: 8px;
  }
  
  .gyofu-qr-number-btn {
    font-size: 1.5em !important;
  }
  
  .gyofu-qr-ranking-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .gyofu-qr-rank-left {
    flex-direction: column;
    gap: 10px;
  }
}
