@charset "UTF-8";

:root {
  /* モダンで落ち着いたカラーパレット（プレミアムライトテーマ） */
  --bg-color: #f4f7f6;
  --bg-pattern-color: #e2e8e6;
  --text-main: #555555;
  --text-muted: #7f8c8d;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);

  /* アクセントカラー（ルール毎の色分け用） */
  --btn-primary: #e6ebf0;
  --btn-orange: #f2ede9;
  --btn-green: #eaefeb;
  --btn-purple: #edeaf0;
  --btn-red: #f2e9e9;

  --accent-color: #8fa3b5;
  --naraberu-color: #9cb8a5;
  --awaseru-color: #dcbca2;
  --kasaneru-color: #c9a7b7;
}

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

body {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  background-image: radial-gradient(var(--bg-pattern-color) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 共通のガラス風パネルスタイル */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 1px solid rgba(255, 255, 255, 0.8);
}

/* Layout */
.game-ui-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.logo-area {
  text-align: center;
  margin-bottom: 20px;
}

.logo-area h1 {
  font-size: 3rem;
  letter-spacing: 0.2em;
  font-weight: 900;
  color: var(--text-main);
}

.wavy-title span {
  display: inline-block;
  animation: lobby-btn-float 4s ease-in-out infinite;
}

@keyframes lobby-btn-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  margin-top: 5px;
}

/* Navigation */
.nav-tabs {
  display: flex;
  gap: 10px;
  background: var(--glass-bg);
  padding: 8px;
  border-radius: 99px;
  backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  overflow-x: auto;
  max-width: 100%;
}

.tab {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 99px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-main);
}

.tab.active {
  background: var(--btn-primary);
  color: #f03a83; 
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.material-symbols-outlined {
  color: #f03a83;
}

.tab .material-symbols-outlined {
  font-size: 1.2rem;
}

/* Panels Carousel Wrapper */
.game-content {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  overflow: visible; /* 左右のカードがはみ出して見えるようにする */
  position: relative;
  width: 100%;
}

.panel {
  grid-column: 1;
  grid-row: 1;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateX(100%) scale(0.9);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0.4s;
  z-index: 0;
}

.panel.adjacent-left {
  transform: translateX(-95%) scale(0.8);
  opacity: 0.3;
  filter: brightness(0.5) blur(1px);
  visibility: visible;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

.panel.adjacent-right {
  transform: translateX(95%) scale(0.8);
  opacity: 0.3;
  filter: brightness(0.5) blur(1px);
  visibility: visible;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

.panel.hidden-far-left {
  transform: translateX(-150%) scale(0.7);
  opacity: 0;
  visibility: hidden;
}

.panel.hidden-far-right {
  transform: translateX(150%) scale(0.7);
  opacity: 0;
  visibility: hidden;
}

.panel.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(0) scale(1);
  z-index: 10;
  filter: none;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot:hover {
  background: rgba(0, 0, 0, 0.4);
}

.dot.active {
  background: var(--text-main);
  transform: scale(1.2);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.1);
}

.panel-header h2 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}


.player-count {
  background: #fff;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rule-desc {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 24px;
}

/* Glass Cards (Override for Rule Details) */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
}

.mt-20 { margin-top: 20px; }

.glass-card h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.glass-card h3 .material-symbols-outlined {
  color: var(--accent-color);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Lists & Controls */
.control-list, .rule-list { list-style: none; }

.control-list li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}

.key {
  background: #fff;
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rule-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.rule-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* Examples */
.example-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.ex-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.badge {
  background: var(--btn-primary);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ng-badge {
  background: var(--btn-red);
  color: #c0392b;
}

.ex-item p {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 2px;
}

.score-example {
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  text-align: center;
  font-size: 1.1rem;
  border: 1px solid var(--glass-border);
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.action-btn-desc {
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.action-btn-desc h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--text-main);
}

.action-btn-desc h4 .material-symbols-outlined {
  color: var(--accent-color);
}

.action-btn-desc p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.note {
  font-size: 0.85rem;
  color: #e67e22;
  margin-top: 8px;
}

ul.note {
  list-style: none;
  padding: 0;
}

@media (max-width: 768px) {
  .grid-2col { grid-template-columns: 1fr; }
  .logo-area h1 { font-size: 2.5rem; }
  .nav-tabs { padding: 4px; }
  .tab { padding: 8px 16px; font-size: 0.9rem; }
  .game-ui-container { padding: 20px 10px; }
}

/* -------------------------------------
   Card Visual Examples 
   ------------------------------------- */
.visual-example-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.6);
  padding: 24px 16px 32px 16px;
  border-radius: 12px;
  border: 1px dashed var(--glass-border);
}

.visual-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.ex-card {
  width: 120px;
  height: 60px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  display: flex;
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Image background using img tag to ensure it shows up */
.ex-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
}

/* カードを半分重ねるためのクラス */
.ex-card.overlap-left {
  margin-left: -60px;
  z-index: 2;
  box-shadow: -4px 0 6px rgba(0,0,0,0.15); /* 重なった部分の影 */
}

.ex-char {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: #222;
  z-index: 1;
  transform: rotate(0deg); /* 文字は正位置 */
}

.ex-char.unused {
  color: transparent; /* 重なって見えない部分は非表示 */
}

.ex-card-group {
  display: flex;
  padding: 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  position: relative;
}

.ex-card-group.minus {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ex-group-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
  background: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
}

.ex-group-label.plus { color: #10b981; }
.ex-group-label.minus { color: #ef4444; }

.visual-math {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-muted);
}

/* Layout Groups for Actions */
.action-section-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-main);
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.action-group.anytime {
  background: rgba(230, 126, 34, 0.05);
  border: 1px dashed rgba(230, 126, 34, 0.3);
  padding: 16px;
  border-radius: 12px;
  margin-top: 24px;
}

.action-group.anytime .action-section-title {
  color: #d35400;
  border-bottom-color: rgba(230, 126, 34, 0.2);
  margin-top: 0;
}

.action-group.anytime .action-btn-desc {
  background: rgba(255, 255, 255, 0.8);
}