* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
  color: #333;
  display: flex;
  flex-direction: column;
}

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 8px 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.header-text {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}

.main-content {
  flex: 1;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 10px;
  max-height: calc(100vh - 60px);
}

.status-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  gap: 15px;
}

.status-item {
  text-align: center;
}

#id-disp {
  visibility: hidden;
}

.status-label {
  display: block;
  font-size: clamp(9px, 1.5vw, 11px);
  color: #6b7280;
  margin-bottom: 2px;
  font-weight: 600;
}

.status-value {
  display: block;
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 700;
  color: #1e3a8a;
}

.control-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.join-btn,
#NonMute-btn {
  width: clamp(140px, 30vw, 180px);
  height: clamp(140px, 30vw, 180px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.join-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.join-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.join-btn:active {
  transform: scale(0.95);
}

.join-btn.hidden {
  display: none;
}

#NonMute-btn {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  display: none;
  transition: all 0.3s ease;
}

#NonMute-btn.show {
  display: block;
}

#NonMute-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: white;
}

.btn-icon {
  font-size: clamp(32px, 8vw, 40px);
  margin-bottom: 5px;
}

.btn-text {
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-indicator {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 6px 15px;
  border-radius: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#MuteInfo {
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 600;
  color: #6b7280;
}

.radio-guide {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  max-height: 100%;
}

.radio-guide h3 {
  font-size: clamp(13px, 3vw, 15px);
  color: #1e3a8a;
  margin-bottom: 8px;
  text-align: center;
}

.guide-section {
  margin-bottom: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.guide-section.emergency {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.guide-section h4 {
  font-size: clamp(11px, 2.5vw, 12px);
  color: #1e40af;
  margin-bottom: 4px;
  font-weight: 600;
}

.guide-section.emergency h4 {
  color: #dc2626;
}

.guide-text {
  font-size: clamp(10px, 2vw, 11px);
  color: #374151;
  margin: 3px 0;
  line-height: 1.4;
}

.example {
  font-size: clamp(9px, 1.8vw, 10px);
  color: #059669;
  margin: 3px 0;
  font-style: italic;
}

.note {
  font-size: clamp(8px, 1.5vw, 9px);
  color: #6b7280;
  margin: 3px 0;
}

/* モーダル */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-icon {
  font-size: clamp(48px, 12vw, 64px);
  margin-bottom: 12px;
}

.modal-content h2 {
  font-size: clamp(18px, 4vw, 22px);
  color: #1e3a8a;
  margin-bottom: 12px;
}

.modal-content p {
  font-size: clamp(13px, 3vw, 15px);
  color: #4b5563;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-button {
  padding: 10px 35px;
  background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

#button-area,
#remote-media-area {
  display: none;
}

/* デスクトップ用レイアウト */
@media (min-width: 768px) and (min-height: 600px) {
  .main-content {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    padding: 15px;
    gap: 15px;
  }

  .status-bar {
    grid-column: 1 / -1;
  }

  .control-area {
    grid-column: 1;
    grid-row: 2;
  }

  .radio-guide {
    grid-column: 2;
    grid-row: 2;
  }
}

/* 縦長画面用の最適化 */
@media (max-width: 767px) and (min-height: 700px) {
  .join-btn,
  #NonMute-btn {
    width: clamp(160px, 35vw, 200px);
    height: clamp(160px, 35vw, 200px);
  }
}

/* 横長画面用の最適化 */
@media (max-height: 600px) {
  header {
    padding: 5px 10px;
  }

  .main-content {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 8px;
  }

  .status-bar {
    grid-column: 1 / -1;
    padding: 5px 10px;
  }

  .control-area {
    grid-column: 1;
  }

  .radio-guide {
    grid-column: 2;
    padding: 8px;
  }

  .join-btn,
  #NonMute-btn {
    width: clamp(100px, 20vh, 140px);
    height: clamp(100px, 20vh, 140px);
  }

  .guide-section {
    margin-bottom: 5px;
    padding: 6px;
  }
}

/* 超小型画面用 */
@media (max-width: 360px) {
  .header-text {
    font-size: 16px;
  }

  .header-subtitle {
    font-size: 9px;
  }

  .status-bar {
    padding: 6px 8px;
  }
}
