/* =========================
   OCFA Game UI
========================= */

body {
  background:
    radial-gradient(circle at top left, rgba(196, 181, 253, 0.35), transparent 32%),
    radial-gradient(circle at bottom right, rgba(251, 207, 232, 0.35), transparent 36%),
    #f8f5ff;
}

.page {
  width: min(100% - 24px, 1200px);
  max-width: 1200px;
  margin: 0 auto;
}

#gameRoomContent,
#gameHomeContent {
  width: 100%;
}

.game-shell {
  display: grid;
  gap: 16px;
}

.game-topbar {
  position: sticky;
  top: 72px;
  z-index: 20;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  padding: 12px 14px;
  border: 1px solid rgba(120, 96, 190, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(95, 76, 150, 0.10);
}

.game-topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

.game-topbar-status {
  font-size: 0.85rem;
  font-weight: 800;
  color: #7c5fc7;
}

.game-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.game-stage-panel,
.game-side-panel {
  border: 1px solid rgba(120, 96, 190, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(95, 76, 150, 0.10);
}

.game-stage-panel {
  padding: 16px;
  min-width: 0;
}

.game-side-panel {
  position: sticky;
  top: 142px;
  padding: 14px;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 14px, 1200px);
  }

  .game-topbar {
    top: 58px;
    border-radius: 16px;
  }

  .game-main-layout {
    grid-template-columns: 1fr;
  }

  .game-side-panel {
    position: static;
  }

  .game-stage-panel {
    padding: 12px;
  }
}

.game-topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #5f5478;
}

.game-topbar-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f3edff;
}

.game-room-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.game-room-status > div {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f8f4ff;
  border: 1px solid rgba(124, 95, 199, 0.14);
}

.game-room-status strong {
  font-size: 0.78rem;
  color: #7c5fc7;
}

.game-room-status span {
  font-size: 0.95rem;
  font-weight: 900;
  color: #30283a;
}

.game-side-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(124, 95, 199, 0.12);
}

.game-side-section:first-child {
  padding-top: 0;
}

.game-side-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.game-side-section h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.mini-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #9b7ae6;
  text-transform: uppercase;
}

.small-text {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #5f5478;
}

.message {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #7c5fc7;
}

@media (max-width: 760px) {
  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-topbar-meta {
    justify-content: flex-start;
  }

  .game-room-status {
    gap: 8px;
  }

  .game-room-status > div {
    flex: 1;
    min-width: 120px;
  }
}

/* =========================
   Game room override
========================= */

.game-shell .panel {
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.game-shell .card,
.game-shell .info-card,
.game-shell .room-card {
  border-radius: 18px;
  border: 1px solid rgba(124, 95, 199, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(95, 76, 150, 0.08);
}

.game-shell h1,
.game-shell h2,
.game-shell h3 {
  line-height: 1.35;
}

.game-stage-panel > .panel {
  padding: 0;
}

.game-stage-panel canvas,
.game-stage-panel .drawing-canvas,
.game-stage-panel #drawingCanvas,
.game-stage-panel #gameCanvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.game-stage-panel button,
.game-side-panel button,
.game-stage-panel .btn,
.game-side-panel .btn {
  min-height: 42px;
}

.game-side-panel .btn,
.game-side-panel button {
  width: 100%;
  justify-content: center;
}

.game-side-panel .players,
.game-side-panel .player-list,
.game-side-panel ul {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .game-shell .panel {
    padding: 0;
  }

  .game-stage-panel {
    border-radius: 18px;
  }

  .game-side-panel {
    border-radius: 18px;
  }
}

.game-waiting-hero {
  display: grid;
  gap: 14px;
  min-height: 360px;
  align-content: center;
  padding: 28px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(196, 181, 253, 0.28), transparent 34%),
    linear-gradient(135deg, #ffffff, #fbf7ff);
  border: 1px solid rgba(124, 95, 199, 0.14);
}

.game-waiting-hero h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.game-waiting-hero p {
  max-width: 620px;
  margin: 0;
  line-height: 1.8;
  color: #5f5478;
  font-weight: 700;
}

.game-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.game-rule-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(124, 95, 199, 0.13);
}

.game-rule-grid strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #8b6eea;
  color: #fff;
  font-size: 0.9rem;
}

.game-rule-grid span {
  font-size: 0.9rem;
  font-weight: 900;
  color: #30283a;
}

@media (max-width: 760px) {
  .game-waiting-hero {
    min-height: auto;
    padding: 18px;
  }

  .game-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.game-starting-screen {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 420px;
  padding: 32px 18px;
  text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(139, 110, 234, 0.28), transparent 36%),
    linear-gradient(135deg, #ffffff, #f8f2ff);
  border: 1px solid rgba(124, 95, 199, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.game-starting-screen h2 {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 5rem);
  line-height: 1;
  color: #30283a;
}

.game-starting-screen p {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #6d5a8f;
}

.game-starting-count {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin-top: 8px;
  border-radius: 999px;
  background: #8b6eea;
  color: #fff;
  font-size: 2.8rem;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(124, 95, 199, 0.28);
  animation: gameStartPulse 1s infinite;
}

@keyframes gameStartPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .game-starting-screen {
    min-height: 300px;
  }

  .game-starting-count {
    width: 72px;
    height: 72px;
    font-size: 2.2rem;
  }
}

.game-waiting-hero {
  display: grid;
  gap: 14px;
  min-height: 360px;
  align-content: center;
  padding: 28px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(196, 181, 253, 0.28), transparent 34%),
    linear-gradient(135deg, #ffffff, #fbf7ff);
  border: 1px solid rgba(124, 95, 199, 0.14);
}

.game-waiting-hero h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.game-waiting-hero p {
  max-width: 620px;
  margin: 0;
  line-height: 1.8;
  color: #5f5478;
  font-weight: 700;
}

.game-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.game-rule-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(124, 95, 199, 0.13);
}

.game-rule-grid strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #8b6eea;
  color: #fff;
  font-size: 0.9rem;
}

.game-rule-grid span {
  font-size: 0.9rem;
  font-weight: 900;
  color: #30283a;
}

@media (max-width: 760px) {
  .game-waiting-hero {
    min-height: auto;
    padding: 18px;
  }

  .game-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================
   Game visual theme / warm beige
========================= */

:root {
  --game-bg: #fff7e8;
  --game-paper: #fffdf7;
  --game-paper-2: #fff3dc;
  --game-line: #dfcdb8;
  --game-line-soft: rgba(183, 148, 112, 0.28);
  --game-text: #30283a;
  --game-sub: #756456;
  --game-accent: #e9a99f;
  --game-accent-2: #f3c7a2;
  --game-brown: #8a6547;
  --game-shadow: rgba(116, 83, 48, 0.12);
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 214, 165, 0.38), transparent 30%),
    radial-gradient(circle at bottom right, rgba(233, 169, 159, 0.28), transparent 34%),
    linear-gradient(180deg, #fffaf0, #fff4df);
}

.game-topbar,
.game-stage-panel,
.game-side-panel {
  border: 1px solid var(--game-line-soft);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 247, 232, 0.96));
  box-shadow: 0 16px 36px var(--game-shadow);
}

.game-topbar {
  border-radius: 24px;
}

.game-topbar-status,
.mini-label {
  color: var(--game-brown);
}

.game-topbar-meta span {
  background: #fff0dc;
  color: var(--game-brown);
  border: 1px solid rgba(183, 148, 112, 0.18);
}

.game-room-status > div {
  background: #fff4e3;
  border-color: rgba(183, 148, 112, 0.22);
}

.game-room-status strong {
  color: var(--game-brown);
}

.game-waiting-hero {
  min-height: 430px;
  border: 1px solid rgba(183, 148, 112, 0.22);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 158, 0.38), transparent 34%),
    radial-gradient(circle at bottom right, rgba(233, 169, 159, 0.25), transparent 36%),
    linear-gradient(135deg, #fffdf7, #fff4e3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.game-waiting-hero h2 {
  color: var(--game-text);
}

.game-waiting-hero p {
  color: #6d5a4c;
}

.game-rule-grid div {
  background:
    linear-gradient(180deg, #fffdf8, #fff1dc);
  border: 1px solid rgba(183, 148, 112, 0.22);
  box-shadow: 0 10px 20px rgba(116, 83, 48, 0.08);
}

.game-rule-grid strong {
  background:
    linear-gradient(135deg, #e9a99f, #f3c7a2);
  color: #fff;
}

.game-rule-grid span {
  color: #3a2d25;
}

/* ボタンもゲームっぽいベージュ寄せ */
.game-shell .btn,
.game-shell button {
  border-radius: 18px;
  border: 1px solid rgba(138, 101, 71, 0.18);
  background:
    linear-gradient(180deg, #efb3aa, #e9a99f);
  color: #3a2d25;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(116, 83, 48, 0.14);
}

.game-shell .btn:hover,
.game-shell button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.game-shell .btn.secondary,
.game-shell #copyRoomUrlBtn {
  background:
    linear-gradient(180deg, #f5cfaa, #efb3aa);
  color: #3a2d25;
}

.game-shell .btn.ghost {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: var(--game-brown);
  border: 0;
  box-shadow: none;
  text-decoration: underline;
}

/* 右サイドの古いカードも温かい紙感に寄せる */
.game-side-panel .panel,
.game-side-panel .card,
.game-side-panel .player-card,
.game-side-panel .player,
.game-side-panel li {
  background: #fff8eb;
  border-color: rgba(183, 148, 112, 0.28);
}

.game-side-section {
  border-bottom-color: rgba(183, 148, 112, 0.20);
}

.small-text,
.message {
  color: #756456;
}

/* =========================
   Mobile layout fix
========================= */

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 1200px);
    padding-top: 18px;
  }

  .game-shell {
    gap: 12px;
  }

  .game-topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 16px;
    border-radius: 24px;
  }

  .game-topbar-title {
    font-size: 1.15rem;
    line-height: 1.4;
  }

  .game-topbar-status {
    margin: 0 0 8px;
    font-size: 0.9rem;
  }

  .game-topbar-meta {
    justify-content: flex-start;
    gap: 8px;
  }

  .game-topbar-meta span {
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .game-stage-panel {
    padding: 12px;
    border-radius: 24px;
  }

  .game-room-status {
    margin-bottom: 12px;
  }

  .game-room-status > div {
    min-width: 0;
    width: 100%;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .game-room-status strong {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .game-room-status span {
    display: block;
    font-size: 1.25rem;
  }

  .game-waiting-hero {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .game-waiting-hero h2 {
    font-size: 1.75rem;
  }

  .game-waiting-hero p {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .game-rule-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .game-rule-grid div {
    min-height: 110px;
    padding: 14px 12px;
  }

  .game-side-panel {
    padding: 14px;
    border-radius: 24px;
  }
}

/* =========================
   Drawing screen
========================= */

.game-draw-screen {
  display: grid;
  gap: 14px;
}

.game-draw-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: stretch;
}

.game-draw-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

.game-draw-header p {
  margin: 0;
  line-height: 1.75;
  color: #6d5a4c;
  font-weight: 800;
}

.game-draw-timer {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff8eb, #fff0dc);
  border: 1px solid rgba(183, 148, 112, 0.24);
  box-shadow: 0 10px 20px rgba(116, 83, 48, 0.08);
}

.game-draw-timer span {
  font-size: 0.78rem;
  font-weight: 900;
  color: #8a6547;
}

.game-draw-timer strong {
  font-size: 1.8rem;
  line-height: 1;
  color: #30283a;
}

.game-draw-note {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 244, 227, 0.78);
  border: 1px dashed rgba(138, 101, 71, 0.26);
  color: #756456;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.7;
}

.game-draw-tools {
  padding: 14px;
  border-radius: 22px;
  background: #fff8eb;
  border: 1px solid rgba(183, 148, 112, 0.24);
}

.game-canvas-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-canvas-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.game-canvas-label span {
  font-size: 0.95rem;
  font-weight: 900;
  color: #8a6547;
}

.game-canvas-label small {
  font-size: 0.78rem;
  font-weight: 800;
  color: #756456;
}

#gameCanvas {
  width: 100%;
  max-width: 768px;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 18px;
  background: #fff;
  border: 2px solid rgba(138, 101, 71, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  touch-action: none;
}

.game-submit-bar {
  position: sticky;
  bottom: 10px;
  z-index: 30;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;

  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(183, 148, 112, 0.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.14);
}

.game-submit-bar p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #756456;
  line-height: 1.6;
}

.game-submit-bar .btn {
  width: 100%;
}

@media (max-width: 760px) {
  .game-draw-header {
    grid-template-columns: 1fr;
  }

  .game-draw-timer {
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding: 12px 14px;
  }

  .game-draw-timer strong {
    font-size: 1.5rem;
  }

  .game-draw-tools {
    padding: 12px;
  }

  .game-canvas-card {
    padding: 10px;
    border-radius: 20px;
  }

  .game-canvas-label {
    display: grid;
    gap: 3px;
  }

  #gameCanvas {
    border-radius: 14px;
  }

  .game-submit-bar {
    grid-template-columns: 1fr;
    bottom: 8px;
    border-radius: 20px;
  }
}

/* =========================
   Drawing screen / OC
========================= */

.game-draw-screen {
  display: grid;
  gap: 14px;
}

.game-draw-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: stretch;
}

.game-draw-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
}

.game-draw-header p {
  margin: 0;
  line-height: 1.75;
  color: #6d5a4c;
  font-weight: 800;
}

.game-draw-timer {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff8eb, #fff0dc);
  border: 1px solid rgba(183, 148, 112, 0.24);
  box-shadow: 0 10px 20px rgba(116, 83, 48, 0.08);
}

.game-draw-timer > span {
  font-size: 0.78rem;
  font-weight: 900;
  color: #8a6547;
}

.game-draw-timer strong {
  font-size: 1.15rem;
  line-height: 1.2;
  color: #30283a;
}

.game-draw-timer .game-timer-meter {
  width: 100%;
}

.game-draw-note {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 244, 227, 0.78);
  border: 1px dashed rgba(138, 101, 71, 0.26);
  color: #756456;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.7;
}

.game-draw-tools {
  padding: 14px;
  border-radius: 22px;
  background: #fff8eb;
  border: 1px solid rgba(183, 148, 112, 0.24);
}

.game-canvas-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-canvas-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.game-canvas-label span {
  font-size: 0.95rem;
  font-weight: 900;
  color: #8a6547;
}

.game-canvas-label small {
  font-size: 0.78rem;
  font-weight: 800;
  color: #756456;
}

.game-canvas-card #gameCanvas,
.game-canvas-card .game-canvas {
  width: 100%;
  max-width: 768px;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 18px;
  background: #fffdf8;
  border: 2px solid rgba(138, 101, 71, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  touch-action: none;
}

.game-submit-bar {
  position: sticky;
  bottom: 10px;
  z-index: 30;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;

  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid rgba(183, 148, 112, 0.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.14);
}

.game-submit-bar p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #756456;
  line-height: 1.6;
}

.game-submit-bar .btn {
  width: 100%;
}

@media (max-width: 760px) {
  .game-draw-header {
    grid-template-columns: 1fr;
  }

  .game-draw-timer {
    justify-items: stretch;
    place-items: stretch;
    padding: 12px 14px;
  }

  .game-draw-timer strong {
    font-size: 1rem;
  }

  .game-draw-tools {
    padding: 12px;
  }

  .game-canvas-card {
    padding: 10px;
    border-radius: 20px;
  }

  .game-canvas-label {
    display: grid;
    gap: 3px;
  }

  .game-canvas-card #gameCanvas,
  .game-canvas-card .game-canvas {
    border-radius: 14px;
  }

  .game-submit-bar {
    grid-template-columns: 1fr;
    bottom: 8px;
    border-radius: 20px;
  }
}

/* =========================
   Drawing screen / FA
========================= */

.game-fa-screen {
  display: grid;
  gap: 14px;
}

.game-fa-workspace-new {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.game-fa-reference-card {
  position: sticky;
  top: 150px;

  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-target-oc-new {
  overflow: hidden;
  border-radius: 18px;
  background: #fffdf8;
  border: 2px solid rgba(138, 101, 71, 0.22);
}

.game-target-oc-new img {
  display: block;
  width: 100%;
  height: auto;
}

.game-fa-drawing-area {
  display: grid;
  gap: 14px;
  min-width: 0;
}

@media (max-width: 900px) {
  .game-fa-workspace-new {
    grid-template-columns: 1fr;
  }

  .game-fa-reference-card {
    position: static;
  }

  .game-target-oc-new {
    max-width: 360px;
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .game-fa-reference-card {
    padding: 10px;
    border-radius: 20px;
  }

  .game-target-oc-new {
    max-width: 240px;
    border-radius: 16px;
  }

  .game-fa-workspace-new {
    gap: 12px;
  }
}

/* =========================
   Submitted waiting screen
========================= */

.game-submitted-screen {
  display: grid;
  gap: 14px;
}

.game-submitted-hero {
  display: grid;
  gap: 10px;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 213, 158, 0.42), transparent 34%),
    radial-gradient(circle at bottom right, rgba(233, 169, 159, 0.24), transparent 36%),
    linear-gradient(135deg, #fffdf7, #fff4e3);
  border: 1px solid rgba(183, 148, 112, 0.24);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-submitted-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: #30283a;
}

.game-submitted-hero p {
  max-width: 640px;
  margin: 0;
  line-height: 1.8;
  color: #6d5a4c;
  font-weight: 800;
}

.game-submitted-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-submitted-preview img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  background: #fffdf8;
  border: 2px solid rgba(138, 101, 71, 0.22);
}

.game-submitted-screen .game-submit-bar {
  position: static;
}

.game-submitted-screen .game-submit-bar .btn {
  width: 100%;
}

@media (max-width: 760px) {
  .game-submitted-hero {
    padding: 18px;
    border-radius: 22px;
  }

  .game-submitted-preview {
    padding: 10px;
    border-radius: 20px;
  }

  .game-submitted-preview img {
    border-radius: 14px;
  }
}

/* =========================
   Result screen
========================= */

.game-result-screen {
  display: grid;
  gap: 16px;
}

.game-result-hero {
  display: grid;
  gap: 10px;
  padding: 28px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(255, 213, 158, 0.46), transparent 34%),
    radial-gradient(circle at bottom right, rgba(233, 169, 159, 0.26), transparent 36%),
    linear-gradient(135deg, #fffdf7, #fff4e3);
  border: 1px solid rgba(183, 148, 112, 0.24);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-result-hero h2 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.06em;
  color: #30283a;
}

.game-result-hero p {
  max-width: 680px;
  margin: 0;
  line-height: 1.8;
  color: #6d5a4c;
  font-weight: 800;
}

.game-result-list-new {
  display: grid;
  gap: 18px;
}

.game-result-character-new {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 14px 30px rgba(116, 83, 48, 0.10);
}

.game-result-character-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.game-result-character-head h3 {
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 2rem);
  letter-spacing: -0.04em;
  color: #30283a;
}

.game-result-character-head > span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff0dc;
  border: 1px solid rgba(183, 148, 112, 0.22);
  color: #8a6547;
  font-size: 0.85rem;
  font-weight: 900;
}

.game-result-original-new {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 248, 235, 0.82);
  border: 1px dashed rgba(138, 101, 71, 0.24);
}

.game-result-original-new img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 18px;
  background: #fffdf8;
  border: 2px solid rgba(138, 101, 71, 0.22);
}

.game-result-fa-area {
  display: grid;
  gap: 10px;
}

.game-result-fa-area h4 {
  margin: 0;
  font-size: 1rem;
  color: #8a6547;
}

.game-result-fanarts-new {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.game-result-fanart-card-new {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  background: #fffaf0;
  border: 1px solid rgba(183, 148, 112, 0.24);
}

.game-result-fanart-card-new img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(138, 101, 71, 0.18);
}

.game-result-fanart-card-new p {
  margin: 0;
  color: #756456;
  font-size: 0.85rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .game-result-hero {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .game-result-character-new {
    padding: 12px;
    border-radius: 22px;
  }

  .game-result-character-head {
    display: grid;
  }

  .game-result-original-new img {
    max-width: 320px;
  }

  .game-result-fanarts-new {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* =========================
   Mobile drawing focus
========================= */

@media (max-width: 760px) {
  body:has(#gameCanvas) .game-main-layout {
    display: block;
  }

  body:has(#gameCanvas) .game-side-panel {
    margin-top: 18px;
  }

  body:has(#gameCanvas) .game-side-section:first-child,
  body:has(#gameCanvas) .game-side-section:nth-child(2) {
    display: none;
  }

  body:has(#gameCanvas) .game-room-status {
    display: grid;
    grid-template-columns: 1fr;
  }

  body:has(#gameCanvas) .game-stage-panel {
    padding: 10px;
  }

  body:has(#gameCanvas) .game-draw-header {
    gap: 10px;
  }

  body:has(#gameCanvas) .game-draw-header h2 {
    font-size: 1.45rem;
  }

  body:has(#gameCanvas) .game-draw-header p {
    font-size: 0.9rem;
  }

  body:has(#gameCanvas) .game-draw-note {
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  body:has(#gameCanvas) .game-draw-tools {
    padding: 10px;
  }

  body:has(#gameCanvas) .game-draw-toolbar {
    gap: 10px;
  }

  body:has(#gameCanvas) .game-tool-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:has(#gameCanvas) .game-tool-actions button {
    min-height: 40px;
    font-size: 0.82rem;
  }

  body:has(#gameCanvas) .game-layer-panel {
    margin-top: 10px;
  }

  body:has(#gameCanvas) .game-layer-tools {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body:has(#gameCanvas) .game-layer-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body:has(#gameCanvas) .game-canvas-card {
    margin-inline: -4px;
  }

  body:has(#gameCanvas) #gameCanvas,
  body:has(#gameCanvas) .game-canvas {
    width: 100%;
    max-width: none;
  }

  body:has(#gameCanvas) .game-submit-bar {
    position: sticky;
    bottom: 8px;
  }
}

/* =========================
   Mobile FA reference
========================= */

@media (max-width: 760px) {
  .game-fa-workspace-new {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-fa-reference-card {
    position: sticky;
    top: 8px;
    z-index: 25;
    padding: 8px;
    border-radius: 18px;
  }

  .game-fa-reference-card .game-canvas-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .game-fa-reference-card .game-canvas-label span {
    font-size: 0.86rem;
  }

  .game-fa-reference-card .game-canvas-label small {
    font-size: 0.72rem;
  }

  .game-target-oc-new {
    max-width: 180px;
    margin: 0 auto;
    border-radius: 14px;
  }

  .game-target-oc-new img {
    max-height: 180px;
    object-fit: contain;
  }
}

/* =========================
   Drawing mode compact
========================= */

.game-shell.is-drawing-mode .game-main-layout {
  grid-template-columns: 1fr;
}

.game-shell.is-drawing-mode .game-topbar {
  position: static;
  padding: 12px 14px;
}

.game-shell.is-drawing-mode .game-topbar-status {
  margin-bottom: 4px;
}

.game-shell.is-drawing-mode .game-topbar-title {
  font-size: 1.1rem;
}

.game-shell.is-drawing-mode .game-stage-panel {
  padding: 12px;
}

.game-floating-message {
  margin: 0;
  min-height: 1.2em;
}

@media (max-width: 760px) {
  .game-shell.is-drawing-mode {
    gap: 8px;
  }

  .game-shell.is-drawing-mode .game-topbar {
    border-radius: 18px;
  }

  .game-shell.is-drawing-mode .game-stage-panel {
    padding: 8px;
    border-radius: 18px;
  }

  .game-shell.is-drawing-mode .game-draw-header {
    gap: 8px;
  }

  .game-shell.is-drawing-mode .game-draw-header h2 {
    font-size: 1.35rem;
  }

  .game-shell.is-drawing-mode .game-draw-header p {
    display: none;
  }

  .game-shell.is-drawing-mode .game-draw-note {
    display: none;
  }
}

/* =========================
   FA focus layout
========================= */

.game-fa-screen {
  display: grid;
  gap: 12px;
}

.game-fa-focus-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.game-fa-reference-inline {
  position: sticky;
  top: 90px;

  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf8, #fff3df);
  border: 1px solid rgba(183, 148, 112, 0.28);
  box-shadow: 0 12px 24px rgba(116, 83, 48, 0.10);
}

.game-fa-reference-inline img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 16px;
  background: #fffdf8;
  border: 2px solid rgba(138, 101, 71, 0.22);
}

/* タブレット以下：資料をキャンバスのすぐ上へ */
@media (max-width: 900px) {
  .game-fa-focus-card {
    grid-template-columns: 1fr;
  }

  .game-fa-reference-inline {
    position: static;
  }

  .game-fa-reference-inline img {
    max-width: 260px;
    max-height: 260px;
    margin: 0 auto;
  }
}

/* スマホ：スクロール量をさらに減らす */
@media (max-width: 760px) {
  .game-fa-screen {
    gap: 8px;
  }

  .game-fa-focus-card {
    gap: 8px;
  }

  .game-fa-reference-inline {
    padding: 8px;
    border-radius: 18px;
  }

  .game-fa-reference-inline .game-canvas-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .game-fa-reference-inline img {
    max-width: 180px;
    max-height: 180px;
    border-radius: 14px;
  }

  .game-fa-focus-card .game-canvas-card {
    margin-inline: -2px;
  }
}

.game-tool-box {
  padding: 10px;
  border-radius: 20px;
  background: #fff8eb;
  border: 1px solid rgba(183, 148, 112, 0.24);
}

/* =========================
   Starting countdown / warm theme
========================= */

.game-starting-screen {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 420px;
  padding: 32px 18px;
  text-align: center;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(255, 213, 158, 0.46), transparent 34%),
    radial-gradient(circle at bottom right, rgba(233, 169, 159, 0.28), transparent 36%),
    linear-gradient(135deg, #fffdf7, #fff4e3);
  border: 1px solid rgba(183, 148, 112, 0.26);
  box-shadow: 0 16px 36px rgba(116, 83, 48, 0.12);
}

.game-starting-screen h2 {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 5rem);
  line-height: 1;
  color: #30283a;
  letter-spacing: -0.06em;
}

.game-starting-screen p {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #756456;
}

.game-starting-count {
  display: grid;
  place-items: center;
  min-width: 92px;
  height: 92px;
  padding: 0 22px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #f5cfaa, #e9a99f);
  color: #3a2d25;
  font-size: 2.9rem;
  font-weight: 1000;
  box-shadow:
    0 14px 28px rgba(116, 83, 48, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.65);
  animation: gameStartWarmPulse 0.9s infinite;
}

@keyframes gameStartWarmPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08) rotate(-1deg);
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 760px) {
  .game-starting-screen {
    min-height: 320px;
    border-radius: 22px;
  }

  .game-starting-count {
    min-width: 76px;
    height: 76px;
    font-size: 2.2rem;
  }
}

/* =========================
   Compact layer tools
========================= */

.game-layer-panel {
  padding: 10px;
  border-radius: 18px;
}

.game-layer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.game-layer-head h3 {
  margin: 0;
  font-size: 1rem;
}

.game-layer-head .eyebrow {
  margin-bottom: 2px;
}

.game-layer-head #layerStatusText {
  margin: 0;
  font-size: 0.78rem;
  text-align: right;
}

.game-layer-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.game-layer-tools .layer-btn {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 14px;
}

.game-layer-tools .layer-btn small {
  display: none;
}

.game-layer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.game-layer-actions button {
  min-height: 40px;
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .game-layer-head {
    display: grid;
    gap: 4px;
  }

  .game-layer-head #layerStatusText {
    text-align: left;
  }

  .game-layer-panel {
    padding: 8px;
  }

  .game-layer-tools .layer-btn {
    min-height: 42px;
  }
}

/* =========================
   FA layout by screen shape
========================= */

/* 基本：横に広い画面は左資料・右キャンバス */
.game-fa-focus-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.game-fa-reference-inline {
  position: sticky;
  top: 90px;
}

/* タブレット横向きも左資料を維持 */
@media (min-width: 761px) and (orientation: landscape) {
  .game-fa-focus-card {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .game-fa-reference-inline {
    position: sticky;
    top: 90px;
  }

  .game-fa-reference-inline img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
  }
}

/* 縦長画面は資料を上にする */
@media (max-width: 900px) and (orientation: portrait) {
  .game-fa-focus-card {
    grid-template-columns: 1fr;
  }

  .game-fa-reference-inline {
    position: static;
  }

  .game-fa-reference-inline img {
    max-width: 260px;
    max-height: 260px;
    margin: 0 auto;
    object-fit: contain;
  }
}

/* スマホはさらに小さく */
@media (max-width: 760px) {
  .game-fa-focus-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .game-fa-reference-inline {
    position: static;
    padding: 8px;
    border-radius: 18px;
  }

  .game-fa-reference-inline img {
    max-width: 180px;
    max-height: 180px;
    margin: 0 auto;
    object-fit: contain;
  }
}


/* =========================
   Fixed countdown overlay
========================= */

.game-starting-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;

  text-align: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 218, 170, 0.55), transparent 34%),
    radial-gradient(circle at 70% 80%, rgba(233, 169, 159, 0.36), transparent 38%),
    rgba(255, 247, 232, 0.94);
  backdrop-filter: blur(8px);
}

.game-starting-screen .mini-label {
  margin: 0;
  color: #b9836a;
  letter-spacing: 0.16em;
}

.game-starting-screen h2 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 5rem);
  color: #30283a;
  line-height: 1;
}

.game-starting-screen p {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 900;
  color: #756456;
}

.game-starting-count {
  display: grid;
  place-items: center;

  width: clamp(120px, 24vw, 220px);
  height: clamp(120px, 24vw, 220px);
  border-radius: 999px;

  background:
    linear-gradient(180deg, #ffe3bc, #e9a99f);
  border: 4px solid rgba(255, 255, 255, 0.72);

  color: #3a2d25;
  font-size: clamp(4.8rem, 18vw, 10rem);
  font-weight: 1000;
  line-height: 1;

  box-shadow:
    0 24px 50px rgba(116, 83, 48, 0.22),
    inset 0 3px 0 rgba(255, 255, 255, 0.7);

  animation: gameCountdownPop 0.9s ease-in-out infinite;
}

@keyframes gameCountdownPop {
  0% {
    transform: scale(0.92);
  }

  45% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(0.92);
  }
}

/* =========================
   Result FA grid
========================= */

.game-result-fanarts-new {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.game-result-fanart-card-new {
  min-width: 0;
  padding: 8px;
  border-radius: 18px;
}

.game-result-fanart-card-new img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #fffdf8;
}

.game-result-fanart-card-new p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-weight: 900;
  color: #756456;
}

/* 狭めタブレットでも3列維持 */
@media (min-width: 761px) {
  .game-result-fanarts-new {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* スマホは2列 */
@media (max-width: 760px) {
  .game-result-fanarts-new {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .game-result-fanart-card-new {
    padding: 6px;
    border-radius: 16px;
  }

  .game-result-fanart-card-new img {
    border-radius: 12px;
  }
}


/* =========================
   Drawing / prevent text selection
========================= */

.game-draw-screen,
.game-draw-screen *,
.game-stage-panel,
.game-stage-panel *,
.game-canvas-card,
.game-canvas-card *,
.game-draw-tools,
.game-draw-tools *,
#gameCanvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#gameCanvas {
  touch-action: none;
  -webkit-user-drag: none;
  user-select: none;
  cursor: crosshair;
}

/* 入力欄だけは普通に文字選択・入力できるように戻す */
.game-draw-screen input,
.game-draw-screen textarea,
.game-stage-panel input,
.game-stage-panel textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* =========================
   Game drawing toolbar / left fixed
========================= */

.is-drawing-mode .game-stage-panel {
  position: relative;
}

.is-drawing-mode .game-tool-box {
  position: fixed;
  left: 10px;
  top: 90px;
  z-index: 50;

  width: 74px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;

  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(180, 160, 255, 0.45);
  box-shadow: 0 12px 30px rgba(80, 60, 150, 0.16);
  backdrop-filter: blur(10px);
}

.is-drawing-mode .game-draw-toolbar,
.is-drawing-mode .game-layer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.is-drawing-mode .game-draw-tools,
.is-drawing-mode .game-tool-actions,
.is-drawing-mode .game-layer-tools,
.is-drawing-mode .game-layer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.is-drawing-mode .game-draw-toolbar button,
.is-drawing-mode .game-layer-panel button {
  width: 54px;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.2;
}

.is-drawing-mode .game-color-tool,
.is-drawing-mode .game-size-tool,
.is-drawing-mode .game-pressure-toggle {
  width: 54px;
  padding: 6px;
  border-radius: 16px;
  text-align: center;
}

.is-drawing-mode .game-color-tool span,
.is-drawing-mode .game-size-tool span,
.is-drawing-mode .game-pressure-toggle span small,
.is-drawing-mode .game-layer-head,
.is-drawing-mode .layer-order {
  display: none;
}

.is-drawing-mode #gamePenColor {
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
}

.is-drawing-mode #gamePenSize {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 42px;
  height: 110px;
}

.is-drawing-mode #gamePenSizeText {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.is-drawing-mode .game-layer-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(120, 100, 200, 0.25);
}

.is-drawing-mode .game-canvas-card,
.is-drawing-mode .game-fa-focus-card {
  margin-left: 84px;
}

@media (max-width: 700px) {
  .is-drawing-mode .game-tool-box {
    left: 6px;
    top: 72px;
    width: 62px;
    padding: 6px;
    border-radius: 20px;
    max-height: calc(100vh - 86px);
  }

  .is-drawing-mode .game-draw-toolbar button,
  .is-drawing-mode .game-layer-panel button,
  .is-drawing-mode .game-color-tool,
  .is-drawing-mode .game-size-tool,
  .is-drawing-mode .game-pressure-toggle {
    width: 48px;
    min-height: 42px;
    font-size: 11px;
  }

  .is-drawing-mode #gamePenColor {
    width: 38px;
    height: 38px;
  }

  .is-drawing-mode #gamePenSize {
    width: 38px;
    height: 92px;
  }

  .is-drawing-mode .game-canvas-card,
  .is-drawing-mode .game-fa-focus-card {
    margin-left: 66px;
  }
}

.is-drawing-mode .game-tool-actions button,
.is-drawing-mode .game-layer-actions button,
.is-drawing-mode .game-layer-tools button {
  font-size: 22px;
}

.is-drawing-mode .game-tool-actions button.is-active {
  transform: scale(1.08);
}

/* =========================
   OCFA game / left tool bar
========================= */

.is-drawing-mode .game-stage-panel {
  position: relative;
}

.is-drawing-mode .game-tool-box {
  position: fixed;
  left: 10px;
  top: 92px;
  z-index: 80;

  width: 76px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;

  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(175, 155, 255, 0.42);
  box-shadow: 0 14px 34px rgba(88, 72, 160, 0.18);
  backdrop-filter: blur(10px);
}

.is-drawing-mode .game-draw-toolbar,
.is-drawing-mode .game-layer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.is-drawing-mode .game-draw-tools,
.is-drawing-mode .game-tool-actions,
.is-drawing-mode .game-layer-tools,
.is-drawing-mode .game-layer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.is-drawing-mode .game-tool-actions button,
.is-drawing-mode .game-layer-tools button,
.is-drawing-mode .game-layer-actions button {
  width: 56px;
  min-height: 48px;
  padding: 6px;
  border-radius: 17px;
  font-size: 22px;
  line-height: 1;
}

.is-drawing-mode .game-tool-actions button.is-active,
.is-drawing-mode .game-layer-tools button.is-active {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(150, 130, 255, 0.22);
}

.is-drawing-mode .game-color-tool,
.is-drawing-mode .game-size-tool,
.is-drawing-mode .game-pressure-toggle,
.is-drawing-mode .game-stabilizer-toggle,
.is-drawing-mode .game-stabilizer-strength {
  width: 56px;
  padding: 7px 5px;
  border-radius: 17px;
  text-align: center;
}

.is-drawing-mode .game-color-tool span,
.is-drawing-mode .game-size-tool span,
.is-drawing-mode .game-pressure-toggle small,
.is-drawing-mode .game-stabilizer-toggle small,
.is-drawing-mode .game-stabilizer-strength span,
.is-drawing-mode .game-layer-head {
  display: none;
}

.is-drawing-mode #gamePenColor {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
}

.is-drawing-mode #gamePenSize,
.is-drawing-mode #gameStabilizerStrength {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 42px;
  height: 96px;
}

.is-drawing-mode #gamePenSizeText {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1;
}

.is-drawing-mode .game-pressure-box,
.is-drawing-mode .game-stabilizer-box,
.is-drawing-mode .game-layer-panel {
  padding-top: 8px;
  border-top: 1px dashed rgba(130, 110, 210, 0.24);
}

.is-drawing-mode .game-pressure-toggle span,
.is-drawing-mode .game-stabilizer-toggle span {
  display: block;
  font-size: 11px;
  line-height: 1.2;
}

.is-drawing-mode .game-pressure-toggle input,
.is-drawing-mode .game-stabilizer-toggle input {
  margin: 0 0 4px;
}

.is-drawing-mode .game-canvas-card,
.is-drawing-mode .game-fa-focus-card {
  margin-left: 88px;
}

@media (max-width: 700px) {
  .is-drawing-mode .game-tool-box {
    left: 6px;
    top: 74px;
    width: 64px;
    max-height: calc(100vh - 88px);
    padding: 6px;
    border-radius: 20px;
  }

  .is-drawing-mode .game-tool-actions button,
  .is-drawing-mode .game-layer-tools button,
  .is-drawing-mode .game-layer-actions button {
    width: 50px;
    min-height: 44px;
    font-size: 20px;
    border-radius: 15px;
  }

  .is-drawing-mode .game-color-tool,
  .is-drawing-mode .game-size-tool,
  .is-drawing-mode .game-pressure-toggle,
  .is-drawing-mode .game-stabilizer-toggle,
  .is-drawing-mode .game-stabilizer-strength {
    width: 50px;
    padding: 6px 4px;
    border-radius: 15px;
  }

  .is-drawing-mode #gamePenColor {
    width: 38px;
    height: 38px;
  }

  .is-drawing-mode #gamePenSize,
  .is-drawing-mode #gameStabilizerStrength {
    width: 38px;
    height: 82px;
  }

  .is-drawing-mode .game-canvas-card,
  .is-drawing-mode .game-fa-focus-card {
    margin-left: 70px;
  }
}

/* =========================
   OCFA game / tool bar cleanup
========================= */

/* 提出ボタン固定を解除 */
.is-drawing-mode .game-submit-bar {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
}

/* 左ツールバー本体 */
.is-drawing-mode .game-tool-box {
  position: fixed;
  left: 10px;
  top: 88px;
  z-index: 90;

  width: 70px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  overflow-x: hidden;

  padding: 7px;
  border-radius: 24px;
}

/* ツールバー内を縦に詰める */
.is-drawing-mode .game-draw-toolbar {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.is-drawing-mode .game-draw-tools,
.is-drawing-mode .game-tool-actions,
.is-drawing-mode .game-layer-tools,
.is-drawing-mode .game-layer-actions,
.is-drawing-mode .game-tool-setting-button-area {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ボタン共通 */
.is-drawing-mode .game-tool-actions button,
.is-drawing-mode .game-layer-tools button,
.is-drawing-mode .game-layer-actions button,
.is-drawing-mode .game-tool-setting-button-area button {
  width: 52px;
  min-height: 44px;
  padding: 5px;
  border-radius: 16px;

  display: grid;
  place-items: center;

  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

/* 上・下だけ少し文字用 */
.is-drawing-mode .game-layer-tools button {
  font-size: 18px;
  font-weight: 800;
}

/* 色・太さ */
.is-drawing-mode .game-color-tool,
.is-drawing-mode .game-size-tool {
  width: 52px;
  padding: 6px 4px;
  border-radius: 16px;
  text-align: center;
}

/* 不要な文字を隠す */
.is-drawing-mode .game-color-tool span,
.is-drawing-mode .game-size-tool span,
.is-drawing-mode .game-layer-panel,
.is-drawing-mode .game-tool-settings-head small {
  display: none !important;
}

.is-drawing-mode #gamePenColor {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

.is-drawing-mode #gamePenSize {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 38px;
  height: 86px;
}

.is-drawing-mode #gamePenSizeText {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1;
}

/* 設定パネルは閉じてる時は完全に非表示 */
.is-drawing-mode .game-tool-settings-panel {
  display: none;
}

/* ⚙️を押した時だけ、左バーの右に出す */
.is-drawing-mode .game-tool-settings-panel.is-open {
  display: block;
  position: fixed;
  left: 88px;
  top: 96px;
  z-index: 100;

  width: min(280px, calc(100vw - 110px));
  padding: 14px;
  border-radius: 22px;

  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(175, 155, 255, 0.38);
  box-shadow: 0 14px 34px rgba(88, 72, 160, 0.2);
  backdrop-filter: blur(10px);
}

.is-drawing-mode .game-tool-settings-panel label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.is-drawing-mode .game-tool-settings-panel small {
  display: block;
  font-size: 11px;
  opacity: 0.75;
}

.is-drawing-mode .game-stabilizer-strength {
  display: block !important;
}

.is-drawing-mode .game-stabilizer-strength input {
  width: 100%;
  margin-top: 8px;
}

/* キャンバスが左バーに隠れないように */
.is-drawing-mode .game-canvas-card,
.is-drawing-mode .game-fa-focus-card {
  margin-left: 78px;
}

@media (max-width: 700px) {
  .is-drawing-mode .game-tool-box {
    left: 6px;
    top: 74px;
    width: 60px;
    max-height: calc(100vh - 88px);
    padding: 5px;
    border-radius: 20px;
  }

  .is-drawing-mode .game-tool-actions button,
  .is-drawing-mode .game-layer-tools button,
  .is-drawing-mode .game-layer-actions button,
  .is-drawing-mode .game-tool-setting-button-area button {
    width: 48px;
    min-height: 42px;
    font-size: 19px;
    border-radius: 15px;
  }

  .is-drawing-mode .game-layer-tools button {
    font-size: 17px;
  }

  .is-drawing-mode .game-color-tool,
  .is-drawing-mode .game-size-tool {
    width: 48px;
  }

  .is-drawing-mode #gamePenColor {
    width: 36px;
    height: 36px;
  }

  .is-drawing-mode #gamePenSize {
    width: 36px;
    height: 76px;
  }

  .is-drawing-mode .game-tool-settings-panel.is-open {
    left: 72px;
    top: 82px;
    width: calc(100vw - 86px);
    max-width: 260px;
  }

  .is-drawing-mode .game-canvas-card,
  .is-drawing-mode .game-fa-focus-card {
    margin-left: 62px;
  }
}

.is-drawing-mode .game-tool-settings-panel[hidden] {
  display: none !important;
}

.is-drawing-mode .game-tool-settings-panel.is-open {
  display: block !important;
}


/* iPhoneでツールボタンが横並び・重なりになるのを防ぐ */
.is-drawing-mode .game-tool-box,
.is-drawing-mode .game-draw-toolbar,
.is-drawing-mode .game-draw-tools,
.is-drawing-mode .game-tool-actions,
.is-drawing-mode .game-layer-tools,
.is-drawing-mode .game-layer-actions,
.is-drawing-mode .game-tool-setting-button-area {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.is-drawing-mode .game-tool-actions button,
.is-drawing-mode .game-layer-tools button,
.is-drawing-mode .game-layer-actions button,
.is-drawing-mode .game-tool-setting-button-area button {
  flex: 0 0 auto !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
}

/* FA画面でも描画キャンバスを中央寄せにする */
.is-drawing-mode .game-fa-focus-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.is-drawing-mode .game-fa-focus-card .game-canvas-card {
  width: min(100%, 820px);
  margin-right: auto;
}

.is-drawing-mode .game-fa-reference-inline {
  width: min(100%, 520px);
  align-self: center;
}

@media (max-width: 700px) {
  .is-drawing-mode .game-fa-focus-card {
    align-items: stretch;
  }

  .is-drawing-mode .game-fa-focus-card .game-canvas-card {
    width: 100%;
    margin-right: 0;
  }
}

/* ツール全体 */
.game-draw-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 色・太さのエリア */
.game-draw-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* 色ボタンと太さスライダーの箱 */
.game-color-tool,
.game-size-tool {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
}

/* ラベル文字が邪魔なら消す */
.game-color-tool > span,
.game-size-tool > span {
  display: none;
}

/* 色ボタンのズレ修正 */
.game-color-tool input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 74px;
  height: 74px;
  padding: 0;
  margin: 0 auto;
  border: none;
  background: transparent;
  display: block;
  cursor: pointer;
}

.game-color-tool input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.game-color-tool input[type="color"]::-webkit-color-swatch {
  border: 4px solid #d7cdbf;
  border-radius: 20px;
}

.game-color-tool input[type="color"]::-moz-color-swatch {
  border: 4px solid #d7cdbf;
  border-radius: 20px;
}

/* 太さスライダーも中央 */
.game-size-tool input[type="range"] {
  width: 100%;
  max-width: 56px;
  margin: 0 auto;
  display: block;
}

.game-color-tool {
  padding: 0 !important;
}

.game-color-tool input[type="color"] {
  flex: 0 0 auto;
  align-self: center;
}

.game-floating-owner-tools {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.game-floating-owner-tools .danger-btn {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(80, 40, 40, 0.18);
}

@media (max-width: 700px) {
  .game-floating-owner-tools {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 90px);
  }

  .game-floating-owner-tools .danger-btn {
    font-size: 12px;
    padding: 9px 12px;
  }
}

/* =========================
   OCFA game tool settings fix
========================= */

.game-tool-settings-panel[hidden] {
  display: none !important;
}

.game-tool-settings-panel.is-open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
}

#toolSettingsBtn {
  pointer-events: auto !important;
  touch-action: manipulation;
  cursor: pointer;
}

#toolSettingsBtn.is-active {
  transform: scale(1.06);
}

/* =========================
   OCFA tool settings panel strong fix
========================= */

.game-tool-box {
  position: relative;
  z-index: 9990;
}

.game-tool-settings-panel[hidden] {
  display: none !important;
}

.game-tool-settings-panel {
  position: fixed !important;
  left: 96px !important;
  bottom: 24px !important;
  width: min(280px, calc(100vw - 116px)) !important;
  max-height: 70vh !important;
  overflow-y: auto !important;

  display: none !important;
  padding: 14px !important;
  border-radius: 22px !important;

  background: rgba(255, 253, 248, 0.98) !important;
  border: 2px solid rgba(214, 198, 235, 0.95) !important;
  box-shadow: 0 18px 42px rgba(49, 38, 60, 0.22) !important;

  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}

.game-tool-settings-panel.is-open {
  display: block !important;
}

#toolSettingsBtn {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  position: relative;
  z-index: 10001;
}

#toolSettingsBtn.is-active {
  transform: scale(1.06);
}

/* iPhone向け */
@media (max-width: 700px) {
  .game-tool-settings-panel {
    left: 88px !important;
    bottom: 16px !important;
    width: calc(100vw - 104px) !important;
    max-height: 62vh !important;
  }
}

/* =========================
   OCFA smartphone canvas offset
========================= */

@media (max-width: 700px) {
  .is-drawing-mode .game-canvas-card {
    margin-left: 72px !important;
    width: calc(100% - 72px) !important;
  }

  .is-drawing-mode .game-fa-focus-card {
    padding-left: 72px !important;
  }

  .is-drawing-mode .game-fa-focus-card .game-canvas-card {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .is-drawing-mode .game-canvas {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* =========================
   OCFA mobile toolbar + canvas final fix
========================= */

@media (max-width: 700px) {
  /* ⚙️パネルがツールバー内で切られるのを防ぐ */
  .is-drawing-mode .game-tool-box {
    overflow: visible !important;
    max-height: none !important;
    z-index: 10000 !important;
  }

  .is-drawing-mode .game-draw-toolbar {
    overflow: visible !important;
  }

  /* 設定パネルをツールバーの右側に強制表示 */
  .is-drawing-mode .game-tool-settings-panel {
    position: fixed !important;
    left: 76px !important;
    top: 86px !important;
    right: 10px !important;
    bottom: auto !important;

    width: auto !important;
    max-width: none !important;
    max-height: 64vh !important;
    overflow-y: auto !important;

    padding: 14px !important;
    border-radius: 22px !important;

    background: rgba(255, 253, 248, 0.98) !important;
    border: 2px solid rgba(214, 198, 235, 0.95) !important;
    box-shadow: 0 18px 42px rgba(49, 38, 60, 0.24) !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 10050 !important;
  }

  .is-drawing-mode .game-tool-settings-panel[hidden] {
    display: none !important;
  }

  .is-drawing-mode .game-tool-settings-panel.is-open {
    display: block !important;
  }

  #toolSettingsBtn {
    position: relative !important;
    z-index: 10060 !important;
  }

  /* ここからキャンバスの大きさ調整 */
  .is-drawing-mode .game-stage-panel {
    padding-left: 0 !important;
    padding-right: 4px !important;
  }

  /* FA全体を右に寄せる。ただし二重に狭くしない */
  .is-drawing-mode .game-fa-focus-card {
    padding-left: 0 !important;
    margin-left: 66px !important;
    width: calc(100vw - 86px) !important;
    max-width: calc(100vw - 86px) !important;
    align-items: stretch !important;
  }

  .is-drawing-mode .game-fa-reference-inline,
  .is-drawing-mode .game-fa-focus-card .game-canvas-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .is-drawing-mode .game-fa-focus-card .game-canvas {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* OC単体描画も同じく右寄せ */
  .is-drawing-mode .game-draw-screen > .game-canvas-card {
    margin-left: 66px !important;
    width: calc(100vw - 86px) !important;
    max-width: calc(100vw - 86px) !important;
  }

  .is-drawing-mode .game-draw-screen > .game-canvas-card .game-canvas {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 提出バーも左バーに隠れないように */
  .is-drawing-mode .game-submit-bar {
    margin-left: 66px !important;
    width: calc(100vw - 86px) !important;
    max-width: calc(100vw - 86px) !important;
  }
}

/* =========================
   OCFA settings panel body mode
========================= */

#toolSettingsPanel {
  position: fixed !important;
  left: 82px !important;
  top: 88px !important;
  right: 12px !important;
  bottom: auto !important;

  width: auto !important;
  max-width: none !important;
  max-height: 64vh !important;
  overflow-y: auto !important;

  display: none !important;
  padding: 14px !important;
  border-radius: 22px !important;

  background: rgba(255, 253, 248, 0.98) !important;
  border: 2px solid rgba(214, 198, 235, 0.95) !important;
  box-shadow: 0 18px 42px rgba(49, 38, 60, 0.26) !important;

  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 999999 !important;
}

#toolSettingsPanel.is-open {
  display: block !important;
}

#toolSettingsPanel[hidden] {
  display: none !important;
}

@media (min-width: 701px) {
  #toolSettingsPanel {
    left: 100px !important;
    top: 104px !important;
    right: auto !important;
    width: 280px !important;
  }
}


/* =========================
   OCFA owner skip button static + no selection
========================= */

/* 描画中の強制スキップボタンを固定しない */
.is-drawing-mode .game-floating-owner-tools {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;

  display: grid !important;
  justify-items: stretch !important;
  align-items: stretch !important;
  gap: 8px !important;

  width: 100% !important;
  max-width: none !important;
  margin: 12px 0 0 !important;
}

/* ボタンを普通の下部ボタンっぽくする */
.is-drawing-mode .game-floating-owner-tools .danger-btn {
  width: 100% !important;
  min-height: 44px !important;
  padding: 10px 14px !important;
  border-radius: 18px !important;
  font-size: 13px !important;
}

/* 青い範囲選択・長押しメニューを防ぐ */
.game-floating-owner-tools,
.game-floating-owner-tools *,
.game-floating-owner-tools .danger-btn {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

/* 押した時の青っぽい選択感を消す */
.game-floating-owner-tools .danger-btn:focus,
.game-floating-owner-tools .danger-btn:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* =========================
   OCFA toolbar color rewrite
   通常ボタンを赤系から分離
========================= */

/* ツールバー本体も赤っぽさを減らす */
.is-drawing-mode .game-tool-box {
  background: rgba(255, 253, 248, 0.96) !important;
  border: 2px solid rgba(170, 150, 235, 0.38) !important;
  box-shadow: 0 14px 34px rgba(88, 72, 160, 0.16) !important;
}

/* ツールバー内の通常ボタン */
.is-drawing-mode .game-tool-actions button,
.is-drawing-mode .game-layer-tools button,
.is-drawing-mode .game-layer-actions button,
.is-drawing-mode .game-tool-setting-button-area button {
  background:
    linear-gradient(180deg, #ffffff, #f3efff) !important;
  color: #3b3150 !important;

  border: 1px solid rgba(125, 103, 190, 0.24) !important;
  box-shadow:
    0 6px 14px rgba(90, 70, 150, 0.10),
    inset 0 2px 0 rgba(255, 255, 255, 0.75) !important;
}

/* hover / active でも赤くしない */
.is-drawing-mode .game-tool-actions button:hover,
.is-drawing-mode .game-layer-tools button:hover,
.is-drawing-mode .game-layer-actions button:hover,
.is-drawing-mode .game-tool-setting-button-area button:hover,
.is-drawing-mode .game-tool-actions button:active,
.is-drawing-mode .game-layer-tools button:active,
.is-drawing-mode .game-layer-actions button:active,
.is-drawing-mode .game-tool-setting-button-area button:active {
  background:
    linear-gradient(180deg, #f8f5ff, #e9e1ff) !important;
  color: #35295a !important;
  filter: none !important;
}

/* 選択中：紫でハッキリ */
.is-drawing-mode .game-tool-actions button.is-active,
.is-drawing-mode .game-layer-tools button.is-active,
.is-drawing-mode .game-tool-setting-button-area button.is-active,
#toolSettingsBtn.is-active {
  background:
    linear-gradient(180deg, #e8ddff, #cdbdff) !important;
  color: #2f235c !important;

  border: 2px solid rgba(111, 83, 205, 0.68) !important;
  box-shadow:
    0 0 0 3px rgba(145, 115, 235, 0.22),
    0 10px 20px rgba(90, 70, 160, 0.14) !important;

  transform: scale(1.06);
}

/* ゴミ箱だけは危険色。でも赤すぎない薄ピンク */
.is-drawing-mode #clearLayerBtn {
  background:
    linear-gradient(180deg, #fff0f2, #ffd6dd) !important;
  color: #6a2c3a !important;

  border: 1px solid rgba(190, 80, 105, 0.28) !important;
}

/* ゴミ箱hoverも濃くしすぎない */
.is-drawing-mode #clearLayerBtn:hover,
.is-drawing-mode #clearLayerBtn:active {
  background:
    linear-gradient(180deg, #ffe7ec, #ffc5d0) !important;
  color: #5d2632 !important;
}

/* =========================
   OCFA toolbar no text selection
========================= */

.is-drawing-mode .game-tool-box,
.is-drawing-mode .game-tool-box *,
.is-drawing-mode .game-draw-toolbar,
.is-drawing-mode .game-draw-toolbar *,
.is-drawing-mode .game-layer-panel,
.is-drawing-mode .game-layer-panel *,
.is-drawing-mode .game-submit-bar,
.is-drawing-mode .game-submit-bar *,
.is-drawing-mode .game-floating-owner-tools,
.is-drawing-mode .game-floating-owner-tools * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* ボタン押下時の青い選択・青い枠を消す */
.is-drawing-mode button,
.is-drawing-mode .btn,
#toolSettingsBtn {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

.is-drawing-mode button:focus,
.is-drawing-mode button:active,
.is-drawing-mode .btn:focus,
.is-drawing-mode .btn:active,
#toolSettingsBtn:focus,
#toolSettingsBtn:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* キーボード操作だけは見失わないようにする */
.is-drawing-mode button:focus-visible,
.is-drawing-mode .btn:focus-visible {
  outline: 3px solid rgba(145, 115, 235, 0.35) !important;
  outline-offset: 3px !important;
}


/* =========================
   OCFA mobile canvas slight left adjust
========================= */

@media (max-width: 700px) {
  /* OC描画画面：少し左へ戻す */
  .is-drawing-mode .game-draw-screen > .game-canvas-card {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }

  /* FA描画画面：少し左へ戻す */
  .is-drawing-mode .game-fa-focus-card {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }

  /* 提出バーもキャンバスと位置を合わせる */
  .is-drawing-mode .game-submit-bar {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }
}

/* =========================
   OCFA canvas offset: phone only
   iPadはずらさない
========================= */

/* まず700px以下で入れたズレを一旦リセット */
@media (min-width: 501px) {
  .is-drawing-mode .game-draw-screen > .game-canvas-card,
  .is-drawing-mode .game-fa-focus-card,
  .is-drawing-mode .game-submit-bar {
    margin-left: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding-left: 0 !important;
  }

  .is-drawing-mode .game-fa-focus-card .game-canvas-card {
    margin-left: 0 !important;
    width: min(100%, 820px) !important;
    max-width: 820px !important;
  }
}

/* スマホだけ、左ツールバーを避けて少し右へ */
@media (max-width: 500px) {
  .is-drawing-mode .game-draw-screen > .game-canvas-card {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }

  .is-drawing-mode .game-fa-focus-card {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
    padding-left: 0 !important;
  }

  .is-drawing-mode .game-fa-focus-card .game-canvas-card {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .is-drawing-mode .game-submit-bar {
    margin-left: 52px !important;
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
  }
}
