/* identity-mystery/identity-mystery.css */
:root {
  --game-accent: #0f3d3e;
  --game-accent-dim: #092829;
  --game-accent-contrast: #f0fdfa;
  --im-noir-bg: #141c22;
  --im-corkboard-bg: #1a252c;
  --im-corkboard-border: #2c3e4a;
  --im-teal-pin: #14b8a6;
  --im-teal-string: #2dd4bf;
  --im-card-bg: #fdfbf7;
  --im-card-text: #1e293b;
  --im-card-border: #e2e8f0;
}

body.game-standalone.cosy-game-theme {
  background-color: var(--im-noir-bg);
}

.im-corkboard-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: var(--im-corkboard-bg);
  border: 2px solid var(--im-corkboard-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 10px 25px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  color: #f1f5f9;
}

/* Central Header / Control Strip */
.im-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Corkboard Board Area */
.im-corkboard {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  overflow: hidden;
}

/* SVG Lines Overlay */
.im-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.im-string-line {
  stroke: var(--im-teal-string);
  stroke-width: 2px;
  stroke-linecap: round;
  transition: opacity 0.4s ease, stroke-width 0.3s ease;
}

.im-string-line.active-recent {
  opacity: 0.95;
  filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.6));
}

.im-string-line.faded-old {
  opacity: 0.2;
  stroke-width: 1.5px;
}

/* Central Mystery Portrait */
.im-portrait-card {
  position: relative;
  z-index: 3;
  background: #0f172a;
  border: 4px solid #334155;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  text-align: center;
  width: 220px;
  transition: transform 0.3s ease, border-color 0.3s ease, width 0.3s ease;
}

.im-portrait-pin {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5eead4, var(--im-teal-pin) 60%, #0f766e);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.im-portrait-frame {
  width: 160px;
  height: 160px;
  margin: 0 auto 0.75rem auto;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  border: 3px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.im-portrait-silhouette {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.im-silhouette-svg {
  width: 110px;
  height: 110px;
  fill: #94a3b8;
  transition: fill 0.6s ease;
}

.im-portrait-revealed .im-silhouette-svg {
  fill: #f8fafc;
}

.im-portrait-title {
  font-family: var(--cg-font-heading, 'Fraunces', serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 0.25rem;
}

.im-portrait-status {
  font-size: 0.82rem;
  color: var(--im-teal-string);
  margin-top: 0.2rem;
}

/* Clues Grid / Container */
.im-clues-container {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.im-clue-card {
  position: relative;
  background: var(--im-card-bg);
  color: var(--im-card-text);
  border: 1px solid var(--im-card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem 0.85rem 2.2rem;
  max-width: 260px;
  min-width: 180px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
  font-size: 0.92rem;
  line-height: 1.4;
  transform: rotate(calc(var(--rotation, 0) * 1deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.im-clue-card:hover {
  transform: rotate(0deg) scale(1.03);
  z-index: 5;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.im-card-pin {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5eead4, var(--im-teal-pin) 60%, #0f766e);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.im-clue-num {
  font-weight: 700;
  color: #0f766e;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.im-clue-text {
  font-weight: 500;
  word-break: break-word;
}

/* Action Controls Panel */
.im-action-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.im-input-group {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.im-clue-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: #f8fafc;
  font-size: 0.95rem;
}

.im-clue-input:focus {
  outline: none;
  border-color: var(--im-teal-pin);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.25);
}

.im-controls-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Responsive Overrides: PHONE (data-context="phone") */
[data-context="phone"] .im-corkboard-wrapper {
  padding: 0.85rem;
  border-radius: 10px;
}

[data-context="phone"] .im-corkboard {
  min-height: auto;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 0.25rem;
}

[data-context="phone"] .im-svg-overlay {
  display: none; /* Hide complex string lines on phone layout */
}

[data-context="phone"] .im-portrait-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  text-align: left;
}

[data-context="phone"] .im-portrait-pin {
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

[data-context="phone"] .im-portrait-frame {
  width: 64px;
  height: 64px;
  min-width: 64px;
  margin: 0;
}

[data-context="phone"] .im-silhouette-svg {
  width: 44px;
  height: 44px;
}

[data-context="phone"] .im-portrait-info {
  flex: 1;
}

[data-context="phone"] .im-clues-container {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

[data-context="phone"] .im-clue-card {
  max-width: 100%;
  min-width: unset;
  transform: none !important;
  padding: 0.65rem 0.75rem 0.65rem 2rem;
}

[data-context="phone"] .im-clue-card:hover {
  transform: none !important;
}

/* Responsive Overrides: PROJECTOR (data-context="projector") */
[data-context="projector"] .im-portrait-card {
  width: 320px;
  padding: 1.5rem;
}

[data-context="projector"] .im-portrait-frame {
  width: 240px;
  height: 240px;
  border-width: 4px;
}

[data-context="projector"] .im-silhouette-svg {
  width: 170px;
  height: 170px;
}

[data-context="projector"] .im-portrait-title {
  font-size: 1.6rem;
}

[data-context="projector"] .im-portrait-status {
  font-size: 1.1rem;
}
