/* Shared presentation for the browser and the native Study and Arena web views. */
html:not(.dark) {
  --tf-surface: #fff;
  --tf-tint: #eeedff;
  --tf-text: #28244c;
  --tf-secondary: #514b6c;
  --tf-border: #ddd9ed;
  --tf-primary: #4933ab;
  --tf-outline: #4e37c3;
}
html.dark {
  --tf-surface: #171725;
  --tf-tint: #252140;
  --tf-text: #f3efff;
  --tf-secondary: #beb6d7;
  --tf-border: #3c3654;
  --tf-primary: #5039ba;
  --tf-outline: #b7a7ff;
}
html body {
  background-image: radial-gradient(ellipse at 70% 0%, var(--tf-tint), transparent 42rem);
}
#tf-workspace-header {
  position: static;
  background: transparent !important;
  border-bottom-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.tf-clear-src-btn {
  padding: 5px 11px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
html.dark .tf-clear-src-btn {
  border-color: rgba(253, 164, 180, 0.38);
  background: rgba(253, 164, 180, 0.1);
  color: #fda4b4;
}
#tf-workspace-header > div:first-child {
  justify-content: flex-start;
  gap: .85rem 1.6rem;
}
#tf-workspace-header > div:first-child > div:first-child {
  flex: 0 0 auto;
}
#tf-workspace-header > div:nth-child(2) {
  padding-bottom: .65rem;
}
#tf-workspace,
#tf-workspace-header > div {
  max-width: 66rem;
  padding-inline: clamp(.85rem, 3vw, 2rem);
}
.tf-workspace-intro {
  padding: clamp(1rem, 3vw, 1.9rem);
  border: 1px solid var(--tf-border);
  border-radius: 1.4rem;
  color: var(--tf-text);
  background: linear-gradient(125deg, var(--tf-surface), var(--tf-tint));
}
.tf-workspace-intro h2,
#tf-arena-root .tf-arena-header h1,
#tf-webfocus-root .tf-page-title {
  font-family: inherit;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.tf-workspace-intro p {
  margin-block-start: .4rem;
  color: var(--tf-secondary);
}
#tf-workspace .paper-card,
#tf-arena-root .tf-arena-card,
#tf-webfocus-root .tf-arena-card,
#tf-websettings-root .tf-set-group {
  background: var(--tf-surface) !important;
  border-color: var(--tf-border) !important;
  padding: clamp(.9rem, 3vw, 1.55rem);
}
#tf-websettings-root .tf-set-group {
  padding: .25rem .65rem;
}
#tf-workspace .serif-head {
  font-family: inherit;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}
#tf-workspace #dropZone {
  background: var(--tf-tint) !important;
  border-color: var(--tf-outline) !important;
  padding: clamp(1rem, 3vw, 1.7rem);
}
#tf-workspace .tf-field-label {
  display: block;
  font-size: .875rem;
  font-weight: 650;
  color: var(--tf-secondary);
}
#tf-workspace .tf-field-label + :is(input, textarea) {
  margin-block-start: .35rem;
}
#tf-workspace :is(input[type="text"], textarea, select),
#tf-web-record-panel :is(input[type="text"], #tf-rec-title, textarea, select) {
  font-size: max(16px, 1rem);
}
#modeTabs {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
}
#modeTabs .mode-btn {
  min-height: 4.7rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .25rem;
  overflow-wrap: anywhere;
}
.tf-format-icon {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--tf-tint);
  color: var(--tf-text);
  border-radius: .55rem;
  font-size: 1.1rem;
  line-height: 1;
}
#modeTabs .btn-forest .tf-format-icon {
  color: #fff;
  background: rgb(255 255 255 / 18%);
}
#tf-workspace .btn-forest,
#tf-arena-root :is(.tf-arena-btn:not(.ghost):not(.amber), .tf-arena-tab.active),
#tf-webfocus-root :is(.tf-arena-btn:not(.ghost):not(.amber), .tf-arena-tab.active),
#tf-web-record-panel #tf-rec-btn {
  background: var(--tf-primary) !important;
  color: #fff !important;
}
#tf-web-record-panel.tf-recording #tf-rec-btn {
  background: #a52442 !important;
}
#tf-workspace #generateBtn {
  min-height: 3rem;
  padding-inline: 1.35rem;
}
#tf-workspace-header .sec-btn,
#tf-workspace-header button[id],
#tf-arena-root [data-amode],
#tf-websettings-root .tf-set-nav {
  min-height: 44px;
}
#tf-workspace-header button[id] {
  border-color: var(--tf-border);
}
#tf-workspace-header #receiptBtn {
  background: var(--tf-primary) !important;
}
#tf-arena-root {
  background: transparent !important;
}
#tf-arena-root .tf-arena-wrap {
  max-width: 55rem;
}
#tf-arena-root .tf-arena-header {
  padding: clamp(1rem, 3vw, 1.7rem);
  background: linear-gradient(125deg, var(--tf-surface), var(--tf-tint));
  border: 1px solid var(--tf-border);
  border-radius: 1.25rem;
  color: var(--tf-text);
}
#tf-arena-root .tf-arena-header p {
  margin-block-end: 0;
}
#tf-arena-root #tf-game-switcher-bar > button {
  min-width: 0;
  white-space: normal;
  min-height: 44px;
}
#tf-webfocus-root,
#tf-websettings-root {
  max-width: 47rem;
  padding-inline: clamp(1rem, 3vw, 2rem);
  padding-block-start: 4.25rem;
}
.tf-focus-clock {
  color: var(--tf-text);
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  margin-block: .25rem .8rem;
  direction: ltr;
}
#tf-web-record-panel {
  background-color: var(--paper) !important;
  background-image: radial-gradient(ellipse at 70% 0%, var(--tf-tint), transparent 42rem) !important;
  color: var(--tf-text) !important;
  padding-block-end: calc(6rem + env(safe-area-inset-bottom, 0px)) !important;
}
.tf-record-layout {
  max-width: 48rem;
  margin-inline: auto;
}
.tf-record-controls {
  padding: clamp(.9rem, 3vw, 1.5rem);
  border: 1px solid var(--tf-border);
  border-radius: 1.25rem;
  background: var(--tf-surface);
  margin-block-end: 1rem;
}
.tf-record-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 4.5rem;
  margin-block-end: .8rem;
  border-radius: .9rem;
  background: var(--tf-tint);
  color: var(--tf-outline);
}
.tf-record-visual i {
  width: .3rem;
  height: 1.35rem;
  background: currentColor;
  border-radius: 1rem;
}
.tf-record-visual i:nth-child(2n) { height: 2rem; }
.tf-record-visual i:nth-child(3) { height: 2.7rem; }
.tf-recording .tf-record-visual i { animation: tf-record-pulse .72s ease-in-out alternate infinite; }
.tf-recording .tf-record-visual i:nth-child(2n) { animation-delay: -.35s; }
@keyframes tf-record-pulse { to { transform: scaleY(.45); } }

#tf-social-modal #tf-social-card {
  background: var(--tf-surface) !important;
  border: 1px solid var(--tf-border) !important;
  color: var(--tf-text) !important;
  max-block-size: min(86vh, 60rem) !important;
  box-shadow: 0 1.2rem 4rem rgb(0 0 0 / 25%);
}
#tf-social-card [data-stab] { min-height: 44px; overflow-wrap: anywhere; }
#tf-gems-pill { min-height: 44px; }
html body #tf-web-tabbar {
  background: var(--tf-surface) !important;
  border: 1px solid var(--tf-border) !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 30px rgb(0 0 0 / 28%) !important;
  padding: 6px !important;
}
html body #tf-web-tabbar > button {
  color: var(--tf-secondary) !important;
  min-height: 44px;
  min-width: 0;
  padding: .45rem .85rem !important;
  line-height: 1.15;
  white-space: nowrap !important;
  border-radius: 999px !important;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
html body #tf-web-tabbar > button.active {
  background: transparent !important;
  color: #fff !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
html body #tf-web-tabbar > .tf-slide-pill {
  display: block !important;
  top: 6px !important;
  bottom: 6px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #5B4CF5, #6366F1) !important;
  box-shadow: 0 4px 18px rgb(99 102 241 / 48%) !important;
}
html body :is(#tf-workspace, #tf-workspace-header, #tf-arena-root, #tf-webfocus-root, #tf-websettings-root, #tf-web-record-panel, #tf-social-card, #tf-web-tabbar)
  :is(button, a, input, textarea, select, summary):focus-visible,
html body #tf-gems-pill:focus-visible,
html body #tf-workspace #dropZone:focus-within {
  outline: 3px solid var(--tf-outline) !important;
  outline-offset: 2px;
}
@media (max-width: 45rem) {
  #tf-workspace-header > div:first-child { padding-right: .9rem !important; }
  #tf-workspace-header > div:first-child > div:last-child { flex-basis: 100%; }
  html body #tf-web-tabbar > button {
    font-size: clamp(.625rem, 2.5vw, .8125rem) !important;
    padding: .38rem .25rem !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #tf-workspace #generateBtn { width: 100%; }
  #tf-arena-root #tf-game-switcher-bar { gap: .2rem !important; }
  #tf-arena-root #tf-game-switcher-bar > button { padding-inline: .15rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html body :is(#tf-web-tabbar, #tf-workspace, #tf-webfocus-root, #tf-websettings-root, #tf-web-record-panel, #tf-web-onboard) {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html body :is(#tf-workspace, #tf-web-record-panel, #tf-web-onboard) * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.tf-source-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem 1rem;
}
#tf-gems-pill {
  right: auto !important;
  inset-inline-end: max(12px, env(safe-area-inset-right, 12px)) !important;
}
#tf-workspace #dropZone .underline {
  color: var(--tf-outline);
}
#tf-workspace #clearBtn {
  color: #a22540;
}
html.dark #tf-workspace #clearBtn {
  color: #fda4b4;
}
#tf-arena-root #tf-game-switcher-bar {
  max-width: 55rem !important;
  border: 1px solid var(--tf-border);
  background: var(--tf-surface) !important;
  gap: .4rem !important;
  padding: .5rem !important;
}
html body #tf-arena-root #tf-game-switcher-bar > button {
  min-height: 3.25rem;
  padding: .4rem .2rem !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  color: var(--tf-text) !important;
  background: var(--tf-tint) !important;
}
html body #tf-arena-root #tf-game-switcher-bar > button.tf-tab-on {
  background: var(--tf-primary) !important;
  color: #fff !important;
}
#tf-arena-root #tf-game-switcher-bar > .tf-slide-pill { display: none; }
#tf-websettings-root .tf-set-head-title {
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  line-height: 1.25;
}
#tf-websettings-root #tf-set-search:focus-visible {
  outline: 0 !important;
}
#tf-websettings-root .tf-set-search-wrap:focus-within {
  outline: 3px solid var(--tf-outline);
}
#tf-social-modal { z-index: 2147483647 !important; }
@media (min-width: 48rem) {
  .tf-source-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
@media (max-width: 33rem) {
  #tf-workspace-header > div:first-child > div:first-child {
    max-width: calc(100% - 6rem);
  }
  #tf-arena-root #tf-game-switcher-bar { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (prefers-reduced-motion: reduce) {
  #tf-arena-root :is(.tf-anim-in, .tf-anim-pop, .tf-anim-shake, .tf-anim-pulse),
  #tf-workspace-header, #tf-gems-pill {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  #tf-web-onboard.tf-ob-leaving, #tf-web-onboard.tf-ob-leaving .tf-ob-card {
    transform: none;
    filter: none;
  }
}
#tf-rec-close { display: none !important; }
