/* おだいスケッチ（party/sketch） 独自スタイル。共通は ../common/party.css。
   テーマ色は水色系（party.css の共通CSS変数を上書き）。 */

:root {
  --party-accent: #00acc1;
  --party-bg: #e0f7fa;
  --party-card: #ffffff;
  --sketch-winner: #ffca28;
}

.sketch-game {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--party-bg, #e0f7fa);
  overflow: hidden;
}

.sketch-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  box-sizing: border-box;
  text-align: center;
  overflow-y: auto;
}

/* ---- お題確認 ---- */
.sketch-round-label {
  font-size: 1.05rem;
  color: #00646f;
  margin: 0;
}
.sketch-theme-lead {
  font-size: 1.3rem;
  color: #00646f;
  margin: 0;
}
.sketch-theme-word {
  font-size: 3rem;
  font-weight: bold;
  color: #006064;
  margin: 0;
  animation: sketch-pop 0.6s ease-out;
}
@keyframes sketch-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- 描画画面 ---- */
.sketch-draw {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 0.6rem;
  gap: 0.5rem;
  touch-action: none;
}
.sketch-draw-top {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sketch-timebar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.sketch-timebar-fill {
  height: 100%;
  width: 100%;
  background: var(--party-accent, #00acc1);
  transition: width 0.05s linear;
}
.sketch-theme-mini {
  margin: 0;
  font-size: 1rem;
  color: #00646f;
  text-align: center;
}
.sketch-canvas-wrap {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  touch-action: none;
}
#sketch-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #fff;
}
.sketch-toolbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sketch-colors {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.sketch-color-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  padding: 0;
}
.sketch-color-btn.is-selected {
  box-shadow: 0 0 0 3px var(--party-accent, #00acc1);
}
.sketch-sizes {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.sketch-size-btn {
  min-height: 40px;
  padding: 0 0.9rem;
  border: none;
  border-radius: 12px;
  background: var(--party-card, #fff);
  color: #00646f;
  font-size: 0.9rem;
}
.sketch-size-btn.is-selected {
  background: var(--party-accent, #00acc1);
  color: #fff;
}
.sketch-toolbtns {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.sketch-tool {
  min-height: 40px;
  padding: 0 0.8rem;
  border: none;
  border-radius: 12px;
  background: var(--party-card, #fff);
  color: #00646f;
  font-size: 0.85rem;
}
.sketch-tool.is-selected {
  background: #26c6da;
  color: #fff;
}
.sketch-done-btn {
  width: 100%;
  max-width: 480px;
  min-height: 56px;
  border: none;
  border-radius: 16px;
  background: var(--party-accent, #00acc1);
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ---- 投票（ギャラリー） ---- */
.sketch-vote-title {
  font-size: 1.05rem;
  color: #00646f;
  margin: 0 0 0.25rem;
}
.sketch-gallery-grid {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
.sketch-gallery-card {
  position: relative;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  background: var(--party-card, #fff);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  aspect-ratio: 1 / 1;
}
.sketch-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sketch-gallery-card.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}
.sketch-gallery-card:disabled {
  opacity: 0.6;
}
.sketch-gallery-card.is-mine {
  box-shadow: 0 0 0 3px var(--party-accent, #00acc1);
}
.sketch-gallery-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 172, 193, 0.85);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 0;
}

/* ---- 開票結果 ---- */
.sketch-result-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: #006064;
  margin: 0;
}
.sketch-result-novote {
  font-size: 1rem;
  color: #00838f;
  margin: 0;
}
.sketch-result-grid {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
.sketch-result-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--party-card, #fff);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}
.sketch-result-card.is-winner {
  box-shadow: 0 0 0 3px var(--sketch-winner, #ffca28);
}
.sketch-result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.sketch-result-barwrap {
  height: 10px;
  margin: 0.3rem 0.5rem 0;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.sketch-result-bar {
  height: 100%;
  width: 0;
  background: var(--party-accent, #00acc1);
  border-radius: 999px;
  transition: width 0.8s ease-out;
}
.sketch-result-votelabel {
  font-size: 0.8rem;
  color: #00646f;
  margin: 0.15rem 0.5rem 0;
}
.sketch-result-author {
  font-size: 0.9rem;
  font-weight: bold;
  color: #333;
  margin: 0.1rem 0.5rem 0.4rem;
}
.sketch-result-author.is-winner-name {
  color: #e65100;
}
.sketch-totals {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sketch-total-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sketch-total-name {
  width: 5.5rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sketch-total-barwrap {
  flex: 1;
  height: 12px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.sketch-total-bar {
  height: 100%;
  background: var(--party-accent, #00acc1);
  border-radius: 999px;
}
.sketch-total-pt {
  width: 3.6rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  text-align: right;
}

/* ---- 最終結果（表彰台） ---- */
.sketch-final-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #006064;
  margin: 0;
}
.sketch-podium {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  max-width: 320px;
}
.sketch-podium-item {
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: var(--party-card, #fff);
}
.sketch-podium-1 {
  background: #fff3c4;
  font-size: 1.5rem;
}
.sketch-podium-2 {
  background: #f0f0f0;
}
.sketch-podium-3 {
  background: #ffe0c2;
}
.sketch-final-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.95rem;
}
.sketch-final-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.sketch-final-actions button {
  min-height: 56px;
  padding: 0 1.25rem;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: bold;
}
#btn-again {
  background: var(--party-accent, #00acc1);
  color: #fff;
}
#btn-back-lobby {
  background: var(--party-card, #fff);
  color: #006064;
}

/* ---- じぶんたちのお題（docs/party-customodai-spec.md） ---- */
.sketch-custom {
  margin-top: 6px;
  text-align: left;
}
/* 既定は畳んだ1行トグル（390×844で「はじめる」がファーストビューに収まるよう高さを圧縮） */
.sketch-custom-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: #006064;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
  text-align: left;
}
.sketch-custom-toggle-caret {
  flex: 0 0 auto;
  color: #00838f;
  font-size: 0.8rem;
}
.sketch-custom-body {
  margin-top: 4px;
}
.sketch-custom-lead {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #00646f;
}
.sketch-custom-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sketch-custom-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  min-height: 52px;
  font-size: 18px;
  text-align: left;
}
.sketch-custom-add {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--party-accent, #00acc1);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
}
.sketch-custom-add:disabled,
.sketch-custom-input:disabled {
  opacity: 0.5;
}
.sketch-custom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.sketch-custom-chips:empty {
  display: none;
}
.sketch-custom-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid #4dd0e1;
  border-radius: 20px;
  background: #e0f7fa;
  color: #006064;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
}
.sketch-custom-chip-x {
  font-size: 0.8rem;
  color: #00838f;
}
.sketch-custom-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: #4f7f86;
}

/* お題がカスタムのときだけ出るバッジ（描き手以外にも見える） */
.sketch-custom-badge {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ffe082;
  color: #7a5300;
  font-size: 0.95rem;
  font-weight: bold;
}
.sketch-custom-badge--mini {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
}
